PDA

View Full Version : Getting Variables from inside movie clips in MX



The Rogue
May 18th, 2003, 06:10 PM
Currently i stuck with a project i'm working on, as some variables are inside of a movie clip, and i can't seem to access them from the main timeline.

Anyone know how?

RvGaTe
May 18th, 2003, 06:11 PM
those variables are use for that mc/timeline only...

you can acces them by using

_root.yourmc.varname

or, make you var's global, so you can use them on EVERY clip...
like:

_global.varname = "hello";

should help

The Rogue
May 18th, 2003, 06:18 PM
no luck with that.

All i'm trying to do is display a score on the main timeline in a dynamic text box.

The variable is called score and is inside a movie called "Quiz1" with the instance "quiz"

RvGaTe
May 18th, 2003, 06:19 PM
allright, when you calculated the score, store it in a global variable... like:



_global.score = score;


then, on the main timeline, use this code to apply it to the textbox



textbox.text = _global.score;
// or
textbox = _global.score;

The Rogue
May 20th, 2003, 01:04 PM
Well, i'm completely stuck here and i can't get it to work, so could someone do it for me?

The quiz with the variable "score" inside is on frame 4 and i'm attempting to get the score to display in the dynamic textbox next to conversation in frame 6.

thanks

the .fla is availble here.

http://rogue.breezeland.com/flash/jason2003.fla

The Rogue
May 20th, 2003, 01:16 PM
Well, i'm completely stuck here and i can't get it to work, so could someone do it for me?

The quiz with the variable "score" inside is on frame 4 and i'm attempting to get the score to display in the dynamic textbox next to conversation in frame 6.

thanks