Hi Kenny,
Read your mail ;-) Anyway the basics setup for loading an image in an HTML
enabled textfield.
Prerequisites: FMX2004 and publishing for flash player 7; jpg file only
which is saved non-progressive
1. create a textfile with the following:
&myVar=This is some <b>html</> text with an accompanying image. <img
src="myimage.jpg" width="150" height="100"><br>The image can only be a
non-progressive jpg (or an swf or linked movieclip for that matter.&
2 save the textfile and the image in the same folder as where the final swf
and html will be (just for convenience now). Name the textfile: mydata.txt
and make sure it is saved with UTF8 encoding.
3. start a new Flash document and draw a textfield; give the textfield the
instancename "myText_txt" in the propertiespanel
4. In the frame where the textfield sits, write this script:
// create a new LoadVars object
var myData = new LoadVars();
// write a function that will deal with the loaded data as soon as they have
been loaded
myData.onLoad = function (success){
if(success){
myText_txt.htmlText = this.myVar;
}
}
// actually start loading the textfile
myData.load("mydata.txt");
5. Hit CTRL-Enter to test the movie. If everything was done as expected you
should now see the text and the image in the textfield called "myText_txt".
It is no problem to have textfiles and images in another folder than the swf
file and HTML file in which the swf is embedded. Only thing to make sure is
that the path to any file to be externally loaded has to start from the
HTML-file location.
Hope it works by now ;-)
John
--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------