|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Dynamically display jpeg
I want to display a jpeg in a Flash movie based on a value in a MIME-format text file.
The text file is called "variables.txt", and contains the following: inum=image1.jpg; The following obviously works: _root.createEmptyMovieClip("imageHolder1",200); imageHolder1._x=0; imageHolder1._y=100; loadmovie("image1.jpg","ImageHolder1"); But how do I replace the hard-coded image name with the value of the variable? Is it even possible? Thanks. |
|
#2
|
|||
|
|||
|
hey, you'll want to load the values from the text file. And generally when you load variables, they need to be formatted like:
&variable=value&variable2=value2... So, if you had a text file "variables.txt" with: &inum=image1.jpg in your flash movie, you sould say: PHP Code:
You could also make an array of images in your text file, but there is no way to natively load in an array, you'd have to delimit your variables by something weird and then parse in flash: &images=image1|image2|image3|image4 in flash you could just use the split method to make a flash native array. (flashImages = images.split("|"); ) hope that helps, bret |
|
#3
|
|||
|
|||
|
Bret,
Works beautifully. Thanks for taking the time to reply. Ian |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Dynamically display jpeg |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|