Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Parameter Files 1

Status
Not open for further replies.

lumstar

Technical User
Jan 29, 2002
177
CA
Hey guys,

I am wondering how I would go about using a parameter (text) file to modify symbols/mc's in the movie. For instance, could I set the tint or alpha of a certain symbol at a given point in the movie?

Secondly, is it possible to use a text file to point to which photos should be loaded into the gallery, that way, I need only modify the text file to display different photos.

Thanks in advance! __________________________________
Keep On Coding!!

Lumstar
 
Both things are possible since an external text file treated as a variable or list of variables.

To change properties of a clip you simply load in values from the text file and set them up like this.

textfile

clipAlpha=80&clipScale=110

Flash
loadVariables("values.txt","");
myClip._alpha=clipAlpha;
myClip._xscale=clipScale;

To point to a gallery, have your photo converted into its own movie (Flash can only load .swfs not .jpegs - unless you're using Flash MX) and have your textfile variable identify the movie you want loaded:

text
gallery="myPhoto.swf"

Flash
loadVariables("values.txt","");
loadMovie(gallery,"_level1");

Remember that Flash needs time to load the variables - build in a delay of some kind before actually trying to use the values, if you take the above code without doing this the movie will run on to the next line before the variables are loaded so nothing will happen.

Slainte

 
Thanks a lot! Sounds good!

I actually am using MX, how would i load the images as .jpg's or gif's rather than inserting them into an mc? __________________________________
Keep On Coding!!

Lumstar
 
Well I got a job from a new client today that requires using MX for the first time so I'm about to unwrap the box and find out how to do exactly that thing myself! Slainte

 
Nice!

I think you will like the panel sets in MX, they really make it customizable.

Keep Me Posted! __________________________________
Keep On Coding!!

Lumstar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top