PDA

View Full Version : Variable pathing


DeweyTIme
06-01-2001, 02:03 PM
I'm working on something pretty simple for my own experimental newbie purpose.

I'm working on a chooser based on time.

The main stage contains the contains the chooser called mChooser that displays a picture based on the time.
The main stage also contains a movie clip called mTime that contains two frames. Frame one sets the variables based on local time, h:mm:ss, and frame two sends it back to frame one to update the variables.

/mChooser
Main Stage (_root)-
\mTime

Variable: hour

The main stage is just one frame. When I have mChooser call to the hour variable I use _root.mTime:hour but it doesn't work. When I put the set hour variable script on the main stage and use _root:hour in mChooser it works with expected correct results. However, I can't have the variable update itself on the main timeline.

I'm probably doing it all wrong, but I thought to call grab a variable in a movieclip from a movieclip you can just go from _root.

I just thought of something. Everything happens on frame one in all the movie clips. Main stage starts mTime and mChooser on frame one and the set variable script in mTIme and the chooser script in mChooser happen on frame one. I probably need to set the variable on frame one and then ask for it on frame two.

I don't know...help would be grateful.

Jesse
06-02-2001, 05:37 AM
No you can set it ask for it straight away. Does the chooser clip loop? You might find that it loads before the timer clip and thus asks for the variable before it exists and if it doesn't loop it doesn't ask again.... I would suggest keeping your variables on the main stage, so in your looping timer clip set the variable to _root.hour (note that the colon and the dot are the same in terms of variables in Flash 5).
Post the files if you're still having trouble, it's hard to get a grasp of what you're doing exactly.
Also rememebr to use Ctrl Alt V in the Test Mode to view your variables and paths for debugging.

DeweyTIme
06-06-2001, 06:40 AM
Thanks for the help. I tried something a little different and it works fine now and it's a little better. Someday I'll be able to figure this stuff out.


Dew...