Load movie to given framelabel

You want to load a movie and send it directly to a given framelabel. So append the framelabel to the url of the movie like this: myMovie.swf?framelabel=scene3 Then inside myMovie.swf you have to isolate the framelabel from property _url, wait until the given frame is loaded and then you can jump to the label. Here is the script: frame 1: //This function analyzes the querystring of _url //and sets the global array parms with the values //of the query string. function getParms(urlstring){ //divide urlstring in url and searchpart var tmpArray = urlstring.split("?"); //search is global variable for possible later use search = tmpArray[1]; //divide searchpart in var=value strings //in our example there is just one of this //pairs, but some could provide other variables //this way too. tmpArray = search.split("&"); //convert tmpArray in associative array parms = new Array(); for(var i=0;i<tmpArray.length;i++){ //split the var=value string into varname and value var t = tmpArray[i].split("="); //store the pairs in global Array parms parms[t[0]] = t[1]; } } //get Parameters of our _url getParms(_url); //get the value of variable framelabel (our label to jump to) label = parms["framelabel"]; if(label eq ""){ // no label given, jump to start of movie gotoAndPlay(4); } frame 2: ifFrameLoaded(label){ gotoAndPlay(label); } frame 3: //go back and check again gotoAndPlay(2); frame 4: //your movie starts here
bokel Date: 06/03/2001

It has come to my attention, that you don\'t need to write the function getParms to analyse the _url, since flash does it all on its own. Every variable which is appended to the url of the flashmovie is a global variable in the flashmovie. So if your movie has the url mymovie.swf?label=willi then the only scripting you need in frame 1 is: if(label eq ""){ //no label set, jump to the beginning of the movie gotoAndPlay(4); } The other framescripts are unchanged.
bokel Date: 07/03/2001

haven\'t tested it, but it somebody reported to news://macromedia.flash that ns isn\'t able to do it without the function (is it any wonder ?) So i think it s better to use the function.
Sam Nseir Date: 16/04/2001

