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.
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.
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?!!
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.
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.
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.
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
Creating engaging and entertaining content for designers and developers since 1998.