flash actionscript:
[quoted text, click to view] pptdgc wrote: > I have craeted a button that loads an external movie. The action script is... > > on(release){ > loadMovie("externalmovie.swf",this); > } > > How would I change this script so that when the movie loads it doesn't load > the first frame, but a later frame such as frame 10. > > Thanks >
this.createEmptyMovieClip("MyClip",1000); MyClip.loadMovie("SomeMovie"); MyClip.gotoAndPlay(10); --
I have craeted a button that loads an external movie. The action script is... on(release){ loadMovie("externalmovie.swf",this); } How would I change this script so that when the movie loads it doesn't load the first frame, but a later frame such as frame 10. Thanks
hopefully, that's a movieclip button. if so, you can use: on(release){ _root.preloadI=setInterval(_root.preloadF,80,this,10); this.loadMovie("externalmovie.swf"); } and attached to a frame: function preloadF(mc,frameNum){ loaded=mc.getBytesLoaded(); total=mc.getBytesTotal(); if(loaded>0&&loaded>=total){ clearInterval(preloadI); mc.gotoAndPlay(frameNum); } }
I have limited experience using flash. When you say a movieclip button... I converted a symbol and slected 'button' as its type. I then selected the button and opened the action script panel?? So do I attatch the first lot of code to the instance of the button, but where do I enter the second lot of code? In ay the fist frame of the same movie? Or the external movie that is being loaded? Thanks for oyur help
you created a regular button. and the problem with that is when you execute this.loadMovie("externalmovie.swf"), all the code on that timeline will be lost so there's no place to locate code that will execute as that swf is loading. there are many remedies. the simplest (assuming you don't want that button to exist after it's released) is to convert a shape into a movieclip and use the code in my previous message. the on(release) handler will be attached to your movieclip and then preloadF() code will be attached to the frame that contains your movieclip button.
I created a movie clip and then put that exact actionscript on the instance of the movie clip. I then put the follwoing actionscript on to the same fvrame that the movie clip is on: function preloadF(mc,frameNum){ loaded=mc.getBytesLoaded(); total=mc.getBytesTotal(); if(loaded>0&&loaded>=total){ clearInterval(preloadI); mc.gotoAndPlay(frameNum); } } When I test the movie, It loads the external movie but on the first frame not the tenth. Also it seems to load the external movie ontop of this one but wrongly positioned so that all you can see is the top part of the external movie at the bottom of the first overlaid so both are visible. I want the external clip to replace the first one completely. Is there anything in your code that I need to change? Thanks for your help
something's not as you explain. if you have old code lying around your movie, remove it. if that doesn't solve the problems and if the following code is attached to your movieclip: on(release){ _root.preloadI=setInterval(_root.preloadF,80,this,10); this.loadMovie("externalmovie.swf"); } upload your file somewhere and post a link.
Hi kglad, I am still having the same problem. I created the movie clip button again and attatched the code to it but have the same problems. The page the movie clip button is on is the final page of a quiz I created using the quiz wizard in flash. (final score page). I am trying to create a button that will link back to my original flash movie at frame 10. I don't have any webspace. Could I e-mail you my file. My e-mail is peter.m.ross@student.shu.ac.uk. If you e-mail me I will reply with the attached file. Thanks for your help Pete
the problems were not in the actionscript except he wanted a gotoAndStop(10) instead of a gotoAndPlay(10). the other problems were all design problems: he needed to increase the stage size and he needed to loaded into another _level and fade out the _level0 movie to make his presentation look right.
Hey.... Can you please post what the solution was...... I am having the exact same problem, and the exact same results with your code..... Help will be appreciated.... thanks..
Hi there...I am having the same issue with positioning the external .swf as pptdgc was having: <Also it seems to load the external movie ontop of this one but wrongly positioned so that all > <you can see is the top part of the external movie at the bottom of the first overlaid so both are > <visible. I want the external clip to replace the first one completely.> This is exactly what I am experiencing. I am using the provided script by Kglad for my movieclip button and the corresponding frame to load an external ..swf. I find no real solution in this thread and was hoping someone or Kglad could provide a more indepth resolution. Kglad did mention loading into another _level but would need more clarification on this. Thanks a bunch!
Don't see what you're looking for? Try a search.
|