# Using the \<img\> tags

**URL:** <https://forum.kirupa.com/t/using-the-img-tags/42007>\
**Category:** flash\
**Created:** [February 4, 2004, 3:23am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007 "2004-02-04T03:23:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![3d\_Nirvana](https://avatars.discourse-cdn.com/v4/letter/3/a88e4f/32.png) [@3d\_Nirvana](https://forum.kirupa.com/u/3d_Nirvana)\
**Post date:** [February 4, 2004, 3:23am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/1 "2004-02-04T03:23:20Z")

</div>

Hi all!,

I’m trying to use the \<img\> tags to display a picture in my dynamically loaded text (from a .txt file) .

Here is the code I’m using to load my external text file:

on (release) {  
loadText = new LoadVars();  
loadText.load(“TEXT1.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
textBox.html = true;  
textBox.htmlText = this.textContent;  
}  
};

}

Here is what is in my text file that I load:

\<img src=‘image.jpg’\>

The text that is also in my file loads and I can see that, the \<img\> tag code is invisible meaning it recognized it as code and did not display it as text. Even though the \<img\> text is gone it refuses to show my image. I have tried just about everything I know of and can’t get it to work.

Please help!

Thanx in advance

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 4:12am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/2 "2004-02-04T04:12:33Z")

</div>

I am not sure about MX 2004 but in MX, the html reader in flash only accepts a few tags, and the others it refuses as you said. I don’t know how to fix it but you may be able to use the scrollpane component.

I know this isn’t much help, sorry.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 5:09am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/3 "2004-02-04T05:09:40Z")

</div>

Save the text file as an html file, then just load TEXT1.html.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 7:35am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/4 "2004-02-04T07:35:08Z")

</div>

The image has been probably saved as a progressive JPEG?

[http://www.macromedia.com/support/flash/ts/documents/cant\_load\_jpg.htm](http://www.macromedia.com/support/flash/ts/documents/cant_load_jpg.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 9:20am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/5 "2004-02-04T09:20:28Z")

</div>

or is not in the same folder…  
or is not even a jpg…  
you never know 😃  
in most cases, it’s the (stupid) progressive jpg!  
I still don’t understand why Macromedia decided to go with jpg instead of png, as this is fireworks native format + supports transparency?!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 11:37pm UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/6 "2004-02-04T23:37:05Z")

</div>

thanx everybody… but it’s still not working. In photoshop I made sure I saved it as a baseline jpg instead of a progressive. I also made sure it is in the same folder. Changing it to a html file didn’t work eather, although when you cliced on the actual html file the image showed up, but did not load in flash.

could it be a problem with saving in photoshop?

thanx again guys

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 5, 2004, 8:30am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/7 "2004-02-05T08:30:54Z")

</div>

post the fla, the text and one of the jpg’s

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 5, 2004, 3:08pm UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/8 "2004-02-05T15:08:09Z")

</div>

Ok, here’s a cut down version of the fla (removed a lot of graphics and other buttons). Also included is the jpg I’m trying to load, and the text file that loads the jpg.

[Click here to download the zip](http://www.3dnirvana.com/flajpgtxt.zip)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 5, 2004, 11:32pm UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/9 "2004-02-05T23:32:37Z")

</div>

Ok, I got a little farther. When I make a basic scene with just a text box, and put the code to open my text file on the frame, it works just fine. When I add a button to execute the code instead of the frame, and run the fla file, and click on the button, the text loads, but the jpg does not.

Any suggestions?

Thanx in advance

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2004, 5:42am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/10 "2004-02-06T05:42:15Z")

</div>

I got it, just had to start over, fla must have been corrupt or something.

Thanx all for your help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 12, 2004, 1:40am UTC](https://forum.kirupa.com/t/using-the-img-tags/42007/11 "2004-08-12T01:40:12Z")

</div>

I know this is an old thread but was hoping I could resurrect it.

I’m having similar problems to the guys above, I can get the image to load into my text field if I have the action on a frame, but as soon as I call for the action from a button it wont work?

Does anyone have any bright ideas?

Any help would be great.

Cheers, J
