IDE :: UnloadAndStop And Extending Loader?

Oct 25, 2003

I have an asset management system which loads a bunch of external swfs, and when requested distributes copies of those swfs to other parts of an app (it creates instances of the classes to do this).Anyway, when I use these loaded swfs somewhere and then remove them Flash does its trick of leaving the sounds running (as they are triggered by timers).If they were Loader class items I could use .unloadAndStop() to shut them up and get them garbage collected, but they aren't of course.I thought I might be able to extend the Loader class and set the .content my self - which I have done by overiding the content getter in Loader. I was hoping I could then use unloadAndStop on that class but nothing happens. I've tried casting my fake Loader to a Loader as well and no joy.

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Loader's UnloadAndStop() Different Behavior?

Mar 9, 2011

I know the Loader's class unloadAndStop() supposes to unload and stop everything on a SWF's stage when I load one, but does it also changes objects within the library (even if they are not on stage?).I'll tell my problem to clear it up. I am loading SWFs dynamically into my application and extract required symbols from them using applicationDomain and getDefinition. The stage of the SWF/FLA I am loading is empty, and all I have are exported symbols in my library.

The problem happens when I load symbols which have pre-compiled clips inside of them (in my case, a Partigen emitter, but I don't think it really matters), which probably has event listeners or timers - the code on these clips stops working and acts weird. I assumed unloadAndStop removes a required event listener from it, but not sure why (again, it's not on the stage). I am forced to use unloadAndStop on my loaders, since my designers put all their assets on the stages in numerous FLAs and now going back and changing it will cripple the company's work.

I'd write my own kind of unloadAndStop that filters these pre-compiled clips or checks what's truly going on there, but I am pretty sure that unloadAndStop does things which are unavailable through the API.

View 9 Replies

ActionScript 3.0 :: UnloadAndStop From Within An Mc?

Dec 26, 2010

Below is the code that was was used to call swfs from a button click with unloadAndStop on the main timeline.All work but I have a dropdown menu that is inside a movieclip called wholeMovie_mc that also sits on the main timelinethe dropdown has two buttons that need to also call swfs and unloadAndStop the previous loads on the main timeline.I got the script to work  without errors except it only removes the previous swfs from inside the wholeMenu_mc and not the main timeline.How can I get the code to unoladAndStop the swfs on the main timeline?code in RED is for the main timeline

gotoAndPlay("home");
var my_loader:Loader = new Loader();my_loader.load(new URLRequest("swfs/home.swf"));addChild(my_loader);

[code]....

View 11 Replies

ActionScript 3.0 :: UnloadAndStop(); Not Working?

May 25, 2011

I'm using a loader to load an external swf. This swf has video content. In the past when I removed the swf with unloadAndStop(); if the video was playing in the external swf, it would stop. Has things changed? Here is the code:

Actionscript Code:
SWFclose_btn.addEventListener(MouseEvent.CLICK, closeITAct);function closeITAct(e:MouseEvent):void{  suLoader.unloadAndStop();}

[code]....

View 2 Replies

ActionScript 3.0 :: UnloadAndStop, Closing Swf In Container?

May 22, 2010

I'm trying to unload an swf that takes up the whole screen by adding a listener on the holder_mc, which is what is holding the swf but it doesn't seem to be working.  If you guys could, take a look at my code.  Do I need any code in the swf that is being loaded in for it to close?
 
var swfLoader:Loader = new Loader();
slideshowimages_mc.one_mc.addEventListener(MouseEvent.CLICK, oneClick);
function oneClick(event:MouseEvent):void

[Code].....

View 17 Replies

ActionScript 3.0 :: UnloadAndStop() Fails On Swf With FLVPlayback?

Aug 24, 2010

I have a .swf containing a FLVPlayback components that includes a FLV movie.I'm loading this .swf in a main flash project using a Loader(). When I try to unload the .swf using myLoader. unloadAndStop() the FLV inside the FLVPlayback still playing (I can't see it, but I'm still listening his audio).How could I unload nicely a .swf that inside it has a FLVPlayback component?

View 3 Replies