When I first saw this I got really excited because I thought you meant you can do it with a loadMovie action like: on(release){ loadMovieNum(\"my.swf?var=value\", 1); } But of course this doesn\'t work, (oh how I wish it did!!). So your example is referring to attaching \'?var=value\' in the Object and Embed tags right? If so then you don\'t need the function. The variable(s) automatically get placed in the main timeline of the SWF. If I have made any mistakes in here then feel free to mail me.
Sam Nseir Date: 16/04/2001

Ok I feel like a really wolly now!! You can do it with a loadMovie action. It\'s just that it doesn\'t work in Test Movie, only in a browser. Bokel, if you read this then please feel free to delete this and my last comment. Cheers!
Valado Date: 09/05/2001

i cant get this to work... why? i\'ve done exactly as told here.. hope somebody could help me..
Jeff Date: 11/01/2002
No JS or action scripting needed to perform this task. I wrote this for another person: _____________ After seeing how complicated people try to make this task(searching on Deja.com and Macromedia.com), I came up with a VERY simple way of doing this. Say you have ONE movie, and it has 4 scenes. You have 4 pages in your site that you want to play different scenes of this ONE movie. Simple: 1)Create a 5(NOT 4) scene movie(scene names not important for this example) 2)In Frame 1 scene 1 of movie, add action of "goto and play" set the "Frame" as "expression" and give it a value of "go_to_frame" (in the expression box). Also add a "stop" action to frame 1(for this example, after the goto action). This is also the scene you would use preloaders(important if the movie is large in filesize) 3)On scenes 2-5, on frame 1, add text ... like for Scene 2 Frame 1 put "This is the first section", Scene 3 Frame 2 put "This is second section", etc. Repeat this for each of scenes 2-5. Add a "stop" action for these frames as well. Normally this would play the entire scene with the stop frame at the end of the desired sequence, but this is for an example. 4)After you have a 5 scene movie with the first frame of each scene (2-5) containing different text, label these frames(frame label) "scene2_framelabel1" , "scene3_framelabel1", "scene4_framelabel1", "scene5_framelabel1". 5)Final step. Edit the HTML code that loads the Flash movie. The movie in the PARAM and EMBED statements should look like this: "test.swf?go_to_frame=scene2_framelabel1" - this is for the second scene "test.swf?go_to_frame=scene3_framelabel1" - this is for the third scene "test.swf?go_to_frame=scene4_framelabel1" - this is for the fourth scene "test.swf?go_to_frame=scene5_framelabel1" - this is for the fifth scene Basically, the movie is looking for the variable(expression) "go_to_frame" when it loads. It finds this in the HTML coding that loads the movie, and by looking above, the variable go_to_frame has a value, one of the frame labels. So the movie will go to that frame label, or particular section of the movie. Here's an example of how it looks, each link has the SAME swf file loading, but due to the changed code in the HTML file and use of the variables/frame labels, it goes to a different area of the movie(view source of pages): http://www.designingfool.com/test/test1.html http://www.designingfool.com/test/test2.html http://www.designingfool.com/test/test3.html http://www.designingfool.com/test/test4.html I zipped all the files (including the FLA), which can be downloaded here: http://www.designingfool.com/test/example.zip Hope this helps! Jeff _____________
ashish Date: 31/08/2002
i am haveing problem with the loading the movie and i want to directly go a particular label after clicking the button in the other movie file.how do i get that.
Kaotik78 Date: 25/10/2002
Hello, I have tried the above methods for allowing html to choose the entry point in a swf, with no avail. I am using Flash MX and have tried all of the above as suggested on this site but I am unable to get my swf to play the scene I coded in the HTML. If I right click on the blank loaded flash window, and hit play, it moves to the next scene, and if I hit play again, it goes to the next scene etc etc. Any ideas?? Thanks, Kaotik
Cindy Date: 23/01/2003
Hi Bokel, I've tried using this script, but am having some difficulties, and am hoping you can help me out (as I'm no Actionscript expert). The project is a product catalogue, and I want to be able to go to any number of frame labels in the loaded movie, depending on what the user selects (not just one specific label per movie). I've tried keeping the second frame script as: ifFrameLoaded(label){ gotoAndPlay(label); } assuming that it would then go to whichever label was specified from the navigation, but it just loads at the beginning of the movie. Is there any way to have it load at whichever framelabel is specified? I hope this makes sense, and that you can help me out! Thanks in advance, Cindy
Kanji Date: 08/07/2003
I see you are doing the "goto-x-label-inside-swf" stuff just with html coding. Is there a way to do this but inside only the swf using loadmovie?
vik Date: 03/03/2004
Hi!!! i want to download the zip file, but i need to know the password and username. somebody please...
Aram Date: 11/03/2004
Hi, I solved this issue with a simple preloader that recieves a variable from a button in a previous movie. Once all frames are loaded in the second movie, the variable is checked with IF/THEN and routs the playhead to the specific scene in the new movie. Here's the code: Let's call this movie "Navigation Movie" actions layer: stop(); nav_number = ""; Button Command in same movie: on (release) { nav_number = "3";// Just an example to set the variable loadMovieNum("Module1.swf", 0, "GET");// loads new movie and sends new variable. For some reason, appending the variable to the moviename (ie. moviename.swf?variable) didnt work// } Let's call this other movie "Target Movie" "Preloader" (First Scene) actions frame 1 stop(); myInterval = setInterval(myFunction, 10); function myFunction() { if (_framesloaded>=_totalframes) { play(); clearInterval(myInterval); } loading.x_scale=(_framesloaded/_totalframes)*100; } //This function holds until all frames are loaded Preloader (Scene) Frame 2 if (nav_number eq "0") { gotoAndStop("intro_1", 1); } else if (nav_number eq "1") { gotoAndStop("intro_1", 1); } else if (nav_number eq "2") { gotoAndStop("1A1", 1); } else if (nav_number eq "3") { gotoAndStop("1B1", 1); } else if (nav_number eq "4") { gotoAndStop("1C1", 1); } else if (nav_number eq "5") { gotoAndStop("1D1", 1); } else if (nav_number eq "6") { gotoAndStop("1E1", 1); } else if (nav_number eq "7") { gotoAndStop("1F1", 1); } //Checks variable and routs accordingly
your mental superior Date: 09/04/2004
you all are on crack. ===== on (press) { loadMovieNum("filename.swf",1); } on (release) { with (_level1) { gotoAndPlay ("labelname"); } } ===== this so did the trick in like 2 seconds. thanks for nothing!
stefan Date: 27/03/2007
How did you know I was on crack... thats just weird.
Parag Date: 06/09/2007
Hello guys, I want to load a movie and send it directly to a given framelabel. For Example i m developing the website. Navigation is like Intro + company profile & portfolio so i've a file intro.swf & 2nd is portfolio.swf in intro.swf company profile starts from 50th frame. Now i want to jump frame 50th of intro.swf from portfolio.swf i tried the given script but it's damn complicated. please let me know is there any easy way to do it.. Parag V.
Add comment
Home