all groups > flash actionscript > may 2004 >
You're in the

flash actionscript

group:

External swf - problem with _root.gotoAndStop


External swf - problem with _root.gotoAndStop areacode514
5/1/2004 8:03:51 PM
flash actionscript:
Greetings,

I seem to be having a problem with making a button in an external swf perform
an action on the main timeline.

- There are two files: ?MainTimeline.swf? and ?External.swf?.

- In MainTimeline.swf, I have labeled the first frame ?labelBegin?, and the
second frame ?labelEnd?.

- I have added actionscript to a button placed in MainTimeline.swf, which will
open External.swf at level 50.

- Within External.swf, I have added actionscript to a different button, which
should make the MainTimeline go to ?labelEnd?, and which should also unload the
movie External.swf.

This does not seem to work, and I am not too sure why. I am hereby attaching
the files. Any help would be extremely welcome and appreciated.

Regards,

areacode514
__________________
P.S. The code I used is:

on (release) {
_root.gotoAndStop("labelEnd");
_root.unloadMovieNum(50);
}
Re: External swf - problem with _root.gotoAndStop Shan-Dysigns
5/1/2004 8:31:27 PM
Firstly I would suggest you NOT put the unload movie clip action in the actual
movie clip that you are wanting to unload. Try and re-work a button onto the
MAIN swf and have it unload the external movie clip.
Re: External swf - problem with _root.gotoAndStop areacode514
5/1/2004 9:10:04 PM
Thanks for your advice on unloading the movie inside the main timeline as
opposed to within the external swf.

Any idea why _root.gotoAndStop() does not seem to give the desired effect?

Regards,
areacode514
Re: External swf - problem with _root.gotoAndStop Shan-Dysigns
5/1/2004 11:23:44 PM
Probably because with _root.gotoAndStop() you aren't giving it the proper
parameters. WIth gotoAndStop, you have to either specify a frame number or
frame label such as _root.gotoAndStop(frame number) or _root.gotoAndStop("frame
name"). If you simply want the main timeline to stop, then use _root.stop();
Re: External swf - problem with _root.gotoAndStop areacode514
5/2/2004 7:50:07 AM
Hello,

Thank you for your advice, but I don't believe this is the problem in my case.
As you may see in the MainTimeline file, the frame has been properly labelled
as "labelEnd", and within the External.swf file, the code rightly points to
that label name.

Any other suggestions? Although I have checked and double checked, could it
be some sort of silly typo I have made and it's simply slipping me by?

Thanks in advance.

Regards,
areacode514
Re: External swf - problem with _root.gotoAndStop stwingy
5/2/2004 8:42:48 AM
try this
on (release) {
_level0.gotoAndStop("labelEnd");
unloadMovieNum(50);
trace("button has been clicked");
Re: External swf - problem with _root.gotoAndStop areacode514
5/2/2004 2:07:31 PM
Hi stwingy!

Thank you soooo much! That solves my problem!

Best regards,
areacode514

P.S. Any idea why _root.gotoAndStop() does not work in this situation? (I
was under the impression that "_root." was supposed to mean "go to the main
timeline, regardless of where you are".)
AddThis Social Bookmark Button