Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load .swf then go to frame label 2

Status
Not open for further replies.

krosshair

Programmer
Feb 28, 2003
34
GB
I have this now...

on (release) {
loadMovie("large_back.swf", _root.dropZone);
}


How do I get it to go to a frame label within large_back.swf
-- Simple perhaps but I am slightly stumped.

Thanks so much.
 
on (release) {
loadMovie("large_back.swf?vars=label", _root.dropZone);
}

then in frame 2 of large_back

if (vars==label){gotoandstop(label)
}else{gotoandplay(1)}

you have to pass a variable to the second movie. this can be the frame label. wait until the variable has loaded ( a preloader would be better than the simple code i gave above) then you can goto the frame.
 
Thanks Bill - unfortunately I am getting the can't find URL error.

Error opening URL -- large_back.swf?vars=myfile002

I am sure I put the code in correctly - any idea why I would be getting this?#

Thanks again.
 
have you tried in a browser? ie on the web. i suspect this a local problem and will work on the web
 
I am sure that's it - I thought the actionscript was passing the variable.

Thanks Bill.
 
Hi - actually if your still there Bill - I have tried it live and changed the code to an absolute path...

on (release) {
loadMovie(" vars=myLabel", _root.dropZone);
}

and then the code in the large_back.swf...

if (vars == myLabel) {
gotoAndStop(myLabel);
} else {
gotoAndPlay(1);
}

-- and this is still not working - just going to the first label in the time line (not the called one) and staying there.

Any idea why this is??
 
and there is a ? between -- large_back.swf?vars -- just disappeared in the post.

Cheers


 
the var you pass, if its mylabel, then the frame must be labeled mylabel

if it aint working then run a trace on vars, make sure thats there, rest could be down to fact that the frame you are targeting has not loaded yet which is why i said you may have to use a preloader. cant go to a frame that is not there.
 
best of all post the fla if it still aint working and ill take a look. thats usually the easiest way to fix a problem.
 
OK - I have put the files here...


I have put together a small sample of what I am trying to do. When a user clicks one of the small pictures the large_back.swf is meant to load in the dropZone instance on stage above the small pics. The version on my complete site at least loads the first default frame this sample one is not.

If you have a sec tell me what you think - Thanks again.
T
 
I have downloaded the files and I will now try and figure out what I was doing wrong - thank you!
 
apart from the change i made to large_back to make it a bit neater to go to any page with a frame label the other errors were mostly in spelling.
var instead of vars i came across and wordsearcg instead of wordsearch was the other one. silly little things that we all do from time to time.
 
Thanks Bill! works great. I am going to post the complete code in case someone else has this issue.

On the sending SWF...

on (release) {
loadMovie("your.swf?vars=yourLabel", _root.dropZone);
}

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

On the receiveing SWF...

if (vars == undefined) {
gotoAndPlay(1);
}else{gotoAndStop(vars);}

stop();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top