ActionScript 3.0 :: Loaded Swf Be Unloaded When It Stops On Last Frame?
Sep 8, 2008
I'm having a problem, apparently not very hard to solve, but... I'm creating a file with some animations and a few stops on the timeline; on each stop I want to load a swf... The idea is to make the main timeline "wait" for the swf to stop when it arrives to the las frame and then, make it to unload and continue playing until the next stop...This is an application to work local (not on the web).So, I want the swf to unload without any click; just by itself.
I have a large project built in as3. Part of its main functionality is to load and unload various as2 swfs. The problem is that the memory ins't free up once they are unloaded.
I have access to the as2 swfs code base and destroyed all objects, stopped and killed timers, listeners, removed from stage, destroyed all the MovieClip.protoypes that were created. They look to be clean as far as the AS2 debugger show no remnants of the object after the destroy function is run. In AS3 i've closed the local connection, cleaned all references/listeners to the AVM1Movie and ran Loader.unloadAndStop(). The trace out in flex says the swf was unloaded but looking at windows task manager the memory usage never drops to when it was before the as2 swf was loaded. Each as2 swf can take up to 80 megs each time it's run so memory gets eaten up fast and loading and unloading a few as2 files.
At this point if the AS2 swfs are unloaded the only thing that I can assume that could be left is MovieClip.prototype and/or _global, _root variables add during the AS2's run time. But i've gone through those and can't find anything else that might be sticking. Has anyone ever seen problems before with the AVM1 machine not freeing up its memory?
Flash builder traces out when swfs are loaded and unloaded eg: [SWF] C:xampphtdocscar_explorerfontsArial.swf - 174,937 bytes after decompression and [Unload SWF] C:xampphtdocscar_explorerassetsspinEXTERIORBASE_12.swf How to disable these types of traces?
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.
I have a flash file that has three main buttons on top. When a button is clicked the timeline moves to a that frame (designated with a label) that loads in a particular external SWF corresponding with the button. Those movies are loaded into the same empty movieclip called "presentation"using:loadMovie("splash.swf","presentation"); In one of the external loaded SWF's there is a tween animation (on first frame using TweenLite), that takes place upon loading the SWF. The issue is that when I click a button and go to another frame (which loads another SWF) mid-way through that animation, and come back to that same page with the animation. The animations starts mid-way as if it was running in the back, such as fading in things that shouldn't be faded in yet, etc..? Any clue as to why? EDIT: Maybe this is the cause? The animation code in the first frame of the loaded SWF:
//Animate the bouquet var bFadeIn:Tween = new Tween(bouquet,"_alpha",Back.easeInOut,0,100,1,true); //106.95 bFadeIn.onMotionFinished = function() {
My flash web page works good but when it starts for a first time (you go to link for the first time and web is not in your cache) animation stops after it is loaded. I have same problem after Ctrl+Enter export from Flash, sometimes I have to re-export few times.
i have a home button and a services button when i click the home button OR the services button first they work fine and play the transitions there linked with. when i click back on either one of those two buttons a second time they require a double click on the button for flash to comprehend and play the transition which is labelled "clicked" it works on the second click BUT on the first click "on returning to the home button the second time" it stops at the first frame of the transition instead of playing it.
I'm working on a flash content slider thing (i.e. it shows a message and then transitions to the next, and there are buttons at the bottom to navigate to each message). Now I want it to actually stop playing when you navigate to a specific message, instead of continuing to play from there. The problem is there's a fade transition, so I essentially need it to go to the first frame in the transition and play (what it does now), but then STOP once the transition is complete. I don't know how to do this without adding a global stop() to that specific frame, and I don't want to do that because I want it to, by default, rotate from one message to the other.
I'm developing a simple application at the same time as I am studying some things in actionscript and I've got the following code:
ActionScript Code: if (Key.isDown(Key.LEFT)) { x -= speed; this.gotoAndStop(2); _xscale = -scale; } if (Key.isDown(Key.RIGHT)) { [Code] .....
I've got an object, and every time I press one of those keys those actions happen. My problem is that, when I press SHIFT, the object appears in that way (frame 3), but It doesn't play that animation it just stops in the first frame. How can I say "if you press SHIFT at the same time as RIGHT or LEFT, gotoAndStop(3); and the object that is in frame 3 only plays if either RIGHT or LEFT is down too"?
I would like to be able to spin a wheel in flash, this wheel has 8 sections to it split up equally, it spins for a random amount of time, 3 - 7 seconds and then stops. the section which lands on the marker is the result and will take you to a specific frame. Also i would like it when it stops to gradually slow down however this is not vital.this code works for just rotating a wheel but i want to know how to randomly stop it and how to take it to another frame.
A friend of mine wants to have some navigation-based mc links in frame 1, then nav to a certain frame, and then have a "back" button. When the nav mc links are clicked, the timeline skips to a given frame label. Pretty simple.
Most of the links have the same nav mc in them, so when I nav to them, I can also access any of the other frames via something like:
linkg.Contact_btn.addEventListener(MouseEvent.CLICK,Contact_btn_clicked); function Contact_btn_clicked(e:MouseEvent):void{ gotoAndStop("ContactPage"); }
The code above is in the first frame, and it is on it's own layer which spans the entirety of the frames in the project, so I would think that these function definitions would persist. But, when I go to a specific link, which does not have the nav mc in it, and then hit that particular frame's "back" button, all of my function definitions are gone, even though the nav mc links are now present, and as I mentioned the listeners should be active.
when I use the following function in my doc class to launch a local video, the video "freezes" after a few seconds. This happens no matter what video I am trying to play.
Code: private function startVideo(e:MouseEvent):void {
I have an MC "homeBtn" that I'm using as an animated button. The "homeBtn" is made of 2 mirroring MC's named "topMC" and "bottomMC" since they mirror and function the same I will be addressing only the "topMC" Inside "topMC" is the animation named "liquidMC" These are all MC properties. Below is the AS3 Code. Works well but when the mouse scrolls out the animation is stuck ie stops animating and not going back to frame 1
I have a flash site that has four pages which all stretch to fit window size.As soon as I go to a gallery page that is called in via SWF, and come back, I loose my dynamic stretching of all my pages...I would like the SWF page to stretch to fit also, and its isn't.
that is my very strange problem.I have the following setup:A loader swf (responsible for the loading bar) loads a controller swf. The progress bar gets filled up to 50% (100% of that swf are 50% of the whole process).When the controller swf is loaded, it is added to the stage.Then, the controller swf starts loading other swfs (for buttons, and other program related stuff).The progress of this loading is given the loader swf and make up the other 50%.When the progress reaches 100%, the loader swf hides and the controller swf is displayed.
I'm trying to load a successive series of swf, each containing audio, into a loader. As each ends, it's unloaded and the next one loads. I'm using the following code:
Code: var ldr:Loader = new Loader(); var c:int = 0;
I'm trying to load a successive series of swf, each containing audio,into a loader.As each ends,it's unloaded and the next one loads.I'm using the following code:
[CODE]var ldr:Loader = new Loader();var c:int = 0;var clips:Array = new Array("dmt1.swf","dmt2.swf","dmt3.swf","dmt4.swf")addChild(ldr);ldr.load(new URLRequest(clips[0])); addEventListener(Event.ENTER_FRAME, loading);[/CODE]...........
Each swf loads just fine, but the audio from the previously loaded swf start playing again, so there's a layered audio mishmash.
I've been successful to load a external swf using the loader. Lesson_mc is a movieclip I have on stage that I am loading the external swf. I have some masking that is there, that is why the movieclip. myLoader is a Load object. I can find the swf loaded using the debugger and see the currentLabel and Frame but when I try to get the information it sends a DisplayObject error. I have a Menu in the Main Window that controld the navigation. Getting to the frame on the first click works but trying to go to a frame within the same sef does not. Any thoughts?
myRequest = new URLRequest("overview09.swf"); myLoader = new Loader(); myLoader.load(myRequest);
On a streaming video, how do i allow for clicking to an unloaded part of the flv player timeline, and have the player start downloading from that point on?
I have a flash application, some kind of a play-list that loads external SWF video player (I don't have code access to that external file), so users can watch the video or skip to another one. When user switches to another video new SWF file is being loaded.
The problem: If user didn't finish watching the video and skips to the next then I unload previous SWF file (unloadAndStop()) and load a new one. And because the previous SWF was playing it is not actually unloaded, it is still playing on the background (I hear two audio tracks: current and previous).
I am loading swf's that have an flv embedded on the timeline. When the user selects from the menu I unload the swf and load another. This is working fine, but the audio from the first swf's video keeps playing. How can I kill this first videos audio track?
Main swf loads an external swf which has a linear voice-over. User can watch/listen the whole 5 minute piece and then main movie carries on OR User can click to go on without viewing/listening to the whole show. Using removeChild, I can kill the visuals, but the voice track still goes on. i added a SoundMixer.stopAll line, and it does kill the current VO clip, but the next one will play in a few seconds. In the external swf, i'm using timers to delay slide advancement while the voice over plays. Seems like I came across some info that says I cannot fully unload like this with timers in my external swf.
Does this sound like a plausible source of the problem? If so, what is the best way to kill/nullify the timers in the external swf?
I'm creating an eLearning interface to load other multimedia rich SWF contents. As from the title, I do unloadAndStop() the multimedia rich SWF and the SWF disappeared from the stage. However, video content from the unloaded SWF were still playing.
According to Adobe: Code: As a result, the following occurs for the child SWF file and the child SWF file's display list: Sounds are stopped. Stage event listeners are removed. Event listeners for enterFrame, frameConstructed, exitFrame, activate and deactivate are removed. Timers are stopped. Camera and Microphone instances are detached MovieClips are stopped.
The 2nd problem I face will be, after unLoadAndStop() my parent font type also change to "Times New Romans" although I have embedded the the font type to the flash. I have to reload the parent to get back the design font type.
We are using a Origin/Edge configuration for massive video delivery, and we are experiencing problems with huge audiences. Basically, when the edge server reaches thousands of users watching (6000) a live video in a single application, this instance is unloaded by the server with the following error:
==> edge.00.log <==2010-06-1115:51:1018614(i)2701054Virtual host Disconnecting unresponsive core live/stream (28860) after 30 seconds is not available.-==> core.00.log <==2010-06-1115:51:1028860(i)2581233Core (28860) disconnecting from admin: 200.-==> master.00.log <==2010-06-1115:51:1018593(w)2581257Core (28860) _defaultRoot_:_defaultVHost_:::_0 is not responding and is being restarted!-2010-06-[code]......
In this situation, the CPU usage is something around 30%, the memory is almost unused, and the load average is very low. We are using FMIS 3.5.3 854a running in the CentOS.