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!

unloadmovie ..i think...goBackToMainMovieAndPlay(87)

Status
Not open for further replies.

Curisco

Programmer
Feb 6, 2002
90
SE
Howdy Folks,
By my title i guess you know what my problem is...
Here is a little explanation ...

from my main movie i have
on (release) {
loadMovie("php/form/sendit.swf", 1);
}

from "sendit.swf" i have realised that if the person wants to quit they need a "cancel" button, which in turn should close the "sendit.swf" and take them back to the point they were before the clicked "contact us".

contact page(main movie) -to-> new movie -to-> cancel_btn -back to-> mainfilm.

well that took me nearly half an hour to formulate that question and i know or rather hope it will take some flash meister two minutes to help me out.

If not thanks for your time..if so thanks in advance

Ramsey
 
well you can create a button to take you back to where you were but it will mean altering the main.swf (one you want to go back to)

or

you could just load this sendit.swf into another window with a close button


you can go either way.
 
Nice one Mr bill,
...but...unfortunatly when you say "create a button to take you back to where you were but it will mean altering"
the question still remains, how? do i return?
if not in a different form.ie
how then or why do i alter the main movie? .'cos that works fine. can i not refer to a spacific frame on returning.
*phew* i'm confused.
Whats wrong with gotoAndPlay mainmovie(frameNumber).

Sorry to make this into some kind of essay but i'm truly stumped...

Ramsey
ps the couse of most of the problems i'v had with this project is that everything must remain inside flash.hence no popups otherwise i'd do an html alternative.

once again i thank you and all who take the time to read this and the saga continues.ds
 
"gotoAndPlay mainmovie(frameNumber)."

yes thats option 1 but its not quite as simple to achieve as it sounds

first the return button

on (release){
loadmovie("main.swf?frame=87",1);
}

what this does is pass a variable (called frame with a value of 87) to main.swf.

Now for main.swf. You have to give the variable some time to load so you need to build in a short delay. And here is where it gets tricky because i dont know what you have in the early frames of this movie.

frame 1

function check(){
if(frame==undefined){break;
}else{
clearInterval(frameyet);
gotoAndStop(frame);
}

frameyet = setInterval(check,20);
stop();

What I suugest you do is put a button on the stage in frame 1 called Enter or whatever (for the first time the file is loaded) with action

on(release){
gotoandPlay(2);//start main.swf on frame 2
}

Anyone coming back from using that return button will never see this as the variable will load and jump to frame 87 too fast for the eye to see.


Wishing now you had chosen to load it into a new window.

Good Luck !



 
Thanks again Mr Bill,
Gonna give it a shot..
Another thank you goes out to you for your time.

Nice one

Ramsey -------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
Hi Mr Bill
Happy happy joy joy...
Check this out..

on (release) {
loadMovieNum("php/form/sendit.swf", 1);
}

The exit code can be

on (release) {
_level0.gotoAndStop(87);
unloadMovieNum(1);
}

For me this alternative sorted me right out. While it seems to look like a hack compared to your alternative it worked so ... I think i'm still gonna try your method though, just to compare functionality and to learn a little more on my way.

Thanks again

Ramsey
-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------




-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
no...your solution is the best....i missed the fact that you were loading into levels instead of empty movie clips.

_root.friday = function(){
bill.gotoAndStop("bar");
bill.bar.gotoAndStop("beer");
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top