Re: [Flashcoders] AS3 dynamic text fields and img

2008-09-09 Thread sebastian

hmmm, have you tried:

textFieldName.text += img...

if that is not working, then try building it all in one sentence:

imgAtEnd = img...
segment1 = some value + imgAtEnd;
//segment2 = same as segment 1 and 3 and 4 only with new different values
textFieldName.text = segment1 + segment2 + segment3 + segment4;

Maybe I'm over simplifying though...
:P

Jessica Criscione wrote:

I have an AS3 project where an icon is supposed to follow the text in a
dynamic, multi-line text field. Right now, I'm appending it as an img tag
at the end of the text. My problem is that it seems AS3 is always bumping
the img down to a new line unless it's the first item in the string. No
amount of css or parameter settings seem to have any effect.

Does anyone know any way around this other than calculating the text length
and appending the icon clip afterwards? Am I just missing something obvious?
Any help would be greatly appreciated.


Jessica



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] AS3 dynamic text fields and img

2008-09-09 Thread Keith Reinfeld
Jessica, 
 
 My problem is that it seems AS3 is always bumping 
 the img down to a new line unless it's the first item in the string. 
 
This behavior hasn't changed from earlier versions of AS. 
 
 Does anyone know any way around this other than calculating 
 the text length 
 and appending the icon clip afterwards? 
 
I don't believe there is any way to automate the placement of the image tag
without iterating over the textfield for character widths and line counts. 
 
You didn't say where your text is coming from (or how much there is) so it
is hard to know how practical a manual trial-and-error solution would be for
you. 
 
One possibility would be to manually place the image tag in the block of
text such that it is within the second to last line as it is displayed in
the textfield. Your image will still be right aligned. 
 
Or 
 
I am guessing from your use of the phrase icon clip that the images you
want to use are in the .fla library rather than external. That being the
case, what you can do is create a parent clip with the desired linkage name
that has a child clip with the actual image and an instance name 'icon'. The
idea here is to use the child clip's _x and _y properties to position the
actual icon image wherever you like. You will need to set the image tag's id
attribute (for the parent clip) in order to target the child clip's
properties. 
 
For example: 
 
textFieldName.someImageID.icon._x = -10; 
textFieldName.someImageID.icon._y = -10; 
 
The exact details regarding how this could be set-up depend on how you are
loading your text. 
 
Regards, 

-Keith 
http://keithreinfeld.home.comcast.net
 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders