PDA

View Full Version : Basic Variable problems?


Snekums
04-07-2007, 05:13 AM
This may be the simplest thing in the world, but I cannot for the life of me work out how to do it. I'm fairly new at coding, but i've managed to work through all my problems bar this:

I have two movies, for convenience lets call them MovieA and MovieB.
MovieA is the main file, and then from that I want to open MovieB (without opening a new window), but be able to transfer all variable settings from MovieA to MovieB.

For example - say my variable (varMovieA) value ranges from 1-7, which corresponds to the visibility of certain items on the stage. I want to be able to set the visibility of similar items in MovieB, based on what is visible in MovieA, hence need to be able to transfer the value of varMovieA to MovieB.

BernzSed
04-09-2007, 12:32 AM
I see two solutions to that.

First, you could use GET data.
If you want to see GET data in action, look in your URL bar. It is probably in the form

www.domain.com/page.php?variable1=value1&variable2=value2&variable3=value3

If you use this in the URL for a Flash, it will create variables in your Flash whose values are Strings.


Or, you could restructure your Flashes so that instead of linking, one loads the other.
You could do this using the loadMovie() function, or by using the MovieClipLoader class. You can check the documentation for these at livedocs.adobe.com.

Snekums
04-09-2007, 11:40 AM
Thanks for your reply:
My flash movie is currently a stand alone program and is likely to remain that way, rather than being loaded up at a domain - is this going to cause problems? My aim is to have a program that loads from a CD, rather than a web-based animation.

I have currently been using loadMovie() to load the second movie from the first via means of a button.

BernzSed
04-09-2007, 04:47 PM
Thanks for your reply:
My flash movie is currently a stand alone program and is likely to remain that way, rather than being loaded up at a domain - is this going to cause problems? My aim is to have a program that loads from a CD, rather than a web-based animation.

I have currently been using loadMovie() to load the second movie from the first via means of a button.

If your movie is stand alone, I guess you can't use GET data.


Try using the MovieClipLoader instead of loadMovie(). You can give it an event handler that could set the variables when the movie is loaded.