# Loaded movie and Parameters

**URL:** <https://forum.kirupa.com/t/loaded-movie-and-parameters/62264>\
**Category:** flash\
**Created:** [August 26, 2004, 9:47am UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264 "2004-08-26T09:47:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitgeorge](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@amitgeorge](https://forum.kirupa.com/u/amitgeorge)\
**Post date:** [August 26, 2004, 9:47am UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/1 "2004-08-26T09:47:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 26, 2004, 10:21am UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/2 "2004-08-26T10:21:01Z")

</div>

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 😉  
or put in frame 1 something like  
(the\_name\_of\_the\_first\_mc).movExistingEmptyClip.onLoad = function() { bla bla

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 26, 2004, 10:37am UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/3 "2004-08-26T10:37:11Z")

</div>

> [@virusescu](#):
>
> 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 😉  
> 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.)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 26, 2004, 12:13pm UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/4 "2004-08-26T12:13:40Z")

</div>

help me please. Somebody.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 26, 2004, 1:04pm UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/5 "2004-08-26T13:04:13Z")

</div>

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 🙂  
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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 26, 2004, 1:09pm UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/6 "2004-08-26T13:09:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 26, 2004, 4:37pm UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/7 "2004-08-26T16:37:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2004, 4:29am UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/8 "2004-08-27T04:29:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2004, 4:38am UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/9 "2004-08-27T04:38:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2004, 9:06am UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/10 "2004-08-27T09:06:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2004, 10:01am UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/11 "2004-08-27T10:01:21Z")

</div>

its ok

thanks anyways for trying.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2004, 1:31pm UTC](https://forum.kirupa.com/t/loaded-movie-and-parameters/62264/12 "2004-08-27T13:31:27Z")

</div>

> [@amitgeorge](#):
>
> 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().
