PDA

View Full Version : Variable wierdness.



neods
November 15th, 2004, 06:39 PM
Hi, I am going nuts over this. I will explain what I have. I really do hope someone could help me on this one.

in the main swf, i load an external swf to it.

loadMovie(externalfile.swf, _root.content);
------------------------------------------------

And then in the external swf, I have a varible named

frametogo = new String(none);

------------------------------------------------

In the external swf I have a button that does this.

on (release) {
frametogo = 3;
this.textFade.gotoAndPlay(2);
this.anim.gotoAndPlay(36);

}

------------------------------------------------

So it tells the textfade to go forward and in the middle of the textfade I have this action

this._parent.gotoAndStop(_root.frametogo);


------------------------------------------------

All this works nicely when its played alone. but when its loaded to the main swf, the frametogo variable is not read in the textfade movie clip? I'm using Flash 6 on this.

all so on the first frame of the external and the main swf i have a action that goes like this

this._lockroot = true;

Can anyone get any sense of this?

Thank you, and I really appriciate if anyone can check what i have written here and maybe give it an anwser of some sort.

neods
November 15th, 2004, 06:40 PM
And i tested loading the external swf with loadMovieNum and it worked nicely. But i wanted to know what was wrong with this, As i tested this in Flash 7, and it worked nicely all so.

lunatic
November 15th, 2004, 07:05 PM
If something works fine as a stand alone swf but not when loaded into another swf then it is probably a path problem. Be careful with the use of 'this', which always refers to the timeline of the object on which you used the code. So if 'this' is used inside a movieclip then it references the timeline of that movieclip. If 'this' is used on the maintimeline then it refers to the _root, which may not be the _root anymore once loaded into another clip in another swf.

don't know if that is exactly your problem but it sounds like a path issue

:hr: