-
Get the height and width of an image
I have therefore some images in my program that I'm loading. These images are much longer than the size of the screen. So I put in a ScrollView. My question is how can I get the height and width of an image. The image.width and image.height doesn't return the correct values.
//add the image
private function addImage():Container {
var sp1:Container = new Container();
sp1.sizeUnit = SizeUnit.PIXELS;
sp1.debugColor = 0xFFFFFF;
sp1.margins = Vector.([1,0,0,0]);
sp1.align =ContainerAlign.NEAR;
//sp1.setSize(650, 800);
var myPattern:RegExp = / /g;
var fileName:String = "./com/swiz/img1.png";
var icon:Image = new Image();
icon.setImage(File.applicationDirectory.resolvePath(fileName).url);
//icon.setPosition(0,0);
//icon.setSize(320,800);
sp1.addChild(icon);
sp1.setSize(650, icon.height);
return sp1;
}
and my code scrollview is
//add to the scrollView
var scroller:ScrollPane = new ScrollPane();
scroller.width = 650;
scroller.height = 505;
scroller.y = 0;
scroller.addScrollContent(addImage());
addChild(scroller);
Thanks in advance!
Hey shethab,
in order to retrieve the height and width of your image, you must use use the an event listener on your image and check for the Event.COMPLETE event. What is happening because the image you upload is not built, it takes time to load into your application using the setImage() method. and when you check the width height after the setImage method, the image was not loaded and has no height and width to this second. If you use the event listener, you can retrieve the height and width as it was finally loaded.
Try the following code:
import flash.events.Event;
//add the image
private function addImage():Container {
var sp1:Container = new Container();
sp1.sizeUnit = SizeUnit.PIXELS;
sp1.debugColor = 0xFFFFFF;
sp1.margins = Vector.([1,0,0,0]);
sp1.align =ContainerAlign.NEAR;
//sp1.setSize(650, 800);
var myPattern:RegExp = / /g;
var fileName:String = "./com/swiz/img1.png";
var icon:Image = new Image();
icon.setImage(File.applicationDirectory.resolvePath(fileName).url);
icon.addEventListener(Event.COMPLETE, onImageLoaded);
//icon.setPosition(0,0);
//icon.setSize(320,800);
sp1.addChild(icon);
sp1.setSize(650, icon.height);
return sp1;
}
private function onImageLoaded(e:Event):void
{
trace("image height: " + e.target.height + " image width: " + e.target.width);
}
hope that somethings brightened. Good luck!
-
In the dialog box constant value
Hello
Is it possible to keep the values in the dialog box once I entered? I mean there is value if I run the script again?
var myWidth=prompt("PLEASE ENTER YOUR TEXT FRAME WIDTH VALUE (IN POINTS)","")
For example if I get 10, next time, that the default value must be 10.
Not sure we can use const not variable (var)?
Kind regards
Kitty
Well, not quite. Before displaying the prompt, you want to extract the label. So move the line before 04 08 and change 04 to something like:
myWidth = prompt ("Enter etc...", myWidth)
and then it should work. Obviously, test it first.
Ariel
-
The different paragraph of distinct character style formatting
Hello
In my paper, I have bunch of paragraphs and each begins with the name (two or three words). Character style is applied to each name. Now, I want to add the paragraph after each name of each mark is so in its own paragraph. Of course, I can do it manually, hitting enter after each name, but I was wondering if there is a more efficient way through search/replace or perhaps GREP.
Thank you!
m
Try this on a copy to be sure, but I think finding ^. + and set the format to find the character style, and then change to $0, you can also set the change of any character Style Format and a new paragraph Style that is applied by the character style formatting.
This will probably leave you with a space at the end of the paragraph, or the beginning of the next. The location will depend on if the style is applied to the space. If this is the end of the paragraph, you can use find find ^(.+) (\s) and change to $1
If it's at the beginning of the next paragraph, in my opinion, you need a second query, Find ^ /s (leave find it empty format or the value initially attributed the paragraph style) and do not fill the field exchange.
-
How can I have a fluidarea whose maximum width value?
I have a design where I want than a div with the background full width - where the 100% value
< div id = "ContentArea" style = "width: 100%;" background-color: #F55; >
< div id = "FIXEDCOLUMN" style = "width: 60px banner; >
some content here
< / div >
"< div id ="FLUIDAREA"style =" width:MAX900; background-color: #FFF; >
some content here
< / div >
< / div >
I can therefore defined the FLUIDAREA div on a maximum width of 900
I want FIXEDCOLUMN to the left of FLUIDAREA (with left float or something)
I want the FIXEDCOLUMN and FLUIDAREA columns to be centered in the ContentArea (width of margin auto setting I guess?)
How can I achieve this?
Do I need another div around these to max 960 to wrap them up?
Thank you.
Max-width: 900px;
-
PivotTable: even with Page breaks, must define the column same widths on the Pages
Hello:
I have a PivotTable with the page breaks on column 1. Change the width of each column and therefore the total width of the table on each page.
How can I set the widths and the overall page widths, is the same on each page?
Thank you-
Charlie EPEs
Buffalo, NY In pivot mode
Go to the properties of content (just above the lines)
Additional options - then in width of formatting... give values such as 1000 or 100px
see if it helps...
Thank you
Ashish
-
Image text wrapping negatively affects the balanced paragraphs - need help
I have CS5 - 5. I'm no expert, but I am using the program for a number of years in the design of flyers, brochures, posters and short brochures. Now I'm on my first magazine and I thought that all the features balanced new paragraph would work a breeze - it didn't! So, I have a page of A4 size with a block of text in two columns that fills (have also the text flows on the next page if it's relevant). The text is 10pt with a line spacing of 12 pt. Everything is good so far. I used paragraphs balanced in a first time to have the two columns of text aligning horizontally. Seemed fine. However, as soon as I drop an image into the mix, the width of a column (lower left corner of the page), simple text wrapping, text changed less satisfactorily. Text above won't come down to meet the upper part of the image, no matter what I put in measures to wrap text or what kind of film I use. Also the text to the right of the image is more down to the bottom of the text block. The problem is further compounded when I integrate a quote as a separate object.
Then I disabled the balanced paragraphs feature and used a grid of base line instead, taking up many of the suggestionson another discussion and also using advice elsewhere on the net. Useful in a sense that it helped me to learn more about what baseline grid but I am still with my problem.
I could be wrong, but I don't think that I ask the program to do anything complicated. It's not as if the text should wrap around the object. I know that I could get the effect I want to using single column text blocks and get text to flow from one to the other, but it is certainly not how it should be? If you like I can send screenshots, but I'm not sure it would help. I write this in the morning in England so I know that many of you will still be sleeping. However, once you have had your first cup of coffee of the day, maybe you could give me a little help? Needless to say that any advice that anyone could offer would be warmly accepted.
Best wishes to all,
John
If I had to guess, by looking at your screenshots, I would say that you have a possibility to keep in your style on the last two lines of the paragraphs together and that there is not enough space to the bottoom of the image for more than two lines, but you do not have we shown the contours of the block.
-
Set the height and width of pop-up window.
Hi friends,
I have a button Add a new element on the page no 1.i have 3 not on page no 2 as ITEM_CODE, nom_element AND STATUS.
I want when I click on add new item on the page no 1, and then open the page not 2 like a window popup with the height and width 500 700 and after press submit value insert into the table and pop-up window must be close.
I take model Popup
How can I adjust height n weidth of page 2 of the popup.
Thank you Hello
You must be a mistake. Process of Close popup works very well in Apex 3.2.
Remove all branches of page 20 and check that you have not any condition the process Close popup
Kind regards
Jari
-
Count the unused paragraph styles
I want to check InDesign documents my students to see if they have been neatly with their style sheets. I have a script that works partially (I think this would work in CS4, if you replace CS4 CS5).
The bit that does not try to save the styles within groups. I commented in the script to display the error section. I get the error:
"Invalid value for the set property" applied paragraph style". "Planned to string, the style section or anything, but will put \"body text (body). " "number 30477
I tried to put the name of the style and the group, because that's how it works if you do it manually, IE body text (body). But it does not work.
Any help would be appreciated.
property myTypeReport: ' " - makes available anywhere.
" game of myTypeReport to '" - prevents report becomes cumulative when running several times.
Tell application "Adobe InDesign CS5"
the value myDocument to rating 1
game of unusedStyles to "'
game of myFoundItems to "'
game myDescription to "unused paragraph styles"
the value myParagraphStyleGroups for each paragraph style group of myDocument
the value myParagraphStyles for each paragraph style of myDocument
Repeat with I have a 3 in (County of myParagraphStyles)
define myStyle to the the point i of myParagraphStyles name
the value find text preferences for Nothing
the value text preferences to change anything
the value applied paragraph style to find text preferences to myStyle
tell myDocument
the value myFoundItems to find text
if (account myFoundItems) = 0 then the value unusedStyles to (unusedStyles + 1).
end say
end Repeat
-This is the section of the error
Repeat with x 1 to the number of myParagraphStyleGroups
set myGroup to the of the point x of myParagraphStyleGroups name
the value myParagraphStyles for this entire paragraph styles to paragraph style group myGroup of myDocument
Repeat with I have from 1 to (count of myParagraphStyles)
game of myStyle to (name of point i of myParagraphStyles) & "(" & myGroup & "") " string "
-Returns the myStyle
the value find text preferences for Nothing
the value text preferences to change anything
the value applied paragraph style to find text preferences to myStyle
tell myDocument
the value myFoundItems to find text
if (account myFoundItems) = 0 then the value unusedStyles to (unusedStyles + 1).
end say
end Repeat
end Repeat
-finish the section error
"myReport game to "(" & unusedStyles & "")" " & "\t\t" & myDescription
if (County unusedStyles) > 0 then the value myTypeReport to myTypeReport & myReport and return
return myTypeReport
end say
Can you make best use of all styles of paragraph in your document instead of styles of paragraph of the document, which should access the independent styles of groups? You would have to give on the name using as reference (probably a good thing anyway) and use the style itself (in your find/replace).
-
Result of the FTS - column width
Does anyone know if it is possible to specify the width of the columns title and rank that display the FTS results? For now, looks like they are 50-50. I would like to make the broadest possible title column and press the rank column upward. Also, can I change the symbol used to sort the columns of an image?
I had a curious in whfhost.js, but not joy.
Thank you
Jonathan
Just to summarize what is mentioned in the specified thread and reply to the second request insertion of an image for sorting...
To reduce the width of column Rank
1. find the writeTableHead function in the whfhost.js file
2. search for TD ID = "OdinFtsRank". Two events, update the value of the width of the other according to the needs.
For example |
This should reduce the column width value.
To use an image for the sorting of columns
1 search for the definitions of gsAscendFlag and gsDescendFlag on the line no. 29 and 30 as ascenders and descenders sort respectively.
2. replace their values with the tag img with the necessary attributes. For example: something like this
gsAscendFlag = ""
"" Please specify the path to the image accordingly and include the path with \ "-------" as shown in the example.
I hope that this solves the problem.
MILIN
-
Why can't define paragraph ball in the standard paragraph style?
I want to configure my standard paragraph style so that I can quickly apply the individual paragraphs balls - using MY favorite dashes - without having to create a new style to the paragraphs of the ball. I tried to change the settings of the standard paragraph, with no document open style, but he doesn't seem to accept my choice of dashes. First of all, I selected bullets and put a dash, but then the default paragraph with bullets. When I pass the ball setting back to "none" the only thing he keeps is the last setting that I chose for the tabs. (At the same time, which changes the default tab for all paragraphs setting.) But when I create a new doct and start a paragraph of the ball, the hyphens by default always a.25 /-.25 and any tab setting LOWER a.25 results in the updated first line indented for the tab setting, but the rest of the paragraph indented a.25. There seems to be no way to change default indentation for bullets without creating a new paragraph style. And usually I'm fine with that. But I thought that I would have a default Quick using the standard paragraph style. Am I missing something or is it just not possible?
Here is a Visual/verbal screenshot to help explain:
Let's see if I understand differently from others. You want to apply bullets manually from time to time without having to select a new style, you would do this by pressing the button bulleted list in the Control Panel, and you want the settings for tabs and indents, other than the default. Is this correct?
Far as I can tell there is no way to do it. You cannot configure the settings for the chips unless the text cursor is active or if you set a style, there is no way to set up the new default values. You don't want to not set parameters whenever you need a ball, then either you type the balls by hand, tab and insert a hyphen character here, which is actually a lot more work, or you go ahead and set up the style. You can access the list of style in the menu drop-down control panel, or you can add a keyboard shortcut to give you quick access, or press Ctrl (Cmd on Mac) + entry for quick access to apply and start typing the name of the style (almost as fast as a keyboard shortcut).
-
Change/scaleX scaleY on parent puts children nationwide but don't update the height-to-width property?
created a custom component - MyImage - who has two children, a Bitmap, but also a Sprite.
My screen object hierarchy is as follows:-
mx:Canvas
view:MyImage
mx:Bitmap
my:Sprite
If I change the MyImage.scaleX, scaleY property, children at the level that I expect.
However when I try to place children at the centre using placeAgain() on obtaining a resize event:
public function placeAgain():void
{
if (image==null) return;
var pCanvas:Canvas = this.parent as Canvas;
if (image.width <= pCanvas.width)
{
pCanvas.horizontalScrollPolicy="off";
image.x = (pCanvas.width -image.width)/2;
}
else
{
pCanvas.horizontalScrollPolicy="on";
image.x=0;
}
if (image.height <= pCanvas.height)
{
pCanvas.verticalScrollPolicy="off";
image.y = (pCanvas.height -image.height)/2;
}
else
{
pCanvas.verticalScrollPolicy="on";
image.y=0;
}
alignKids();
}
I find the image.height & width have not changed despite the image getting scaled!
Isn't the child supposed to have its bounds changed after scaling its
parent ? Especially after the child has actually been scaled correctly ?
Why are bounds of the child stuck at the same value as before scaling? I
am not caching the Bitmap, have not turned on caching of bitmaps.
The getBounds() method shows the same dimensions.
It seems scaleX/Y only changes the display but does not update fields of any object with the exception of
parent where scaleX/Y has been changed.
-
Remove based on the substituted paragraph style attributes
Is there a way to clear the attributes that you put in a "based on" paragraph style, on the part of start by resetting to the base?
For example:
- 1 a paragraph style track set to + 10.
- You create 2 of paragraph 1-based Style and made several substitutions, including change tracking to + 5.
- Now you realize you want the two styles have the same follow-up and you want to experiment with this setting.
How can you erase what has been entered in the Style 2, so that any changes made to the Style 1 applies to the 2 Style once again? I realize that it is possible with character styles, but after scouring the net, I think that this should not be possible with paragraph styles.
Am I wrong? If this is not the case, why it should not be possible?
Thank you.
Go to the 2 paragraph style definition and reset the traking to the same value as the base style. It becomes as well as watt do you the basic style. Only the attributes that are different are locked.
-
The custom tab width add-on does not work in Firefox 25
I use the add-on "Width tab Custom" (https://addons.mozilla.org/en-US/firefox/addon/custom-tab-width) so that my tabs may shrink very much, but after updating Firefox 25, it seems to no longer work. This add-on incompatible with Firefox 25? In this case, is there another way to make the retractable legs infinitely?
I found the problem. The problem is in the style of elegant http://userstyles.org/styles/53190/firefox-6-disable-resizing-tab-close-behavior. I had this style for a long time, but somehow, it should have been reset, because it contained "min-width: 100px'.» When I changed that back to 1px, everything was normal again.
Thank you for your help.
-
Re: How to remove the Package of added value?
I'm having issues (media buttons no longer work) with the package of added value of Toshiba (TAVP) on my Portege M800.
I want to update, but I can't do it before removing the old version of the TAVP. When I try to install the new TAVP, I get an error message saying that I need to remove the old version first.
Problem is, I can't find the TAVP on my "Add/Remove Programs" list The internet said it should be on the list, but it is not. The programs are on my computer.
They do not seem to be among the programs 'package of added value '. How can I remove the TAVP?
I use Vista and Win7 long on two laptops from Toshiba. On two of them Toshiba Value added Package is listed in the control panel > programs and features and then you can start to uninstall option.
I've done this several times. It must be there. He is listed as TOSHIBA Value added Package. Check it out at the bottom of the list under T.