Too late to load the new SWF after unloading the current SWF file

Hello

In our application, we use more than 10 sovereign wealth funds. When you cross one SWF to others try to unload currently load SWF and load a new. We were successful to unload the existing SWF, but the problem, takes too long to load SWF again (more than 5 seconds). Please suggest a useful method to overcome this time for best performance.

get an idea of the following code snippet.

Thank you


public void SwitchSWFs (): void

{

If (null! = SystemAgent.getInstance () .currentSWFLoader)

{
SystemAgent.getInstance ().currentSWFLoader.unload ();
SystemAgent.getInstance () .currentSWFLoader = null;
trace ("HomeUI: previous swf unloaded!");
}
on the other
{

}
addChild (SystemAgent.getInstance (.swfLoaderSecondSWF));
SystemAgent.getInstance () .currentSWFLoader = SystemAgent.getInstance () .swfLoaderSecondSWF;

}


will call by clicking a button
public void LoadSecondSWF (): void

{
SystemAgent.getInstance (). swfLoaderSecondSWF.load (new URLRequest ("Second.SWF"));
SwitchSWFs();

}

The delay is when you test locally?

One thing you might try is to load all Chargers present you at the front they are needed so that there is more likely that they are ready to be added to the display list when it is called for.  So instead of having the button trigger loading the SWF, just it call the switchSWFs function.

Another thing, you could try if you keep it where the Triggers button load the corresponding file to assign an event listener for the charger to detect when it has finished loading and then have this listener event handler function calls the switchSWFs function.  At least this way, the current swf file is not unloaded until a replacement is ready and waiting.

Tags: Adobe Animate