ActionScript 3.0 :: UnloadAndStop() Working Only The Second Time

Jan 23, 2011

I am making a flash website that loads 20 external swf files and I am having problems unloading them. after many tests I noticed something strange : When looking at the memory load of the browser in the task manager, I can see that each swf file will add memory load the first time it's loaded (which will remain even after calling unloadAndStop), that memory load will double the second time the file is loaded but after the second time the memory load does go down when unloadAndStop is called.
 
I tried a bunch of things but I can't seem to find the right thing to do. I tried removechild before calling unloadAndStop and the memoy load was only going up. Since those external files have many HD images, each one adds around 100mb of memory so it's a very big problem.

View 13 Replies

Flash :: UnloadAndStop With EZFLAR/webcam?

May 1, 2011

I'm making a book/magazine with EZFLAR and Flash, but I was going to need a lot of markers (and they become indistinguishable by FLARToolkit the more they are), so now I'm trying a different approach: just three markers and then, load a different SWF that triggers different actions for each marker.

To do so, I made a loader.swf that will be in charge of loading any of the specific swf depending on what the user clicks. I started with my first button and it loads fine, just it has two problems.

First problem, and not so important, is that I can't seem to add anything over the webcam stream, not even placing it on the EZLFAR.fla, the webcam always covers everything. I decided, then, to add a little margin where I can place a UI (maybe a back button or the other swf loaders).

[Code]...

View 1 Replies

ActionScript 3.0 :: Difference Between Unload () And UnloadAndStop ()?

Mar 24, 2011

