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


Similar Posts:


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

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

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() 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 :: 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 :: 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

Flex :: Prevent Container In ItemRenderer From Exceeding Width Of List Container?

Jul 2, 2011

In a Flex Mobile project I have a simple itemRenderer where I'm trying to create an "bubble" texting effect, similar to ichat or iphone (just so you get what im going for). But if the text is longer than the screen it runs off, rather than just going down a line.

If I set Group thats holding the rectangle(to create the bubble effect) and the label to 100% it works and keeps it from exceeding the list containers bounds, BUT the group is always at 100% and looks bad, I'm trying to keep the "bubble" JUST AROUND the text.

Anyway so, at the top of my itemRenderer I tried specifying:

<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%">

And here's my layout I figured since msg_container has a width of 100% I was hoping bubble_lable_group would just not exceed that but...it doesnt...it just runs off. I tried setting a max width but that does not allow you to input percents. And just to say it 1 more time. I know if i set bubble_lable_group width to 100% it works, and keeps it from going off the edge, but then the rectangle "bubble" stretches all the way across and just looks bad.

<s:VGroup id="main_container" horizontalAlign="left" paddingBottom="10" paddingTop="10"
verticalAlign="top" width="100%">

[Code]....

View 1 Replies

Professional :: Run Project (main Container SWF And Child SWFs) Into Another Container File Which Place On A Website?

Jun 17, 2010

I am facing a issue in Flash container. I am having a project which has main container which call different SWFs into it. Now I call this main container file into another container, and their problem starts. Many option doesn't work properly which generally have _root, _parent etc...
 
If I want to run project (main container SWF and child SWFs) into another container file which place on a website. I want to show whole project from this container file so what I need to do?

View 1 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

Flex :: Dynamically Adding Container To A Dynamic Container

Sep 21, 2011

I have a loop that goes through data from a book and displays it. The book is not consistent in it's layout so I am trying to display it in two different ways. First way(works fine) is to load the text from that section in to a panel and display it. The second way is to create a new panel (panel creates fine) and then add collapsable panels(nested) to that panel. Here is the code from the else loop.

else if (newPanel == false){
// simpleData is just for the title bar of the new panel
// otherwise the panel has no content

[Code]....

The error I get is: ReferenceError: Error #1069: Property panel4.4 not found on components.readTest and there is no default value.

I have tried setting the "name" property instead of the "id" property.

View 1 Replies

Flex - Hide Container Of A Viewstack Container?

Dec 23, 2010

I have a viewstack container w/ 3 views: red, black, and blue. How can I completely hide the black & not include it?

[Code]...

View 2 Replies

Flex :: Drag Circle From One Container To Another Container?

Jan 13, 2012

I am creating an flex Air project,so mxml file will run. I have circles in one Big circle at one side and will be same on other side.

Now how to drag any circle from any Big circle to other side. Or it could be like any two container having circles, then how to drag and drop circle?

For one circle i am able to do drag and drop.But I want one Big circle on left hand side and one big circle on right hand side .And small circles with class names will be in these big circles.Now i want to drag and drop those small circles in big circles.Big cicles should not move. Even i have tried this code in actionscript

package
{
import flash.display.Sprite;
import flash.events.MouseEvent;

[Code].....

But in this i want big circles should not move and small circles should only be dragged.

View 1 Replies

ActionScript 3.0 :: Scale Container In Another Variable Container?

May 6, 2010

I need to place an image into a container. The problem is that I will not know the size of the image or the container beforehand, so it all has to be dynamic.this is how I started (have not gotten to stage(or container) changing size yet. No matter what I try, either all the images are the same width, or they are all the same height. If some images are portrait and other landscape, I don't want all the images to be X pixels high. In this variation of the code, all the images turn out the same height, regardless of portrait or landscape.

ActionScript Code:
var ratio:Number = container.width/container.height;//get the ratio, if width is bigger than height then ratio is greater than 1, else ratio is smaller than 1

[code]........

View 0 Replies

Flex :: Moving Children Of A Container (defined In MXML) Inside An "inner Container"

Jan 27, 2010

I'm currently working on a custom component which extends Canvas (let's call it SuperCanvas) ; it's basically a container that let you zoom & pan its contents. It would be too long to explain why, but I can't use scrollRect, so I was forced to declare a Canvas object (called innerCanvas)... inside my SuperCanvas (I know, not very nice =/) I would like to know if there's a proper way to "redirect" the creation of my component's children in this canvas.

[Code]...

View 1 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

Closing And Open On Click?

Jun 29, 2009

I want to make a website and for the navigation when you click a button, I want the window that is open to fade out and than have the window open that you just clicked on fade in (using flash cs4)

View 21 Replies

Flash :: Closing An SWF File

Jan 20, 2011

How do I close an SWF file using AS3? I want to include the close in an event listener, so when the user clicks a button the application will close. I tried - [code]

View 1 Replies

ActionScript 3.0 :: Pop Up Window Closing

Oct 22, 2010

I made a custom class which shows a popup window in flash. What I want to do is to close it by clicking anywhere but not the window itself (and everything that is a button on the stage). I added this line of code

[Code]...

View 3 Replies







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