Similar Questions

  • Delete / external swf or the files in the flash file main to unload and load a new swf file and memory garbage collection.

    I can't delete / unload the example swf files external when the carousel.swf (portfolio) appears and press the button about the content overlaps the carousel (portfolio). How can I delete / unload an external swf file in the main flash file and load a SWF, so that at the same time remove garbage collection memory operation?

    This is the error messages I receive: "TypeError: Error #2007: child parameter must be non null.»

    at flash.display::DisplayObjectContainer/removeChild()

    " to index_fla::MainTimeline/Down3().

    Import nl.demonsters.debugger.MonsterDebugger;

    var d: MonsterDebugger = new MonsterDebugger (this);

    stage.scaleMode = StageScaleMode.NO_SCALE;

    internship. Align = StageAlign.TOP_LEFT;

    stage.addEventListener (Event.RESIZE, resizeHandler);

    is the charger for the portfolio page swf

    var loader: Loader;

    var loader2:Loader;

    var loader3:Loader;

    var loader1:Loader;

    resize the content

    function resizeHandler(event:Event):void {}

    resizes the portfolio page to Center

    Loader.x = (stage.stageWidth - loader.width) *. 5;

    Loader.y = (stage.stageHeight - loader.height) *. 5;

    resizes on page to Center

    loader3.x = (stage.stageWidth - 482) *.5 - 260;

    loader3.y = (stage.stageHeight - 492) *.5 - 140;

    * loader2.x = (stage.stageWidth - 658.65) *. 5;

    loader2.y = (stage.stageHeight - 551.45) *. 5; * /

    }

    addEventListener (Event.ENTER_FRAME, onEnterFrame, false, 0, true);

    function onEnterFrame(ev:Event):void {}

    var requesterb:URLRequest = new URLRequest ("carouselLoader.swf");

    Charger = null;

    loader = new Loader();

    Loader.Name = "carousel1.

    Adds gallery.swf in the scene at the beginning of the film

    loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioError);

    function ioError(event:IOErrorEvent):void {}

    trace (Event);

    }

    try {}

    Loader.Load (requesterb);

    } catch (SecurityError: error) {}

    trace (Error);

    }

    addChild (loader);

    Loader.x = (stage.stageWidth - 739) *. 5;

    Loader.y = (stage.stageHeight - 500) *. 5;

    stopover gallery.swf duplication and more on enter frame

    removeEventListener (Event.ENTER_FRAME, onEnterFrame);

    }

    PORTFOLIO BUTTON

    Add eventlistner so that gallery.swf can be loaded

    MovieClip (root),.nav.portfolio.addEventListener (MouseEvent.MOUSE_DOWN, down, false, 0, true);

    function Down(event:MouseEvent):void {}

    Re add listener for contact.swf and about.swf

    MovieClip (root).nav.info.addEventListener (MouseEvent.MOUSE_DOWN, Down1, false, 0, true);

    MovieClip (root).nav.about.addEventListener (MouseEvent.MOUSE_DOWN, Down3, false, 0, true);

    discharge of entry gallery.swf frame if users press portfolio in nav button

    var applicant: URLRequest = new URLRequest ("carouselLoader.swf");

    Charger = null;

    loader = new Loader();

    Loader.Name = "carousel."

    loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioError);

    function ioError(event:IOErrorEvent):void {}

    trace (Event);

    }

    try {}

    Loader.Load (requester);

    } catch (SecurityError: error) {}

    trace (Error);

    }

    addChild (loader);

    Loader.x = (stage.stageWidth - 739) *. 5;

    Loader.y = (stage.stageHeight - 500) *. 5;

    removeChild (getChildByName ("about"));

    removeChild (getChildByName ("carousel1"));

    delete eventlistner and prevents duplication of the gallery.swf

    MovieClip (root).nav.portfolio.removeEventListener (MouseEvent.MOUSE_DOWN, down);

    }

    INFORMATION BUTTON

    Add eventlistner so that info.swf can be loaded

    MovieClip (root).nav.info.addEventListener (MouseEvent.MOUSE_DOWN, Down1, false, 0, true);

    function Down1(event:MouseEvent):void {}

    This adds the EventListener for portfolio so that the end user can re-post if they wish.

    MovieClip (root),.nav.portfolio.addEventListener (MouseEvent.MOUSE_DOWN, down, false, 0, true);

    MovieClip (root).nav.about.addEventListener (MouseEvent.MOUSE_DOWN, Down3, false, 0, true);

    var applicant: URLRequest = new URLRequest ("contactLoader.swf");

    loader2 = null;

    loader2 = new Loader();

    loader2. Name = "contact".

    loader2.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioError);

    function ioError(event:IOErrorEvent):void {}

    trace (Event);

    }

    try {}

    loader2. Load (requester);

    } catch (SecurityError: error) {}

    trace (Error);

    }

    addChild (loader2);

    loader2.x = (stage.stageWidth - 658.65) *. 5;

    loader2.y = (stage.stageHeight - 551.45) *. 5;

    delete eventlistner and prevents duplication of the info.swf

    MovieClip (root).nav.info.removeEventListener (MouseEvent.MOUSE_DOWN, Down1);

    }

    ON THE BUTTON

    Add eventlistner so that info.swf can be loaded

    MovieClip (root).nav.about.addEventListener (MouseEvent.MOUSE_DOWN, Down3, false, 0, true);

    function Down3(event:MouseEvent):void {}

    This adds the EventListener for portfolio so that the end user can re-post if they wish.

    MovieClip (root),.nav.portfolio.addEventListener (MouseEvent.MOUSE_DOWN, down, false, 0, true);

    MovieClip (root).nav.info.addEventListener (MouseEvent.MOUSE_DOWN, Down1, false, 0, true);

    var applicant: URLRequest = new URLRequest ("aboutLoader.swf");

    loader3 = null;

    loader3 = new Loader();

    loader3. Name = "a connection"

    loader3.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioError);

    function ioError(event:IOErrorEvent):void {}

    trace (Event);

    }

    try {}

    loader3. Load (requester);

    } catch (SecurityError: error) {}

    trace (Error);

    }

    addChild (loader3);

    loader3.x = (stage.stageWidth - 482) *.5 - 260;

    loader3.y = (stage.stageHeight - 492) *.5 - 140;

    removeChild (getChildByName ("carousel"));

    removeChild (getChildByName ("carousel1"));

    delete eventlistner and prevents duplication of the info.swf

    MovieClip (root).nav.about.removeEventListener (MouseEvent.MOUSE_DOWN, Down3);

    }

    Stop();

    You call unload() on objects that you cancelled - where the error.

    You should do something like:

    {if (loader2)}

    loader2. Unload();

    }

    As for the null value passed into the function - null is a default value. In this way, you can call the low past nothing:

    Down()

    Or you can use it as a handler in which case it will be called by the Auditor:

    Down (mouseEventInstnace);

  • Too late to correct the episode URL?

    I have a problem with a podcast episode, I found out a week later the episode URL was wrong. I corrected the link in the podcast codes. But he is still unable to download podcast software. Is it too late to correct the podcast URL when the subscriber devices downloaded codes for a new podcast?

    Remove the episode with the wrong URL, and then do a new episode with the same descriptions and the correct URL. If the 'guid' tag is not taken from the URL, make sure that it is different from the one in the deleted episode.

  • Load a new SWF

    I'm doing something that I thought was fairly easy, but running in the challenges. I am currently developing a large number of films that will have their own SWF file. In a word like each film is played the user will give an option as to which party to pass. It will actually be played like a game.

    I want to be able to load the movie (SWF) chosen as the results of the mouse click event. However, I can't find the proper functioning or the object to do what I want. I tried navigateToURL but that opens a new browser window. I also tried the loader with AddChild, but simply, who charge the new swf file just above the original, so that I now see both on the stage.

    Is there another method I could use with the loader object so that the original is unloaded and loaded the new? Or is it possible to use navigateToURL so that it does not open a new browser? Or y at - it another way I should do this?

    Thanks in advance for any help.

    One of your desired solutions is possible.  To navigateToURL in the same window, you include a second argument in the function call: navigateToURL (req, "_self")

    Need you to remove the film in progress, the charge as a child separated, then you could remove it as a child (removeChild()) and add the new using the charger.

  • I get this message at the startup of firefox: cannot open fileUnable mab to load the address book file history.mab I can delete and move forward but can't continue until it is deleted? Any suggestions on solving this problem?

    When I open firefox I get the following message: could not open the file failed to load the address book file history.mab mab I can delete this message and continue to use firefox, but must remove it until I can move forward. Any suggestions to fix this?

    This has happened

    Each time Firefox opened

    Is 10 days ago

    Are you sure that your question is about Firefox and not on Thunderbird?
    Firefox does not use a file history.mab

    See http://kb.mozillazine.org/Profile_folder_-_Thunderbird
    ---
    You can ask questions about the program of Thunderbird on MozillaZine Thunderbird Support forum.
    This forum is better suited for questions about Thunderbird, this forum is for the support for Firefox.
    See http://forums.mozillazine.org/viewforum.php?f=39

  • Ways to load the map R2RML file

    I see that we can use the jena api to write a program to load the map r2rml file in the table of the scene. There are scripts or tools that do the same thing?

    Thank you.

    Hi HansC,

    The method prepareBulk in the class OracleBulkUpdatedHandler allows to load a file RDF (including the r2rml) into an intermediate table.

    7-12 in the document can give you assistance.

    http://docs.Oracle.com/CD/E16655_01/AppDev.121/e17895/sem_jena.htm#RDFRM472

    Thank you

    Zhe Wu

  • == CORRECTION of == how restore a registry saved without replacing the current One files

    ========================
    ==========FIXED==========

    ========================

    How can I restore A saved Registery without replacing the current One files

    --------------------------------------------------------------------------------------------

    Hi I have recently Updraged to Windows 8 then ERROR HIT and reinstalled 15 times

    And then downgraded back to Windows 7 I took all my files off .old, and then I

    need of my registry because all my games that I forgot the key to most of them his wondering just im

    because I just inport the right .reg to the registry, then it says cant traore explorer.exe and then restart I get

    0xc0000004F and theni reinstalling agen, agen, agen

    ================

    | what im saying here is. |

    ================

    can I insert a registery .reg without replacing the existing files to avoid fatel errors / crashes

    and I have manny stuff just to reinstall

    Hello

    1. where exactly did you go to the back-up and you try to restore?

    2. you try to restore the backup after re-installation of the operating system?

    This operation is not valid; When you reinstall the operating system, you will not be able to restore the registry backed up to the old operating system. And you can not do this without replacing the existing files.

    Import the registry can only undo changes that you have made.

    For more information, see the article:

    Back up the registry

    http://Windows.Microsoft.com/en-in/Windows7/back-up-the-registry

    Hope this information helps.

  • How can I determine the full path and name of the currently open file .ai?

    In Photoshop, right click the file name of the current open file shows an option 'Reveal in Explorer' so I know exactly where the file was opened from.

    In Lightroom, it is displayed in the metadata.

    New to illustrator, I looked in the options of the menu get charge can not see how to find this information.

    Would appreciate the help.

    agckent,

    Is it ALWAYS the case where the folder opened by "Save AS" is the file of the source code for the file that I am saving?

    I believe, with a reservation for the strange behaviour of the different OS versions: in the contrary case, the save option under would lead astray you.

    Edit: Hi Carlos.

  • When you open several image files in CC they float to the back, behind the current open files

    When I work on an image or images (not Docked (fasteners) in PS CC on iMac OS x 10.9 Maverick, if I open a new file, it opens in the front.  The newly open file open hidden/behind the currently open files, and yet if I got to the drop down window it clearly shows the newly opened file is selected and the file I'm working on, even if its behind all images previously opened and I cannot see it entirely.  Hard to explain but everyone has found this question?   Its weird and awkward when working at full capacity.

    No idea what happened?

    Can't say I've ever seen that happen before.

    Have you tried to reset the photoshop preferences?

    Press and hold the * + Cmd + Option keys when you start photoshop.

    Keep possession of the keys down until you get a dialog box asking if you want to delete the adobe photoshop settings file.

    Because you do, press Yes .

  • How can I stop the loading of a swf file that is still ongoing.

    I have three buttons on the stage (btn1, btn2, btn3)

    When I click on the first button swf starts loading

    While the swf file loads if I press the 2nd key

    the first swf won't stop loading and the two rulers begin to play

    But if the first swf is fully charged then everything workes very well.

    so please let me how can know I stop the loading of a file that is still ongoing.

    var _contentSWF:ContentSWF

    var _content

    Btn1.addEventListener (MouseEvent.CLICK, handleClick)

    btn2.addEventListener (MouseEvent.CLICK, handleClick)

    btn3.addEventListener (MouseEvent.CLICK, handleClick)

    function handleClick() {}

    {if(_content!=undefined)}

    _contentSWF.removeContent)

    removeChild (_contentSWF);

    _contentSWF = null;

    }

    _contentSWF = new ContentSWF()

    _content = addChild (contentSWF);

    _contentSWF.init (from path.swf)

    }

    ContentSWF.as

    private var _path:String

    private var swfLoader:Loader

    private var _content

    SerializableAttribute public class ContentSWF extends Sprite {}

    public void init (path) {}

    {if(_content!=null)}

    _content. Content.RemoveEventListener (Event.COMPLETE, completeHandler)

    _content.removeChild (myMc)

    _content = null

    }

    swfLoader = new Loader();

    _path = path

    swfLoader.load (new URLRequest (path));

    swfLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, swfLoaded);

    }

    public void removeContent() {}

    swfLoader.contentLoaderInfo.removeEventListener (Event.COMPLETE, swfLoaded);

    swfLoader.unloadAndStop)

    }

    private void swfLoaded(e:Event) {}

    _content = addChild (mymc)

    }

    }

    Use your charger's close() method.  but don't try and apply only if nothing is currently responsible or, I think, you will trigger an error.

  • Cannot load the local xml file from swf

    Hello!

    I have next construction

    (1) in ai3r app to load the SWF by HTMLLoader

    (2) I'm trying to load local xml file in swf. No error and no results.

    Application of AIR-> SWF-> load xml

    When I load xml file site, everything is ok, but when I load just from local file , nothing happens

    and when I load the local file with swf but everything is ok in the browser (firefox)

    for loading xml in a I use the following path: file:///folder_name/xml_file_name.xml

    Help me please!

    Did you write the SWF?  Some sovereign wealth funds will remove errors.

    Why use HTMLLoader?  Who can load it with different security rules.  Content browser often cannot access local content.

  • Loading of local swf files with actionscript on air for iOS

    I apologize if this seems like it has already been asked, but I'm not sure that having understood the answer, not on the Adobe site, or elsehwere.

    I am developing an app for iOS, targeting the last 3.9 SDK

    I have a main swf file that loads the local swf files. These local swf files have code actionscript in them. I use Flash Professional CS6.

    I publish the application successfully and everything's fine. When I start the app on the iPad, is the main swf and all is well. When I click on the button that loads the local SWF files, nothing happens. They are not loaded.

    It seems that this has been answered, but I'm losing my mind. I don't know what the problem is. I know that, in version 3.9 Air, it is now possible to load local SWF files are actionscript.

    Air for the Android version works perfectly with these local files loaded and unloaded like a charm.

    Any help would be greatly appreciated

    from the air, 3.6, you can load swf with actionscript and that run actionscript.  before 3.6 air that was not allowed (without additional work).

    but your charger must provide a loadercontext object that uses the current applicationdomain:

    var lc:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain,null);

    yourloader. Load (yourexternalswf.swf, LC);

  • external loading of several swf files

    I am trying to load several swf files in my flash project. I have it where it will charge but when I write the code for others it still load them. Here is my code

    Stop();

    Btn1.addEventListener (MouseEvent.Click, f);

    var loader_mc: Loader = new Loader();

    var urlRequest: URLRequest = new URLRequest("swf/graphics.swf");

    function f (e: Event) {}

    loader_mc. Load (urlRequest);

    addChild (loader_mc);

    }

    logos.addEventListener (MouseEvent.CLICK, g);

    var myloader_mc: Loader = new Loader();

    var myurlRequest: URLRequest = new URLRequest("swf/logos.swf");

    function g (e: Event) {}

    loader_mc. Load (urlRequest);

    addChild (loader_mc);

    }

    brochures.addEventListener (MouseEvent.CLICK, h);

    var myotherloader_mc: Loader = new Loader();

    ("var myotherurlRequest: URLRequest = new URLRequest("swf/BROCHURES/brochures.swf ");

    h function (e: Event) {}

    loader_mc. Load (urlRequest);

    addChild (loader_mc);

    }

    the logos.swf and brochures.swf code always loads the graphics.swf. How can I fix?

    While you seem to be creating new loaders, you do not use them.  The functions use the same lines of loading...

    loader_mc. Load (urlRequest);

    addChild (loader_mc);

  • Class to load an external .swf file

    Hello

    My flash application has many resources that will change all the time. In order to keep the user having to download my main .swf file over and over again and in order to maintain the size of the low main file, I want to put the resources into separate .swf files and load them dynamically from a url using a charger.

    Once downloaded, I would like to extract the classes that are in the file resources swf and use them in the main swf file. Can anyone share a code to do this? Note that I'm not only interested in using a symbol of the swf resource. I would use a class, with all its methods and everything, and my main swf does not contain the class definition. Does only the swf resource.

    Thank you!!

    It is a big question for flash programming.

    And when we know the answer to that, you are likely to use it on a daily basis as the programmers of high level of an agency.

    ApplicationDomain is your answer and the adobe documentation has a chapter on it.

    ApplicationDomain is where all of your classes will be loaded in and when you use a charger, you can target it with the laoderContext.

    AplicationDomain.currentDomain loads all classes in the main application and if your main application already has these classes, then the application uses the classes of parents

    New Application.Domain () specifies a separate repo of the classes that are loaded so that the classes in the main application will be confused by the classes in a loaded swf file. pertaining to the same names.

    This lock down communication between SWFs but uses the most recent child update classes when a child is loaded with the same class as the parents name.

    ApplicationDomain (currentDomain) new surround a new repo with the repo of parent of the class definitions.

  • Problem loading an external swf file implemented with AS3

    I use Adobe Flash CS3

    At first, I tried

    swf_mc.loadMovie ("location of the //swf file");

    He gave me
    Quote:
    WARNING: 1060: Migration issue: the loadMovie method is no longer supported.
    USE: var l = new Loader(); addChild (l); l.Load (new URLRequest ("your url"));.