unloadAndStop () is really a cool function especialy for unloading and loading same external clip, however due to the client needs, I need to export my flash as FLP 9+ Therefore, I can`t use unloadAndStop (), and my only option is to use unload(); unload () is not that good. Clip gets unloaded, but sound remains. if I kill the sound, and start it again when clip loads, it will start on the same place where it begun. I can "kill it forever" with SoundMixer.stopAll (), but that does not allow me to start the sound again.

View 4 Replies

ActionScript 3.0 :: SwfLoader.unloadAndStop() Not Removing Everything?

Aug 17, 2011

I'm using flash builder with the adobe AIR player, when I load an swf that loads another swf within itself then later run swfLoader.unloadAndStop() it removes everything but the swf that was loaded within the other swf.

View 0 Replies

ActionScript 3.0 :: Unloading External Swf Using New UnloadAndStop?

Jun 30, 2009

So I was reading in to unloadAndStop a little bit and found out this is the exact thing I need when loading my external swf's which have sound on them. I am new to AS3 so please bare with me. I believe I understand it when applying it to loading one single swf. But I have my site set up a little differently by using a universal button for my links. How could I apply "unloadAndStop" as a universal function to when any button is clicked the previously loaded swf unloads? I also had a question about fading the swf's in and out. I'm pretty sure from what I can remember that I can add the fades right in to my AS3 below instead of having to add them to each of the external swfs right?

Code:
var Xpos:Number = 35;
var Ypos:Number = 260;

[code].....

View 1 Replies

ActionScript 3.0 :: SWF With Sound On Frame - UnloadandStop Not Working

Feb 17, 2011

I have a loaded swf which contains sound on its frame. Even though I have unload it, the sound still playing. I cannot get rid of it. I've tried:
- _loader.unloadAndStop();
- SoundMixer.stopAll();
- System.gc();

View 1 Replies

ActionScript 3.0 :: UnloadAndStop() Freezing / Crashing Flash?

Jul 24, 2009

I have been using the new unloadAndStop() function to unload some loaded SWFs after they are no longer needed. This has been working fine whilst testing in flash, and when I have tested it using firefox. However, to my utter horror and despair unloadAndStop() seems to be crashing safari and IE8. I haven't tried IE7.

After replacing unloadAndStop() with the old unload() the crashing stopped. So I am certain this is the problem. unloadAndStop(false) also caused flash to crash. No error was displayed.

This project has been 7 months in the making and involved a lot of hard work in the evening and weekends. I noticed that it was starting to lag after being in use for a while because SWFs weren't being released from memory. When I say lag as well, It's not like normal frame rate slowing down lag, the whole application will simply freeze up for a couple seconds, and the freezing lasts longer the longer the app has been running. I have gone through and made sure to null almost every variable myself, and null any variable in the loading swf that points to anything in the loaded SWF. It appears to be working now using the old unload() function, but will need more testing to be sure because the lagging only turns up after the application has been running for about 45 minutes and has loaded and unloaded several SWFs.

Anyway, is there anything that I can do about this or am I missing something obvious? I haven't found any other posts about this, has anyone else had this problem? Why does god hate me so much?

Sort it out please Adobe, I really don't think it should be this hard to get rid of a loaded SWF. If you were in front of me right I would be screaming at you.

View 3 Replies

ActionScript 3.0 :: Splash Page - Using UnloadAndStop To End All MovieClips

Apr 1, 2011

I currently have a splash page which uses a variety of tweens to make an animation of a character running. The splash page also has music playing in the background and a small skip button (located in the corner) which is given the instance name "reelButton". I want the splash page to link to a loading page (file name "loading_screen.swf") I have created which uses a black background and an animation of a skull rotating. When I press the skip button, it does navigate to the loading page but the character running from the splash page and the music is still playing. I know its because I need to use the unloadAndStop command to stop all the movie clips from the splash page. But even with this it still doesn't seem to work.

Below is the code:
var contentLoader:Loader = new Loader();addChild(contentLoader);
reelButton.addEventListener(MouseEvent.CLICK, reel);
function reel(event:MouseEvent):void {
loadURL("loading_screen.swf");
}function loadURL(url:String):void {
contentLoader.unloadAndStop();
var request:URLRequest = new URLRequest(url);
contentLoader.load(request);}

View 6 Replies

ActionScript 3.0 :: Unable To UnloadAndStop Captivate 5 Swfs?

Jul 8, 2011

have a flash 'menu' swf that on the click of a button loads into a loader a flash 'controller' swf. This swf in turn loads into a loader a 'captivate 5' swf. All published to fp10.exit the captivate movie the user can click on the menu button (which resides on an area of the 'menu' swf below it), and I have coded to UnloadAndStop and StopAllSounds of the 'controller' swf loader.his works, everything goes, the loader 'unloads' and it does stop the  sound of the current captivate slide, but then audio from the captivate movie will fire up again from the next slide and continue to play over the menu

View 24 Replies

ActionScript 3.0 :: Loading / Unloading / UnloadAndStop() Not Working?

Feb 12, 2012

I have a presentation that has 3 chapters. I've built functionality so that you can load each individual SWF chapter with a loader called singleLoader. I've also built in functionality so that at any time, you can hit the down arrow and it will unload those movies. I have a separate button that allows you to loop through all 3 chapters. They'll just play one after the other. The problem with this approach is that there are 2 different loaders and if I unload one of the chapters and try to start the looping, I can hear the audio, but I can't see the movie.Here's the first loader:

Code:
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);[code].......

View 6 Replies

ActionScript 3.0 :: Use The New UnloadAndStop() Method To Unload Assets From The Production?

Mar 10, 2009

We have been developing a production in Flash CS3 for the past month.We were experiencing problems with memory leaks in Flash Player 9 and it was recommended that we upgrade to Flash CS4 and Flash Player 10 so we could use the new unloadAndStop() method to unload assets from the production.

On upgrading to FP10 we were able to solve our memory leak issue. But on doing so, the upgrade introduced a new problem into our production. Some of the methods that worked in FP9, now do not work in FP10. Nothing in the code of the methods has changed.

Is anyone aware of any bugs in FP10 or any differences in the coding that is needed to do tasks like reference the stage, create event listeners, etc?

View 1 Replies

ActionScript 3.0 :: Stopping External Swf From Playing "unloadAndStop()?

May 23, 2010

I am having a problem stopping external swf from playing. I am currently using FlashCS4 and publishing to Flash Player 10. I would really like to use the code loader.unloadAndStop();" to stop the swf. I tried using it but I keep getting the following error: 1061: Call to a possibly undefined method unloadAndstop hrough a reference with static type flash.display:Loader.loader.unloadAndstop();I read somewhere that since the swf files were published in Captivate (also using Flash player 10) I have to load the swf into a flash movie clip first then try the loader.unloadAndStop code. where to put that code or what I'm doing wrong? And please be very detailed, I am new at this and have little experience.

ActionScript Code:
fscommand("allowscale","false");
fscommand("showmenu","false");

[code]....

View 0 Replies

Flash :: Unloading Swf Using The UnloadAndStop() Method, But Video Sounds Remain Audible

Feb 16, 2011

I have tried many approaches to unloading my swf, but to no avail, the video sounds within my laoded swf keep playing even once the swf has been loaded.

I have created a universal loader as follows:

var loader:Loader = new Loader();

I then load various swf's into a movie clip named mov_contentLoader, for example the video swf is loaded as follows:

loader.load(new URLRequest("video.swf")); //assign SWF url to loader
mov_contentLoader.addChild(loader); //add loaded content to movi clip

I then have a generic "exit" button, based on the state of the application, certain windows are closed, swf's are unloaded etc. For my video.swf file, when the exit button is clicked, I call the unloadAndStop(); method on the loader as follows:

loader.unloadAndStop(); //unload all content, do some garbage cleanup
mov_contentLoader.removeChildAt(0); //just to be safe, a second layer of reassurance ??

The SWF is unloaded, but for the life of me I can NOT get the sounds to stop! I even resorted to adding stage listeners on the video.swf to listen for an exiting state, but that still did not stop video sounds.

If I load the video.swf in again and play a different video, the two soundtracks play ontop of each other.

View 4 Replies

ActionScript 3.0 :: Stopping External Swf From Playing Using "unloadAndStop();"

May 24, 2010

I am having a problem stopping external swf from playing. I am currently using FlashCS4 and publishing to Flash Player 10. I would really like to use the code "loader.unloadAndStop();" to stop the swf. I tried using it but I keep getting the following error: 1061: Call to a possibly undefined method unloadAndstop through a reference with static type flash.display:Loader.loader.unloadAndstop();

I read somewhere that since the swf files were published in Captivate (also using Flash player 10) I have to load the swf into a flash movie clip first then try the loader.unloadAndStop code.

ActionScript Code:
fscommand("allowscale","false");
fscommand("showmenu","false");
//import flash.display.MovieClip;

[Code].....

View 0 Replies

ActionScript 3.0 :: Loader Or Loader Context - Container Loads The Module From An Absolute Path

Jan 23, 2009

I have two swf files, each one almost with the same classes, the most important one is a Singleton class, each swf does "singleton.getInstance()". The diference is that one swf is like a container and the other one is like a module. So when the container loads the module from an absolute path like loader.load("file://c:/modules/module.swf") or loader.load("[URL]"), two different singletons (same class) are created

But when the container loads from a relative path like loader.load("module.swf") , just one singleton is created (that is what I want) I am just intrigued with this behavior, could someone explain me this? PD: I believe is something related to loaderContext and applicationDomain but It also appears that isn't working right. -Patricio Foieri , Vertigo Labs

View 1 Replies

ActionScript 3.0 :: Loader Event.INIT Fires But Loader.content Is Null?

May 9, 2009

The title describes the problem: Loader.load() is firing the INIT event, but in my listener it's reporting loader.content as null. The description for INIT event is "Dispatched by the associated LoaderInfo object when the properties and methods of the loaded SWF file are accessible."I'm loading a lot of JPG images, and 95 percent of the time it works fine; the init listener fires and reports valid loader. content.I absolutely need loader.content available because I need to set the bitmap smoothing property to true.I've tried using Event.COMPLETE and it has the exact same problematic behavior.

View 13 Replies

ActionScript 3.0 :: Game App Runs Fast In Simple Loader And Slow In Other Loader?

Apr 28, 2010

I'm feeling a bit low now as I have been suffering this for months. A simple loader loads my simple game and runs VERY FAST on even slow pcs BUT when I build this other loader, it goes quite slowly and I don't know where the app is going wrong. WHERE is the processing consumptoin coming from out of my app.

[Code]...

View 1 Replies

ActionScript 3.0 :: Loader Disappearing - Set The Dimensions Of The Loader So The External Swf Doesn't 'spill Over', The Result Is A Blank Screen?

Mar 26, 2010

I have the following code which simply loads an external swf, puts it in the right place and should all be hunky dory.This works:

Code:
var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest=new URLRequest("foobar.swf");[code].....

to set the dimensions of the loader so the external swf doesn't 'spill over', the result is a blank screen. No matter how high I set those dimensions it just doesn't display anything.

View 4 Replies

ActionScript 3.0 :: ADDED Event In Loader.load And Loader.loadBytes

Sep 13, 2010

I got this very strange behavior from FlashPlayer debugger 10.1 r82. When I call loader.load method, no ADDED event is dispatched to the loader object. But if I open the file and call loader.loadBytes instead, an ADDED event is dispatched to the loader object. I suspect the ADDED event is dispatched because the content is being set as the child of Loader object, but why in the other case it is not dispatched?

View 4 Replies

Actionscript 3 :: Only The Loader Images Are Being Exported In Frame 1 But The Loader Still Only Shows Up At 100%?

Apr 7, 2012

the file loads correctly but the loading screen only flashes up at the end.The only thing being exported in frame 1 is the loader image, and that is extremely small.Is it possible that there's a queue of things being loaded and the loader image is at the bottom of that queue? Since that was one of the last things added to the project

View 1 Replies

ActionScript 3.0 :: When Loader.swf Loads The RSL And The Other 10 Swfs The Loader Throws Errors?

Aug 12, 2009

i have a main loader swf file called loader.swf and it loads an RSL.swf (runtime shared library for my swf files) and then 10 swf files, each one to a container (fE.: movieclip '01' in loader.swf, then movieclip '02' and so on). the 10 swf files have a lot of references to RSL.swf, and i have to use RSL.the problem is when loader.swf loads the RSL and the other 10 swfs the loader throws errors like this:

Code:
*** Security Sandbox Violation ***[code]...

then i put in EVERY swf files (loader,RSL and the other 10) the code Security.allowDomain ("*") but throws the same errors...

View 1 Replies

ActionScript 3.0 :: Keeping Loader Contents After Loader Removed From Memory

Aug 21, 2009

I'm loading some images with Loaders, cloning the BitmapData to a new Bitmap, and adding the Bitmap as a child of a Sprite. So far, so good. I want the Loaders I'm using to be removed by garbage collection, which they seem to be. The problem, or so it seems, is that when the Loaders are cleaned up, the Bitmaps I'm creating lose their data.

Edit: All this is happening when a class is instanced, and many copies of this class are being used as actors in a game. As the Actors are being created the older ones are losing their BitmapData to garbage cleanup. When all of them are finally loaded, only the last few are visible. I've rewritten my posted code as a class. If I prevent the Loaders from being cleaned up by somehow keeping a reference to them, the Bitmaps don't lose the data, but I don't want these Loaders hanging around.

[Code]..

View 1 Replies

Actionscript 3 :: Loader() - Loading Multiple Images With One Loader?

Mar 11, 2010

I am attempting to load multiple images in AS3 and I'm exploring different options on how this can be done.I would like to have to only use one Load() instance and handle the various image assignments in the onComplete handler...here is my first attempt:

var buttonLdr:Loader = new Loader();
buttonLdr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
buttonLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadCo

[code]....

View 1 Replies

ActionScript 2.0 :: Simple Loader Fails When Loading In An .swf Containing The Loader?

Jun 26, 2007

Sorry for the complicated topic. I got a .swf that loads in other .swfs. Rather than figuring out how to make a loader for loading .swfs I thought I'd just use a simple loader in the .swf I'm loading.

However, it doesn't work. It starts fully loaded but doesn't finish. Heres the AS:[AS]_root.stop();
PercentLoaded = _root.getBytesLoaded()/_root.getBytesTotal()*100;

[code].....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved