This content has been marked as final. Show 11 replies
positioning graphics in flash textfields is always a problem. especially when loading an external graphic whose dimensions can't be determined by flash until loading is complete and text has already been placed in the textfield.
using width and height parameters in the img tag helps. but it's usually necessary to make use of line breaks and empty spaces to position graphics exactly.
you can use a movieclip in a textfield by assigning it a linkage id and using that id as your src parameter.
How i can make a link to the object in the library?
Must it be a Movieclip or can it also be a Bitmap?
I have one bitmap in the library named "cool.gif" and if i write: <img src="cool.gif"> the programm crashes.
Can you explain me how to make a link in the textfield to a component in the library?
Ok now i understand how to link to them. But it doesnt work..
the mc also comes in the next line. Is there a Method to preload the clip and then place it there instead of the string?
no, you can't preload the image and then add it to a textfield.
you can import the image to your fla, convert it to a movieclip and then use its linkage id.
if "...it doesn't work..." it's because of an error on your part.
you'll need a multiline html-enabled textfield and you'll need to use the correct code and you'll need to have the linkage id assigned for a movieclip.
Yes of course it would be a error in my part.... BUT
i have done this what you say..
textfield (multiline and html enabled )
movieclip with the link id
img tag with the id as src...
and its the same fault:
smiley apears on next line....
Ive find in the help of the Flash that it's not working !
So i must do it on the other way?
how i can get the x and y positions of a string in a text?
And then put the movie clip on this positions ?
Thanks for help
oh, if you're smiley's appearing it IS working. as i mentioned in my first message above, positioning your smiley is always a problem with flash.
and, as i mentioned, using width and height parameters in the img tag helps. but it's usually necessary to make use of line breaks and empty spaces to position graphics exactly.
Can you give me an example please?
i have mak my image the smallest one width="1" heigth="1" but its also in the next line.
i have tried a lot of brakes and spaces,, its the same at all.
I think i must get the x and y coordinates of the string like "88" and then replace the movieclip on it..
But how i can do that?
Another question is,.. if they are stay at the same position in the textfield or if they also scroll with the textfield
what are the dimensions of your image? what are the dimensions of the textfield and what text do you want to appear before the image and what text do you want to appear after the image?
Textfontsize is 12
Image size is 10*10
The Code to change the string into tag:
newChattext = newChattext.split(':)').join('<img src="MovieClipID">');
I only want to set smileys instead of the " :) " for example.
But if i write this it comes on the next line what ever i am doing !
You're nice :) tell me something about you
the outcome on textfield is like this:
You're nice <space> tell me something about you
:) ( its the movieclip but on the wrong place!)
And this should not be.
Sooo i want to get the x and y variable on the textfield of the string ":)" and set
the movieclip in this postition of the clip.
I hope now i could explained my problem.
there are all sorts of problems positioning objects (other than text) in flash textfields. i don't know any general solution.
in particular, positioning an object on the first line of text, when it's not at the beginning, is difficult or impossible.