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

Tags: Adobe Animate

Similar Questions

  • Load external .swf and button top

    Hello!

    I have a problem here! I want to load a file (created from inDesign) external .swf and then on load a button at home (a small image that I created with the name "home_btn"), which refers to my home page to say frame 90

    Any help it would be greatly appreciated,

    Frank

    I founded by myself, I just create a clip of this button and this is my code in case anyone has the same problem...

    import flash.events.MouseEvent;

    import flash.display.Loader;

    import flash.net.URLRequest;

    var loader: Loader = new Loader();

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

    addChild (loader);

    addChild (home_front);

    home_front.addEventListener (MouseEvent.Click, playClickedExit)

    Stop();

    function playClickedExit(event:MouseEvent):void

    {

    removeChild (loader);

    gotoAndPlay (90);

    }

  • Cannot load external swf

    Hello

    Im trying to load an external swf into my project, the code is simply:

    var loader: Loader = new Loader;

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

    I get an error that says the following when it debug.

    TypeError: Error #1009: cannot access a property or method of a null object reference...
    at gallery_fla::MainTimeline/frame1()
    Cannot view the source code at this location

    I have done this same thing before but never got this error message, I tried to load a swf file that is old and it worked fine.

    IM totally lost here, any help is very appreciated.

    Because the error is pointing Gallery fla, it can be that the problem lies in the SWF Gallery.  What you need to do, is to enter your Setings publish and select the option to enable debugging.  This will help by joining the line number of the code problemed.  You think it's a number of top line to no matter what you have in the file doing the oading that would probably make most issues that's the file you load.

    Just in case you have copied and pasted, the following line should have thrown an error of syntax by lack a parenthesis...

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

  • 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 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);

  • Load external swf and stopping on the 1st frame.

    Hello everyone

    I use following code to display an external swf file on the iPad.

    var request: URLRequest = new URLRequest ("http://< server ip > / test.swf");

    loader = new Loader();

    Loader.Load (request);

    The file load passes through each image and closes the application.

    Y at - it will be a way to stop the 1st frame once the file is loaded and move between the ribs to the?

    Thank you

    If you listen to when the charger is finished, you can stop the swf file:

    var mc:MovieClip;

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

    function swfloaded(e:Event) {}

    MC = e.target.content as MovieClip;

    MC. Stop();

    }

    Now you can do what you like in this clip. As:

    mc.gotoAndStop ('some ' label');

    or:

    mc.gotoAndStop (10);

  • AS3 for unloading external swf

    I know this is a well covered topic but after spending two days trying different

    things that I have to admit that I'm perplexed.

    Got two swf I want connected to another to act as a brochure portfolio gallery - parent is called child 'portfolio' is 'portfolio_flash_2 '.

    Both have animation at the beginning with the child having a "skip" button (because its animation is odd to 20 seconds long). After the animation the thumbnails displayed for larger images.

    On the two SWFs, the buttons, I use to load (parent to child) and unload (child to parent) appear after the animation - I can get the dependant child of the mother, but problems knowing what good code to use the button "page2_btn" of the child to be returned to the parent company.

    The code that I use for the parent button is called "cloud."

    var myLoader:Loader = new Loader ();

    cloud.addEventListener (MouseEvent.CLICK, portfolio);

    function portfolio(myevent:MouseEvent):void {}

    var myURL:URL request = new URLRequest ("portfolio_flash_page2.swf"

    myLoader.load (myURL);

    addChild (myLoader);

    }

    I also tried to add to the above with any code on the button of the child swf file.

    myLoader.addEventListener (MouseEvent.CLICK, unloadcontent);

    function unloadcontent(myevent:MouseEvent):void {}

    removerChild (myLoader);

    }

    but after the animation (when the code in the scenario is written) just by clicking anywhere on the child swf (not only the button) is the parent appear.

    I also tried (twice when the last code above was present and deleted) add this code to the 'page2_btn' I made for the page of the child;

    page2_btn.addEventListener (MouseEvent.CLICK, removeSWF);

    function removeSWF(e:MouseEvent):void {}

    removeChild (myLoader1);

    myLoader1 = null;

    }

    But that was just the button on the child does not and larger images play as if it was a movie.

    Most of this code, I had class in a book and discussion here, have you tried countless others of other google searches but when your stupid your stupid. So if any body could help a learner I would be very grateful.

    Paul

    Use the trace() function to find where the code is a failure.

  • Garbage Collection, external swf and XML

    I did tons of research on the AS3 garbage collection. I have a decent knowledge of it, but I CAN'T find any info about the deletion of xml data. The worst thing is, I have no control over the version of the file (AS2 or AS3) swf file I'm loading. Unfortunately, I'm loading AS2 swf (with an outside provider that will not show you any code) in a film of AS3. When I run garbage collection, the data from the xml file / is not deleted and I can't understand how get rid of it. The problem is, once a file is loaded which calls an xml file, no other files cannot load an xml.

    If anyone knows how to clear the XML, please fill me in.

    Thank you!

    Heather

    The code is:

    **************UPDATE*************************************

    Hey people,

    Good news. I just read an announcement of Grant Skinner regarding what my problems were.

    For more details, go to his blog @ http://www.gskinner.com/blog/archives/2008/07/unloadandstop_i.html

    Be sure to read the update as well.

    See you soon,.

    Heather

  • Why Flash CC cannot compress a SWF and Flash CS 5.5?

    Did anyone here knows why this happened?

    I have a FLA where I had to export a SWF file not exceeding 40 KB. Without changing the settings, the SWF exported about 63 KB. Then I opened the FLA in Flash CC and went to publication settings. Tried to change the quality of JPG, click on compress movie (Deflate), removed the check mark include hidden layers. If that wasn't enough, I tried to compress each image in the library by accessing the properties for each. After playing with the image quality for awhile, the smallest, I could compress the file SWF has been 58kbs.

    But then... I tried to open the same FLA in Flash CS5.5. Use the default publication settings. Has not changed the file either. And the exported SWF was 35 k! More image quality was a heck of a lot better than the 58kbs SWF exported out of Flash CC.

    No idea why? CC adds nothing to the file that does not have 5.5? I just find it strange and annoying to work with when the requirements of size of file for flash banners are always only 40kbs...

    Thanks for any idea!

    The version of Flash Player you target probably has a lot to do with it. New versions of the Flash Player have new capabilities, so additional code requires more space.

    Be sure to export that you target the same version of Flash Player in both applications. Also do not include the XMP data unless you need it.

  • external SWF unload &amp; stop works not

    I am trying to load and unload external swf containing audio & video. Problem is that when I unload the SWFs, the noise continues and I am getting overlapping sound. This is the code I use:

    var swf_loader:Loader = new Loader();

    unload the previous swf

    swf_loader.unloadAndStop ();

    removeChild (swf_loader);

    load new swf

    swf_loader.load (new URLRequest ("welcome.swf"));

    swf_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, finishLoading);

    function finishLoading(e:Event):void {}

    {if (swf_loader.content)}

    addChildAt (swf_loader, 0);

    }

    swf_loader.y = 75;

    swf_loader.x = 0;

    }

    unloadAndStop() is only supported by fp10 + no fp9.

    you use flash cs5.5?

  • AS3 external swf close self

    Hello

    After looking through the forums online and video tutorials...

    I am always facing errors of loading an external swf into my main swf (full step width).

    In my main.swf... i have several scenes.

    On one of these scenes, I have an external SWF that loads my main.swf step size.

    Which works very well...

    BUT

    I now want to close the external swf on a button (in my external swf) and to return to one of my scenes in my hand. SWF

    I read many forums that talk about dispatchEvent

    I tried these methods and I am still facing errors.

    I want just one button on my external.swf that is farm/unloads/deletes itself... so that the user can continue by HAND. SWF after that they played OUTSIDE. SWF.

    in actionscript 2, it was a breeze.

    in as3, it's a useless pain in my rectum

    Sorry if I've missed a lot

    any help would be appreciated

    jayquery

    Try to change the code of loader main file for more like the following (blue nine):

    var defaultSWF:URLRequest = new URLRequest ("gametestG.swf");

    var loader: Loader = new Loader();
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, loaderCompleteHandler);
    Loader.Load (defaultSWF);

    function loaderCompleteHandler(evt:Event):void {}
    MovieClip (evt.target.content) .addEventListener ("closeChild", onChildClose);
    addChild (loader);
    }

    function onChildClose(event:Event):void {}
    loader.unloadAndStop ();
    removeChild (loader);
    }

  • AS3: using external swf buttons

    Hello

    I'm doing a Web site in Adobe Flash that imports an external swf file s navigation buttons.

    The problem is how my FLA file main know that the navigation buttons users urged, because the buttons and eventListeners are in the external swf file.

    With the other Word: can I make my external swf file returns a number to my website FLA file, to determine which button was pressed? If so, how?

    Here are the different has your two sovereigns can communicate:

    http://kb2.Adobe.com/community/publishing/918/cpsid_91887.html

  • Loading multiple SWFs and saving them (code works is not under Chrome and Firefox 23)

    Hey guys,.

    Anyone has an idea why this suddenly does not work? (It works under internet explore but not firefox and chrome)

    The code below is placed on my main swf to preload all my external swf and store them for not having to wait too long to get there.

    Thank you guys.

    I took the code by btw: http://www.beautifycode.com/the-finer-art-of-loading-2-handling-multiple-swfs#snippet

    I am running flash player 11.8.800.94... He used to work under Firefox and Chrome


    var _swfLoader:Loader;

    var _swfRequest:URLRequest;



    var _swfPathArr:Array = new Array)

    '00.swf', '01.swf', '02.swf'

    );



    var _swfClipsArr:Array = new Array();

    var _swfTempClip:MovieClip;

    var _loadedSWFs:int;



    startLoading (_swfPathArr);



    function startLoading(pathArr:Array):void {}

    _swfLoader = new Loader();

    _swfRequest = new URLRequest();



    loadSWF(pathArr[1]);

    };



    function loadSWF(path:String):void {}

    setupListeners (_swfLoader.contentLoaderInfo);



    _swfRequest.URL = path;

    _swfLoader.load (_swfRequest);

    };



    function setupListeners(dispatcher:IEventDispatcher):void {}

    dispatcher.addEventListener (Event.COMPLETE, onSwfComplete);

    };



    function onSwfComplete(event:Event):void {}

    event.target.removeEventListener (Event.COMPLETE, onSwfComplete);



    _swfTempClip = event.target.content;

    _swfTempClip.customID = _loadedSWFs;

    _swfClipsArr.push (_swfTempClip);



    If (_loadedSWFs < _swfPathArr.length - 1) {}

    _loadedSWFs ++;

    loadSWF (_swfPathArr [_loadedSWFs]);

    } else {}



    //

    }

    };

    I have no problem with ff and I don't see any problem in chrome.

    You probably have a typo in if:

    loadSWF(pathArr[1]);

    should be

    loadSWF(pathArr[0]);

  • MainTimelime ContextMenuItem MENU_ITEM_SELECT event not sent the magazine containing the external SWF

    1. custom context menu applied to MainTimeline
    2. using a Loader() to load an external SWF and have it added to its container display string
    3. Make a right-click SWF loaded menu contextual custom appears, but the MENU_ITEM_SELECT events are not dispatched when the user clicks on the items
    4. click right on elsewhere in the parent SWF works great, even on deep nested objects (not externally loaded)
    5. Remove loaded SWF of the display string and right clicking in its location very good

    I managed to find a hack . On the charger () parent display object, I put:

    .mouseEnabled = false;

  • External SWF

    Hello, everyone!

    I have some problems using external swf.

    In fact, loading swf and access to its classes have no problem. Let's call a SWF that loads another - 'HAND'.

    public var GAME_LIB:LoaderContext;
    private function LOAD_GAME_LIBRARY()
    {
         var GAME_LIB_LOADER:Loader = new Loader();  
         GAME_LIB = new LoaderContext();  
    
         var request:URLRequest = new URLRequest("EXTERNAL.swf");  
         GAME_LIB_LOADER.contentLoaderInfo.addEventListener(Event.COMPLETE, GAME_LIBRARY_LOADING_COMPLETED);  
         GAME_LIB_LOADER.load(request, GAME_LIB);  
    }
    
    private function GAME_LIBRARY_LOADING_COMPLETED(e:Event):void
    {  
         var tmp_class:Class = GAME_LIB.applicationDomain.getDefinition("ZZZ") as Class;
         var myMC:MovieClip = new tmp_class() as MovieClip;
    } 
    

    The question is:

    responsible for access to the classes of the swf 'HAND' to 'EXTERNAL.swf '? I want access to the classes of the 'HAND' loading code "EXTERNAL.swf". "» So ' HAND ' a sth in his library, I would like to call "new SMTH()" in the code of "EXTERNAL.swf" and get that smth from this GREAT library

    Sorry for my English.

    The problem is:

    This new SMTH, called EXTERNAL.swf, should be added as child in hm... HAND root, not EXTERNAL

    I have found no easier way but creating public var externally and passing HAND stage.root to it.

    externally:

    public var GAME_ROOT:*;
    public function ADD_SMTH()
    {
         var tmp_class:Class = getDefinitionByName("ZZZ") as Class;
         GAME_ROOT.addChild(new tmp_class() as MovieClip);
    }
    

    in HAND:

    public var GAME_LIB:*;
    private function GAME_LIBRARY_LOADING_COMPLETED(e:Event):void
    }
         GAME_LIB = e.currentTarget.content;
         GAME_LIB.GAME_ROOT = stage.root;
         GAME_LIB.ADD_SMTH();
    }
    

    So, this is how to make new SMTH() from the OUTSIDE.

    Main SWF will load external swf, then external code in swf will add class to hand library at the root of the hand.

    Problem solved. Thank you, kglad

Maybe you are looking for

  • S100 and Microsoft RIS

    Did someone use RIS to deploy XP on a S100? Our default image does not recognize the SCSI RAID hard drive is connected to the - so can not image for her. I can't seem to find any inregards to this information on the web - ay ideas would be appreciate

  • I have a HP model # p7-1423w trying to put windows 7 on need help

    My version of windows 8 is dead so I had to reformat the hard drive to windows 7 64-bit on it, but now I have no drivers for what it is can someone help? my model # is p7-1423w CV.

  • Store (arduino) analog data in a 2D matrix

    Hello I need to store analog data in a 2D array. I can't use 2 for loops, because I get complete data at the end of two loops. So I need to use 1 loop for and store my analog data in an 8 x 8 matrix in this loop. (A for loop so I can store data at ru

  • Change of the computer and re-activitation

    I bought window Visa a few years back.  Is the computer on which it was run down and I rebooted it on my new computer that I use at the moment. ;  Now I wonder activate the window while I use only a single window with this system. What should I do?

  • 0 x 80240017 error when installing visual c ++

    Hi, I have a problem with visual c ++. When I try to install it at the end, I got an error code 0 x 80240017 I windows 7