Maybe you are looking for

  • Create a static copy of a table

    Hello I have problems reading of data in my VI. I am really new to this and was thrown into the deep end. I try to have a button to start a process of dialogue that has then the user can read in a csv file in a table. The problem is if I use just rea

  • How can I get my diagnosis Sevice policy running after being stoped in the Microsoft Management Console (MMC) console?

    Services in my MMC (Microsoft Management Console) has been tampered with and now services such as Diagnostic Policy Service left running. I tried everything I know to do and I'm still stuck. How can I get my Diagnostic Policy Service is running again

  • CMOS checksum error

    I have problem in my pc everytime I said bokt PC cmos checksum error and after loading windows with time to September 2012 and sometimes disappear the network icon and I can't access desktop but I can go through start enu and access thing when I righ

  • can install win8 pro on a computer virtual vmware win 7 pro

    If my system supports upgrading to win 8 pro but I want: can install windows 8 pro desktop OS in vmware vm (virtual machine from oracle) (my system), win 7 pro desktop PC 4-core 16 GB RAM i5? If Yes Windows 8 can run visual studio 2013 + or windows p

  • VPN and firewall box

    Hello I have a site to another using VTI VPN. I tried to configure my fw by sector to decline to ping on my WAN IP, but when I applied it, my VPN is down. Could someone advise me how to do? Here is my config: type of class-card inspect entire game in