Images in dynamic textbox

Is it possible to add a small image using html or something like that to a dynamic textbox (Like litte emoticons)…?

nope, but you can load a jpg via loadMovie into a empty movie clip and use some strategic positioning.

see> help | working with text | working with text overview

<quote>ActionScript also provides several ways to format your text at runtime. The TextFormat class lets you set character and paragraph formatting for TextField objects (see Using the TextFormat class). Flash Player also supports a subset of HTML tags that you can use to format text (see Using HTML-formatted text). Flash Player 7 and later supports the <img> HTML tag, which lets you embed not just external images, but also external SWF files, as well as movie clips that reside in the library *see Image tag (<img>)).</quote>

i’ve got little problem to loadVars in MX2004 so haven’t success yet…

anybody so kind to send his to others?? :slight_smile:

:h:
http://www.macromedia.com/support/flash/ts/documents/htmltext.htm

indo- what kinda of problem are you having?

It’s for flash 5 :h: we are in MX2004 isn’t it??

<B>read flashMX2004 > help | working with text | using HTML-formatted text </B>

& ma problem is
[AS]loadText = new loadVars();
loadText.load(“news.txt”);
loadText.onLoad = function() {
news.html = true;
news.htmlText = this.content;
};[/AS]

it works fine in MX & so in MX2004, but I get this output

Warning Scene=Scene 1, layer=action, frame=1:Line 1: Case-insensitive identifier ‘loadVars’ will obscure built-in object ‘LoadVars’.
loadText = new loadVars();”

i wonder why?

yea, in MX2k4 you have to use a capital L:
This topic is ALL over the forums. I even got in a debate with someone about this.

my_lv = new LoadVars();

When you try and post formatting code in the fourms use brackets ‘[]’ instead of angle-backets ‘<>’

And, yes it DOES say Flash 5, but if they would have changed the htmlText policy, don’t you think they would have updated the page :h: :beam: Trust me, the only way you can load pics dynamically (with out importing to flash) is to use loadMovie. Trust me. :wink:

I GOT IT!!!

[COLOR=red]loadVars[/COLOR] must typed [COLOR=red]LoadVars[/COLOR] !!

it’s really buggin me!!

yea it pays off to actually READ the warnings

btw for the Supported HTML tags… this text is copied from the help if u don’t believe me…

Image tag (<img>)
The <img> tag lets you embed external JPEG files, SWF files, and movie clips inside text fields. Text automatically flows around images you embed in text fields. This tag is supported only in dynamic and input text fields that are multiline and wrap their text.

To create a multiline text field with word wrapping, do one of the following:
In the Flash authoring environment, select a text field on the Stage and then, in the Property inspector, select Multiline from the Text Type pop-up menu.
For a text field created at runtime with MovieClip.createTextField(), set the new text field instance’s TextField.multiline and TextField.wordWrap properties to true.
The <img> tag has one required attribute, src, which specifies the path to a JPEG file, a SWF file, or the linkage identifier of a movie clip symbol. All other attributes are optional.

The <img> tags supports the following attributes:

src Specifies the URL to a JPEG or SWF file, or the linkage identifier for a movie clip symbol in the library. This attribute is required; all other attributes are optional. External files (JPEG and SWF files) are not displayed until they have downloaded completely.
Note: Flash Player does not support progressive JPEG files.

id Specifies the name for the movie clip instance (created by Flash Player) that contains the embedded JPEG file, SWF file, or movie clip. This is useful if you want to control the embedded content with ActionScript.
width The width of the image, SWF file, or movie clip, in pixels.
height The height of the image, SWF file, or movie clip being inserted, in pixels.
align Specifies the horizontal alignment of the embedded image within the text field. Valid value are left and right. The default value is left.
hspace Specifies the amount of horizontal space that surrounds the image where no text will appear. The default value is 8.
vspace Specifies the amount of vertical space that surrounds the image where no text will appear. The default value is 8.
For more information and examples of using the <img> tag, see Embedding images, SWF files, and movie clips in text fields.

you better save this thread or something,… ok, i’ll admit it, you’re … you’re… ggrrr… [SIZE=1]right[/SIZE]

I’m never wrong, with the execption of this time. … you got lucky :wink:

lol… this forum isn’t about for losing from someone… it’s about winning for everyone :smiley:

anyone wanna post some fla here?? to clear this…:slight_smile:

or maybe write tutorial for this new HTML supported tags…

Hey I gave this a go and it worked fine.
It doesn’t work with .gifs tho.

Make the text box dynamic and ensure that multiline is on. (just like indo said to do).

Then inside your external file throw in <img src=“myfolder/mypic.jpg”>

So that is two of us that got it to work, so it must be true :wink:

This has been bothering me. :h: Is there any way to make the image thats loaded to stay in bettwen a bunch of text… instead of always skooding to the side of the text box?

-Aditya

You could do a three column approach and just have the pics load in the middle column.

I dont mean like middle as in middle aligned… I mean more like

if I have code like this…



blah blah blah... <img src='image.jpg'> more text...


I want to it show up as

blah blah blah… [image will show up here] more text…

I am trying to do this for a chat thing. So the image is bascially an emoticon…

Thanks in advance,
Aditya

someone? :h: