Loaded movie and Parameters

Ok. I am bugged here. but here it goes

I am trying to make small games which will be displayed one after the another in sequence in a master flash movie. each game needs some external parameters like game.swf?para1=111&para2=222

Now I dont like that method because browser will redownload the whole game when parameter changes. So I am loading the movie by :

this.movExistingEmptyClip.loadMovie(“game.swf”);

i fixed the onload with prototypeing.

then in onLoad

this.movExistingEmptyClip.onLoad = function() {
this.Para1 =“111”;
trace(“Master”);
trace(this.Para1);
trace(this);
}

In the first frame of game.swf,
when i try this

trace(“Game”);
trace(this.Para1);
trace(this);

it comes out undefined.
even when trace(this); is pointing to the same movie.

here is the trace.

Master
111
_level0.movQuestion

Child
undefined
_level0.movQuestion

Am I missing something ?

I hope I am not confusing.

Regards

first trace works corectly because is called on the onLoad event.
second one dosen’t work because the trace is executed before the variables load. you should have to wait for them to load in order to trace corectly :wink:
or put in frame 1 something like
(the_name_of_the_first_mc).movExistingEmptyClip.onLoad = function() { bla bla

Actually the variables in the child movie (game.swf) are accessed in the second frame.

if they are undefined the movie goes back to frame 1 (this trick i use in all my movies.)

help me please. Somebody.

from what you told me here… “if they are undefined the movie goes back to frame 1” it should work… I’m sorry I though you solved it :slight_smile:
Let’s see if i got it right
instead of this.Para1 =“111”; you try
this.movExistingEmptyClip.Para1 =“111”;
I didn’t understood your problem in the first place.

still i don’t get it though why trace(this) is pointing to the same location (_level0.movQuestion) :frowning:
the second one shoul point to _level0.movQuestion.movExistingEmptyClip - at least I think so :rolleyes:

please do not PM us mods to look at a thread, not all mods are gurus in flash.

questions is reserved only for the boards.

sorry eilsoe . thought i could get a faster responce with that.

yes it points to the same. logically i think that is corect also.
in

movExistingEmptyClip.onLoad() { trace(this); }

and in game.swf

trace(this);

both point to _level0.movQuestion

so my logic was that if i set a var in

movExistingEmptyClip.onLoad() { this.para1 = 1111; }

it will be available in game.swf also .
but it doesnot.

my problem is that the main flash was written by someone else and it has only one frame and relies on events like _Result, onLoad etc
i am scared to change it too much.

If it was in my style (go back to frame 1 untill condition) maybe i could set a var in game.swf and wait for it to be set.

i have tried enterframe also.

for now i am going back to GET method but please I am still looking for an answer.

have you tried setting that para1 value like this -> this.movExistingEmptyClip.Para1 =“111”;
Sorry I couldn’t be of much help :|.

its ok

thanks anyways for trying.

I don`t think you should use onLoad for this sort of thing, set up a loop to check getBytesLoaded/getBytesTotal().