ActionScript 2.0 :: Unload All Movies When Going To New Frame?
Aug 31, 2010
I have a scene with buttons that call upon outside movies to be loaded. But when I click a button to go to a new frame, the outside movies on still being seen on top. Right now my button Action is:
on (release) {
gotoAndPlay(16);
}
What should it say to unload all movies then go the 16?
I am having trouble with unload an loading movies. Basically I am loading a movie into a container, which works a charm:
[Code]....
I want to unload them both when a close button is pressed on the third loaded swf? Also, ideally I would like to add that second movie clip into a container, so I can position it correctly, but when I try copying the code I use on the first, it doesn't seem to work...is it to do with the "root" bit perhaps?
The menu uses XML to load in the menu, so all the options are dynamical. If you click a button it loads a menu into the stage, but if i click an other it overlapse the old one... So i figured i need to unload all the other movies on the stage, how do I do this?
Is there a way to automatically unload movies when a new movie is loaded? eg: 5 buttons, 5 bit of art. At the moment they overlap instead of unloading before the new one loads.
Is there a way to set up an unload FLV actionscript (AS3) on the click of a home button? So, when defining the functions of the home_btn, have it unload FLV (sound and video).
Or would it be better to put into the actionscript frame? So, when the home_btn brings the timeline to "home", the actions on that keyframe have an unload FLV.
On a particular frame I have the action PHP Code: loadMovie("swfs/home_text.swf", 1); I want to add an action on a navigation button to unload that movie from main movie. I tried unloadMovie();, but no luck.
I've had to create the following code to get a series if loading movies to work properly. Each loaded movie is basically a series of automatically looping images controlled by external xml. I found that without adding the unload movie on each button action the first movie loaded kept playing over any subsequent movies loaded. However its rather long winded and if the amount of movies increase it really is going to be very large. How to create an efficient funtion that does the job in a more effective way:
URL...How and where and what do I add to make the movies unload before only the movie corresponding to the button clicked loads up and doesn't overlay?I'm having trouble with the level and all that URL...
I am building an on-line game for autistic children, and I am facing a problem where I load a SWF to play a mini game. Although when the mini game is over I want to go back to the original SWF (and a different scene to which I left.)
I use:
var request:URLRequest = new URLRequest("hidenseek.swf"); var loader:Loader = new Loader() loader.load(request); addChild(loader); stop();
To load the swf, although I can't figure out how to unload it on a frame, and then on top of that take it back to original SWF to a new menu?
A work around could be to just have the new menu in the loaded SWF? Could I unload the original SWF or do I have to always keep it open?
I have the following code on a frame label called "allemande" (frame 890). The first part loads a swf when I click a button called "allemande" that sends me to this frame. This part works correctly.
The second part is code that sends the timeline to the "home" frame label when I click the "home" button. This works OK too.
I would like to insert code that will unload the "allemande_slideshow" swf when I click the "home" button to go back to the "home" frame label.[code]..
i wanna be able to load both variables from an external .txt file, and a external .swf file at the same time. now the problem is i need the .swf to only open if the movie is at frame 15. here is my current code:
on (press) { loadVariablesNum ("test.txt", 0); }[code].....
on the main time line i'm loading external swf at specific frame using moviecliploader class how do i unload the same swf when exiting that frame?this code is on the main timeline at the frame i want it to load at but i don't know how to unload it when i exit that frame:
this.createEmptyMovieClip("holder2_mc", this.getNextHighestDepth()); var mclListener:Object = new Object(); var image_mcl:MovieClipLoader = new MovieClipLoader(); image_mcl.addListener(mclListener); image_mcl.loadClip("RVBanner2_FLASH8.swf", holder2_mc);
and when i click another button to go frame 1 from the same page at 10,, placed beside the loading external swf ,, it goes,, but the loaded external swf file is not going ,, or the external file not cleaning,, not removing. here is the CS3 flash sources,, and outputs [URL]
I have tried several suggestions on this forum to resolve my issue, but it is obvious to me I am missing something because I am a NOVICE Flash developer. I have everything working in my Flash file EXCEPT I want to use this code to play a .swf file. When the swf file is done playing OR the user clicks the return to Main Menu button¯, they return to frame 1.[code]The .swf file plays and when I click Return to the Main Menu button, only certain items display from frame 1. The .swf file is still loaded hiding the items that should display on frame 1. I have attached a screen shot of what happens when I click the "Return to Main Menu" button.
Using AS3. I have in my code a button to stop and remove the swf, but I would like to have in addition to unload a child swf when it plays it's last frame automatically - not using a button.
Here is my code on the main timeline: var loader:Loader; var closer:close; norton_btn.addEventListener(MouseEvent.CLICK, NortonDemo); function NortonDemo(e:MouseEvent):void { [Code] .....
Now, what do I need to add or change to this code and add to the code on the last frame of NortonDemo to accomplish what I want to do?
I'm trying to create a movie clip which contains the background image and has thumbnails which change the image once you click on it.
Whats the best way to code this?
I'm having trouble with the depth.
addChildAt(imageName, o)
that works for the first image but how do i unload the image before going to next frame to load the new image when the corresponding thumbnail is selected?
I got my swfs to load on my web page. I have masked them once loaded. When I play one (click button) then jump to a different page (different frame) everything works fine. But, when I play one and then click another to play and then go to a different page, the mask seems to stay on screen (I am getting a white box in the mask area).
I want to eventually load all my swfs and mask them with their corresponding buttons and then jump to other pages (frames) on my website. I just can't seem to get rid of these boxes (masks).
Here is my code......
var Xpos: Number = 260; var Ypos: Number = 80; var swf: MovieClip; var loader: Loader = new Loader ();
I am making a movie with frame lables and parent movies.So there is the maintimeline and a movie on each sucessvive frame, relating all relevant aniamtions/transitions from button to button.
Using this script
on (release) { _parent.gotoAndPlay("P_CommCent"); }
I have been able to do exaxtly what I want, jump from "P" to "CommCent" essentially, where each is a movie on the main timeline, the "P_CommCent" signifies the specic transtion. So my problem is... that this worked for all movies, now I want to jump from "Green" to "CommCent", using "Green_CommCent" however now it is not working.
What I would like to do is, once all the fish have been clicked on, and the points all added up, and the stage is empty, is for the movie to go the next frame, where it will display the winner etc. So, how would I tell my movie to go to nextFrame(); once all the movieclip instances have been unloaded.
Is it possible to load in a movie to a specific frame? I am currently loading a movie from a button with: on (release) { unloadMovieNum(1); loadMovienum("Is.swf",0); }
This works perfect, but I'd like to add usability by directing the button to a specific frame within that new movie. I've tried: _level0.gotoAndPlay(10); After loadMovienum in the previous code but it doesn't do anything different. The movie always starts up on frame 1. In the end I'd like to have multiple buttons serving as navigation buttons specifying different frames of the new movie.
Is it possible to load in a movie to a specific frame? I am currently loading a movie from a button with: on (release) { unloadMovieNum(1); loadMovienum("Is.swf",0); }
This works perfect, but I'd like to add usablility by directing the button to a specific frame within that new movie. I've tried: _level0.gotoAndPlay(10); After loadMovienum in the previous code but it doesn't do anything different. The movie always starts up on frame 1. In the end I'd like to have multiple buttons serving as navigation buttons specifying different frames of the new movie.
I have a Flash animation that loads a quick animation and then on a button click loads and external swf while at the same time moves the playhead on the timeline to frame 2 so that it has a blank stage to play on. The external swf then loads and plays. At the end of the external swf's animation I would like it to unload and then return to frame one of the containing movie. I am assuming that on the last frame of the external swf I should be putting some actionscript that will unload the movie and then talk to the initial containing flash telling it to return to frame 1.
The main swf button that loads the external swf is using a code snippet from the AS3 CS5 library and looks like this...
[Code]....
It is also using gotoAndStop(2); for the same button.
So to unload the external swf and return would I use something like... this.unload(gotoAndStop(1));
I have a flash page where I am loading another .swf into. With a button in the loaded swf I need to unload the loaded swf (where the button is) and navigate to a specific frame label in the parent .swf. I've tried to do the following in the key frame where the swf get loaded into I've put the following:
var gallery_load_wonderland:Loader = new Loader(); gallery_load_wonderland.contentLoaderInfo.addEventListener(ProgressEve nt.PROGRESS, loop_wonderland); gallery_load_wonderland.contentLoaderInfo.addEventListener(Event.COMPL ETE, done_wonderland); gallery_load_wonderland.load(new URLRequest("gallery_wonderland.swf")); function loop_wonderland(e:ProgressEvent):void { [Code] .....
I basically want to first load the swf called "gallery_wonderland.swf". Then in the "gallery_wonderland.swf" there's a button called "contact03_btn"¯ which I want to unload "gallery_wonderland.swf" even though it's inside the swf and navigate to the frame label called "Contact" in the parent swf.
What can I do I've done similar before and it works, but when I do it know and I click the contact03_btn it comes with following error message: TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@26215ba1 to flash.display.MovieClip. at gallery_wonderland_fla::MainTimeline/back_wonderland()[gallery_wonder land_fla.MainTimeline::frame1:227]
I am making a flash site where one of my pages loads an external swf. In this external swf I have sub pages with links. My problem is when I visit a page from this external swf, and then go to a page from my main website (clicking my main time line buttons) and then go back to the page with the external swf i was previously on, the page would go to the last page i was on, instead of refreshing it back to the main frame of the external swf.
I made a small, simple example of what I am experiencing on the site I'm working on.
I have a main flash file that I load various external swf files into. On the first frame of the timeline, there is an intro swf loaded that basically welcoming the viewer to the site. What I want to do is have this load, play and unload and then go to frame two of the timeline where the main home section of the flash site is located.One my first frame on the timeline I have:loadMovieNum("/IntroMovie.swf",1);stop();n the external IntroMovie, I have unloadMovie (1); so the movie will play and then unload itself. What I can't figure out is how to get the timeline to go to the next frame once this movie is finished playing and has unloadedIf I don't put the stop in there, it simply skips this movie and goes to the next frame on the timeline and loads the home movie swf file.Is there a way to use some sort of if statement, that if the movie is unloaded, goto the next frame, sort of like this:if(code to verify if movie is unloaded);gotoAndStop(2);