How can I unload external SWF?

I use the following code to load an external SWF file. I want to unload the SWF (Clock.swf) after 10 seconds (automatically). How can I? I use greensock class.

import com.greensock;

com.greensock.easing import. *;

com.greensock.plugins import. *;

import com.greensock.events.LoaderEvent;

var mySwf1:SWFLoader = new SWFLoader ("Objects/Clock.swf", {height: 200, width: 200, onComplete:completeHandler1, container: ClockContainer});

mySwf1.load ();

function completeHandler1(event:LoaderEvent):void {}

TweenLite.to (event.target.content, 0, {alpha: 0});

TweenMax.fromTo (event.target.content, 3, {x: 0, y: 0, width: 200, height: 200, alpha:. 1}, {x: 0, y: 0, width: 200, height: 200, alpha: 1, delay: 5.});

}

Download:

mySwf1.dispose (true);

Unload after 10 seconds:

setTimeout (function () {mySwf1.dispose (true)}; 10000);

Tags: Adobe Animate

Similar Questions

  • How can I add external SWF score.

    How can I add the scores of different levels of the game that I created in which each level are all different SWFs, which is loaded by the class loader.

    You must have a main swf file that is loading.  maintain a score variable in the main swf.

  • How to resize the external .swf files?

    Hello

    THA following the code is to resize the video Clips which are on stage. But how can I resize externally. SWF files? I am adding an external .swf file through Gallery_mc.addChild (loader);

    The following code works very well for resizing of video Clips on stage:

    var myStage:Stage = this.stage;

    myStage.scaleMode = StageScaleMode.NO_SCALE;

    myStage.align = StageAlign.TOP_LEFT;

    function initialDisplay(event:Event):void {}

    var swfWidth:int = myStage.stageWidth;

    var swfHeight:int = myStage.stageHeight;

    Gallery_mc. Width = swfWidth;

    Gallery_mc. Height = swfHeight ;}

    addEventListener (Event:ENTER_FRAME, initialDisplay);

    Help, please.

    Thank you.

    It is not supposed to resize an external swf, unless you load it.  If you load, use a complete listener to resize:

    var loader: Loader = new Loader();

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, f);

    Loader.Load (new URLRequest ("swf1.swf"));

    function f(e:Event):void {}

    addChild (loader);

    Loader.Width = Whatever;

    etc.

    }

  • How can I see external drives on the sierra?

    How can I see external drives in sierra?

    Menu Finder Preferences... > General

  • How to unload external SWF?

    I was finally able to work on a way to fix and preload external SWF files - now I'm looking to understand how to unload the SWF external on a mouse event so that a new SWF file can be played.
    I googled this to death all day and have resulted in nothing of what seems to work for me.
    Below is are code so far... does anyone know what I need to add?
    Help, please...

    I have it working! YAY!
    I learned a lot from Andrei1 - fantastic help... unfortunately I still couldn't the code work...
    I bought 'Visual Quickstart Guide ActionScript 3.0' and tried some of their code mixed with some of my own (with help from the knowledge I gained from Andrei1 - THANKS again legend)...
    In any case, the resulting code is as below - which you charge my external SWF files and then discharge them with a click of mouse - FANTASTIC! Hope this helps others out there with the same problem.

  • How to get an external SWF to start playing only when the preloader is finished?

    Yet another dilemma with my external swf.
    How can I get the external SWF only start playing once the preloader has finished loading the entire file.
    Currently when the SWF file is it already started playing in progress through the file.
    Any suggestion would be appreciated... my code is fixed as follows:

    After a hunt more through discussion of other people, I think I have the solution (not sure if it is the best way, but it seems to work). My new code is detailed below, including:

    MovieClip (myloaderDB01.content) .play ();

    Then I had to change my external SWF by the first blank frame and put a stop();
    Now when the preloader does its job the external SWF plays until it is supposed to - YAY.
    Hope this helps others...
    Any other suggestions out there with regard to a better way to do this work would also be appreciated.

  • How can I use external speakers with my MacBook Air?

    How can I use an external speaker with my MacBook Air? I have a Samsung wireless speaker.

    They are Blue Tooth? If Yes, then you need to pair by using the preferences of BT.

  • Question: How can I format external drive in exFAT? NOT in NTFS!

    OK, so frustrated that I had to go through the hedges to sign up here to ask a question like that. Why can I NOT format exFAT? I have many external HDDs that were formatted in exFAT under WIndows XP Pro but my new system, completely updated Windows 7 Professional, I can't format external drives of exFAT. The option is NOT available. In the Format window, file system, is the only option: NTFS (default), there is no other option. I googled the * on this issue and found no answer. This external hard drive MUST be formatted as a disc exFAT. Period. Someone please help.

    I'm surprised the research online increase this... You can do it from the command prompt, but not from this dialog box.  Here's how:

    -Open a command prompt by typing cmd in the start/search box, right click on the cmd search result and select "Run as Administrator"
    -Type format g: FS:exFAT , then press ENTER to start formatting the G drive as exFAT
    To view all other options, type format /? and press ENTER.
  • How can I insert files swf in adobe muse

    I need to insert a few samples of our work on our site that we develop in muse of adobe.  The samples are in swf output.  How can I import swf into muse adobe?

    Hello

    Take a look at this topic, if it can help

    https://forums.Adobe.com/message/4635231#4635231#4635231

  • How can I activate external controls on Sat 2450?

    How can I activate outside the case of controls for media player ect on my satellite 2450

    Hello

    As far as I know this unit has 3 control buttons of Toshiba.
    1. Internet button-> to start Internet Explorer
    2 button Toshiba Console-> to start the Toshiba Console
    3. TV button-> to start Tv
    I think that it of not possible to configure one of the buttons to start the media player.
    To my knowledge it of only possible to select the applications that you want to use with media types.
    Please check these settings in the properties of controls on Toshiba.

    Good bye

  • How can I use external CSS, JavaScript and Images in the PeopleSoft Portal?

    I develop a website and I need to put my CSS, JavaScript and IMG files in a folder on the server that can be used by the objects of my HTML.

    Where should I put the images? How can I get the HTML code of the objects can read these images?

    I tried several things like:

    < link rel = "stylesheet" href = "" < % = psCtxPath % > < % = psHome % > \MyStyleSheet.css "rel ="stylesheet"type =" text/css">"

    "< link rel ="stylesheet"href="\portal\MyStyleSheet.css "rel ="stylesheet"type =" text/css">

    "< link rel ="stylesheet"href="\ps\images\portal_pa\MyStyleSheet.css "rel ="stylesheet"type =" text/css">

    By "Object HTML" do you mean HTML definitions in App Designer? If so, how you use these HTML definitions? You use the PeopleCode GetHTMLText? You want to store your images and CSS in the database where it won't delete whenever you regenerate PIA (Tools fixes and upgrades)? If the answer to all these is Yes, use %Bind(:1) (or: 2: 3, etc.) for your images, JavaScript and CSS. In your PeopleCode, use % Response.GetImageURL (IMAGE.NAME_OF_YOUR_IMAGE), Response.GetJavaScriptURL (HTML.NAME_OF_YOUR_JS_DEFN), %Response.GetStylesheetURL(STYLESHEET.) YOUR_CSS_NAME) to obtain the URL of the item stored in the cache. Pass this URL to the GetHTMLText function as the value for one of bind variables in the HTML code.

    If you put images in the folder root (PORTAL.war) of your web server, and reference to ' / '. If you put them in a folder under PORTAL.war, for example, a folder named ps, use/ps/nameoffile.png. Always use ' / ', not '-' for internet URLS.

  • Hello. Is it possible that I can call an external swf button?

    I create a game and I want to call a button from an external swf object. Is this possible?

    If the file is not responsible he cannot do anything to the file which is an impact.

  • Cannot unload external .swf and return to section 1

    I tried several suggestions on this forum to solve my problem, but it is clear to me miss me something, because I'm a Flash of NOVICE developer. I have everything works in my Flash file, EXCEPT that I want to use this code to play a .swf file. When the SWF is done playing OR that the user clicks on the "back to the main Menu button", they return to frame 1.

    Stop();

    Log_In.addEventListener (MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_7);

    var fl_Loader_7:Loader;

    var fl_ToLoad_7:Boolean = true;

    function fl_ClickToLoadUnloadSWF_7(event:MouseEvent):void

    {

    If (fl_ToLoad_7)

    {

    fl_Loader_7 = new Loader();

    fl_Loader_7.load (new URLRequest ("NAV01BBEC293.swf"));

    addChild (fl_Loader_7);

    fl_Loader_7 .x = 19;

    fl_Loader_7 there = 67;

    }

    on the other

    {

    fl_Loader_7.Unload ();

    removeChild (fl_Loader_7);

    fl_Loader_7 = null;

    }

    Toggle if you want to load or unload the SWF file

    fl_ToLoad_7 =! fl_ToLoad_7;

    }

    Main_btn.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_9);

    function fl_ClickToGoToAndPlayFromFrame_9(event:MouseEvent):void

    {

    gotoAndPlay (1);

    }

    Games of .swf files and when I click "Back to main Menu" button, that some items display of frame 1. The .swf file is always loaded to hide items that need to display the frame 1. I've attached a screenshot of what happens when I click on the button "back to the main Menu.After_click_Main_Menu button.png

    Here is a screen should look like shot of what framework 1.

    Frame_1.png

    I'm on a very tight schedule, any help would be most appreciated!

    Looks like I got the order backwards (or Adobe did when they christened)...

    try... fl_Loader_14.unloadAndStop ();

  • How can I invite external users for a Web Conference?

    Hello
    try to invite non Oracle users for a Web Conference to hive. How can I do this?
    Or do we still have to use stconference.oracle.com?
    Thank you
    Francis

    Francis,

    See the other your request on e-mail for info on the Conference

    Phil

  • Why I can't load external .swf boxes?

    Hello world...

    I am trying to load an external .swf that contains check boxes. The external .swf has a script in the applications folder on FMS3 server-side.

    When I insert the external .swf locally, it works fine.

    If I load the external .swf remotely with an Apache Web server, the external .swf is loaded but do not appear the boxes...

    Why?

    Please, help me...

    Emiliano.

    Are these components AS2 or AS3? If the latter, I would advise you to place the components in a RSLS (runtime shared library) and active in the external SWF, then reference the RSL.

    -Robert

    --

    Robert Reinhardt

    Creator, videoRx.com

    Author, series Bible Flash and video for Adobe Flash CS4 Professional Studio Techniques

    Adobe Community Expert

    http://blogs.flashsupport.com/Robert

Maybe you are looking for