Vars lost in LoadMovie ?!?!

Hi,
i am loading an external SWF into an empty movieclip but all properties (vars) from that mc seem to be lost.

In other words I have variables contained in movie clips that should be loaded with the external SWF … but it doesn’t work !!

Is it normal that parameters contained in an external movie are lost when loaded ?? I’ve never come across this before … :crazy:

… if anyone can help …

bye

piddu

they´re just with a wrong path.

=)

WELCOME TO KIRUPA FORUM!

I´m sure you´ll gonna like in here. Stick around, give us a shot, and you´ll not regret it.

[SIZE=1]Please don’t spam on help forums[/SIZE]

well , maybe … but I’ve checked the path many times…

the external mc is loaded into an empty movie clip called tilemenu which is positioned in the _root

the external MC has 5 different movieclips, each with an id property set.

when i load it into my movie I can target those 5 movie clips but if I try to read the “id” property i get an “undefined” result, which is not what I was expecting.

Any advices ??

piddu

What do you mean by **“id” property ** ? is that a variable, or the instance name?

try targeting by it´s level, ex:

[SIZE=1]increase the variable speed inside the mc ball on level2 :[/SIZE]

_level2.ball.speed++;

=)

sorry if I didn’t explain myself very well … :slight_smile:

The problem was this :

  • I am loading an external mc that holds a number of sub-moviclips

  • Each of these mc has some custom properties already set

  • When I load this external mc into my movie I catch the “onData” event so that I know when it is fully loaded.

As soon as this event is raised I call a function that reads those properties we were talking about from the loaded external mc.

For some reason this properties are not ready to be read in that moment (the onMovieClipeEvent(onData)) … but if you just let 1 or 2 frames pass then those variables do appear !!

The solution :

I’ve placed a var called “Inited” in the external MC. As soon as the onData event is raised I wait for “Inited” to be set, then I can call my custon function that does what I need. (it is a level-editor for an arcade game I am doing)

This thing really made me go nuts because I’ve never come across such a particularity in actionscript … hope this will help somebody else as well.

Bye and Merry Christmas !!

PiddU

Cheers:crazy: