Hi everybody, I have a small problem, I hope I can find an answer here . I like using external CSS files instead of internal CSS presets, they are a lot easier to manage (for buyers). But for example when you have to make a text field scrollable, you have to auto size it (right? I don’t know any other methids anyway :D). But if I use autoSize, and for example in the external CSS file I use font sizes like 10 and 50, but the font size of the dynamic text field that displays the css styles is 12, flash calculates the height of the text field for the font size 12 (the size that the text field has). That only happens with external CSS , if I use internal presets everything is good, flash calculates the right textHeight, depending on the font sisez given by the CS presets. Is there a way to tell flash to calculate the textHeight depending on the font sizes from the external CSS file? Thank you
Solved it. If anyone cares :)))))
What did you do?
I have a similar issue but it isn’t CSS , it’s images. If I have a dynamic textfield and I use the img tag, the height of the image is ignored when flash is calculating the height of the textfield. Maybe your fix would work for my problem as well.
Well, with images is something else. If I have scrollable text wich contains images (xml driven) I always use extraPixels to scroll in the XML . So the user, if he wants to use images in the scroller, will put in the extraPixels some extra height (usually half of the image’s height). Making flash read the height of an image inside a dynamic text field is a mistery to me, if that’s possible.
The only idea I’ve had so far is to give the img tag and ‘id’ attribute. With an id attribute you can address the contents of the img tag. I’m going to try and put an event listener on the img tag and get the textfield dimensions again after the pic has loaded.
Do you mean something like when controlling external swf movies from a dynamic text field? When you id the swf movie? I’m not sure I understand what you mean .
Yeah. When you use the img tag the flashplayer is actually creating an instance of the loader class and adding it as a child of the textfield. When you reference that loader (using the id attribute) you should be able to put a listener on it.