return of swf loaded in main?

Hello! I have some SWF files I want to combine: I the main.swf that contains buttons, and I want each button to drive to an external swf. I already did it.

What I don't know is how to return to main.swf. I want all the external SWF has a button called "Return to menu" and go back to main.swf... Is this possible?

Thanks in advance for any help!

the main timeline of your loaded swf file:

unload_btn.addEventListener (MouseEvent.Click, unloadF);

function closeF(e:Event):void {}

this.dispatchEvent (new Event ("unloadE"));

}

///////////////////////////////////

in your main swf file:

var loadKOK:Loader = new Loader();

var urlKOK:URLRequest = new URLRequest ("KOK-with-grafics - FINAL .swf");

loadKOK.contentLoaderInfo.addEventListener (Event.COMPLETE, loadCompleteF);

var loadEurw:Loader = new Loader();

var urlEurw:URLRequest = new URLRequest ("corners-with-grafics - FINAL .swf");

loadEurw.contentLoaderInfo.addEventListener (Event.COMPLETE, loadCompleteF);

function loadCompleteF(e:Event):void {}

MovieClip (e.target.loader.content) .addEventListener ("unloadE", unloadF);

}

function unloadF(e:Event):void {}

Loader (e.currentTarget.parent) .unloadAndStop ();  in case of publication for fp10 + something else: Loader (e.currentTarget.parent) .unload ();

}

kok.addEventListener (MouseEvent.CLICK, simataK);

function simataK(event:MouseEvent):void

{

loadKOK.load (urlKOK);

addChild (loadKOK);

}

eurw.addEventListener (MouseEvent.CLICK, kermataE);

function kermataE(event:MouseEvent):void

{

loadEurw.load (urlEurw);

addChild (loadEurw);

}

Tags: Adobe Animate

Similar Questions

  • Control loaded swf on the main timeline

    Hello

    I'm working on loading external swf files for ios. I am able to load swf files and assembled visible or invisible in different settings. I have trouble controlling the swf files loaded on the main timeline. Specifically, I would like to have a button on the main timeline, that when you click on will move a swf loaded to frame 1.

    Here is a code that loads a swf file:

    var myLoader1:Loader;

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

    if(myLoader1 == null)

    {

    myLoader1 = new Loader();

    addChild (myLoader1);

    }

    myLoader1.load (new URLRequest("folder/file1.swf"), loaderContext1);

    myLoader1.visible = true;

    backbutton.addEventListener (MouseEvent.MOUSE_DOWN, backbutton1);

    function backbutton1(myEvent:MouseEvent):void {? myLoader1.gotoAndStop (1) ;}}  (this line does not work)

    (Once I load file1.swf, in the file1.swf I click a next button to move on to different periods.) My question is: hHow do I code the "backbutton" on the main timeline so that it causes the file1.swf to go to frame 1?)

    Thank you for your help.

    After loading is complete (and assuming that you load an as3 swf), you can use:

    MovieClip (myLoader1.content) .gotoAndStop (1);

  • Loading & unloading SWF external in main.swf

    Hello, please I have problem with my project. I'm happy for all the help I can get.

    so, my question is the following:

    I main.swf that standard load menubar.swfand footer.swf in menubar.swf are buttons: button1_btn, button2_btn, button3_btn.

    Main.swf is listening click on the button 1, 2 or 3. If for main.swf loads content1.swf, content2.swf or content3.swf

    for example: was clicked button1_btn which addedChild of content1.swf coming from the left to the center of the stage and if user click on button2_btn , I want only the content that is loaded (in this example is content1.swf), going away from the stage to the right and then content2.swf will come from the left side toward the center of the scene.

    I'm sorry for my English.

    Any help will be much appreciated.

    Thank you very much in advance.

    project1.jpg

    you always change the names of your buttons.

    When you finally on your button names, add them to a table and use:

    var buttonA:Array = [the button that matches content1Loader, the buttons corresponding to content2Loader, etc.];

    var prevOnStageLoader:Loader;

    for (var i: int = 0; i<>

    buttonA [i] .addEventListener (MouseEvent.CLICK, goContent);

    }

    function goContent(e:MouseEvent):void

    {

    {if (prevOnStageLoader)}

    TweenLite.to(prevOnStageLoader,1,{x:stage.stageWidth});)

    }

    prevOnStageLoader Loader = (this ["happy" + (1 + buttonA.indexOf (e.currentTarget)) + "Loader"]);

    addChild (prevOnStageLoader);

    prevOnStageLoader.x =-1250;

    TweenLite.to (prevOnStageLoader, 1, {x: 0, ease:Elastic.easeInOut});})

    }

  • Controls the main scenario for swf loaded.

    Hello

    I use a textfield for debug information.

    I am loading a swf in the main timeline and I show the status in the textfield of debugging.

    function swfLoaderCompleteHandler(event:Event)

    {

    Debug.Text += "Swf loaded.";

    }

    This works.

    But,

    I am loading a png file in the loaded swf file. I'm showing the State of the png file that I showed the status of the swf file.

    function pngLoaderCompleteHandler(event:Event)

    {

    MovieClip (parent). Debug.Text += "Png loaded.";

    }

    I can't control the main swf from inside the loaded swf file. Same Stop or a function call does not work.

    I need to add something when I load the swf file, it's a MovieClip or something?

    Here is also a fla. http://flashfocus.nl/Forum/attachment.php?attachmentid=9885 & d = 1282509233

    You are welcome.

    Please mark this thread as answered, if you can.

  • Several external swf within a main swf file loading.

    Hello

    I'll build a Web site that loads multiple SWF files in a main swf. I also want some sovereign wealth funds to unload when I click on the button located on it.

    could someone help me on this please.

    Currently, I am only able to load a swf with this code, can I somehow load more that just a default swf? You can see the code below:

    var swf:MovieClip;
    var loader: Loader = new Loader();

    var defaultSWF:URLRequest = new URLRequest("swf/gallery.swf");
    Loader.Load (defaultSWF);
    addChild (loader);

    to load more than 1 swf at any time, you have more than 1 charger.

  • Switching between external .swfs in the main

    Hello I have a project where I'm loading external .swfs in my main stage.  However at the end of my external .swfs I want to return to the first image of my main .swf.  I used this code MovieClip (root) .gotoAndPlay ("start"); but I get this error

    ArgumentError: Error #2109: frame the beginning label not found in scene 1 scene.

    and I understand why I get the error because the start of frame label is not in this file external flash, it is in the a main. However, I don't know the correct AS3 so that it works correctly. If anyone has any ideas, it would be greatly appreciated. I tried looking for a bit of code, but he could not find sorry!

    Thanks in advance,

    Aaron

    If you use the code on a timeline of movieclip (and this movieclip is on the main timeline of the external swf file), use:

    MovieClip (this.parent.parent.parent) .gotoAndPlay ("start");

    PS you can save this fla, and publish a swf from this fla file, but you can not 'test' this fla as a stand-alone.  you will test after loading in another swf.

  • SWF swf communication - swf loaded swf loading

    Hello
    I read the article by kglad SWF SWF communication when two SWF files uses actionscript 3.0 gratefully, but, probably because of my stubbornness, I have swf loaded at loading swf communication problems to work for me.

    Loading of swf (swf1.swf) as loaded swf (swf2.swf) by casting to a MovieClip loader.content worked well for me.

    I want the swf to call a function on the timeline of the swf file loading.  (Aside, I'm doubting it's possible, but I'm really very uneducated on this topic)

    I copied the article code in swf2.fla as below;

    Create a variable to refer to the main scenario for swf1

    var swf1Main_mc:MovieClip; This assumes that swf1 is a movieclip.

    Create your listener to ensure that loaded swf has been added to the display list and can get a

    the reference to the main timeline (which is always the main timeline of the SWF loading).

    this.addEventListener (Event.ADDED_TO_STAGE, initF);

    function initF(e:Event):void {}

    swf1Main_mc = MovieClip (this.root);

    }

    and add a simple button with an event listener for mouse to invoke a function (in swf2) for example

    function btnClicked(e:Event)

    {

    swf1Main_mc.showME ();

    }

    where showME() is a function in swf1.  for example

    function showME()

    {

    trace ("swf1 called swf2 showME");

    }

    All I get is a runtime error "TypeError: Error #1006: showME is not a function."  to swf2_fla::MainTimeline/btnClicked().

    I took out what little hair remains try different variations in the code then, in desperation, please someone can spot what I'm doing wrong or point me in the right direction?

    Thanks for your time,
    Bob

    A loaded swf file should not try to control its parent.  The child must only be send an event to the parent to take action.  In this way, the child is completely independent of the parent as well as to be able to publish on his own.  To load completion than the parent must assign an event listener to the child for this event, and the event handler function.

    Example:

    Add something to raise the event in the child:

    dispatchEvent (new Event ("eventTriggered")); (if problem dispatchEvent, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)

    In your SWF to loading/parent, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf file.

    triggered when external swf loading event handler
    function loaderCompleteHandler(event:Event) {}
    MovieClip (event.currentTarget.content) .addEventListener ("eventTriggered", eventHandler);
    }

    function eventHandler(event:Event):void {}
    trace ("event sent in loaded swf");
    }

  • did stop ' t back button array as3 swf loading

    I load a swf in the main file of a picture and its works well.

    and I need to add a button previous and next to load other SWFs.

    I then add and the previous and next button buttons works well, it stops after loading swf last stop followed and all.

    but the previous buttons doesn't work very well. It's keep clickable and keep tracing values less and retreating.

    any help will be honorable

    Thank you

    my code is here

    I is not written my script to load because I only need to know the previous button

    Thank you

    var myMovies:Array = ["Panel 1.swf", "Panel 2.swf", "Panel 3.swf", "Panel 4.swf", "Panel 5.swf", "Panel 6.swf", "Panel 7.swf", "8.swf sign"];

    var int index = 0;

    var numberOfPages:Number = 1;

    \\

    \\

    \\

    \\


    panel_control. Text = '01 '.
    next_mc.addEventListener (MouseEvent.CLICK, next_movieclip);
    pre_mc.addEventListener (MouseEvent.CLICK, privious_movieclip);

    function next_movieclip(e:MouseEvent)
    {

    If (numberOfPages < myMovies.length - 0) {}
    numberOfPages ++;
    panel_control. Text = '0' + numberOfPages;
    index = (index + 1)%(myMovies.length);

    loader.unloadAndStop ();
    trace (numberOfPages);

    loadSWF();

    }


    }
    function privious_movieclip(e:MouseEvent)
    {
    If (numberOfPages < myMovies.length + 8) {}
    -numberOfPages;
    panel_control. Text = '0' + numberOfPages;
    index = (index - 1)%(myMovies.length);

    loader.unloadAndStop ();
    trace (numberOfPages);

    loadSWF();

    }
    }

    Chances are that if you go back the next line should be changed to

    If (numberOfPages< mymovies.length="" +="">

    TO

    If (numberOfPages > 1) {}

  • How to control the video swf loaded in the loading component?

    I have an external swf file loaded into the loading component. The external swf loaded into the component loading stops at departure. I want to play by a button outside the loading component that is located in the main swf movie. CAN SOMEONE HELP ME CONTROL THE VIDEO SWF LOADED INTO THE COMPONENT OF LOADING EXTERNAL?

    You can target the SWF via the content property of the UILoader.  If the name of the instance the UILoader is ldr...

    MovieClip (ldr.content) .play ();

  • Swf loader help

    Hello all, I use Flash CS4 with AS3.


    I have a problem with the preloader site. When I simulate the load it is 'invisible' for awhile and then appear from loading of ~ 24-27% or perhaps ~ 55%
    To resolve this problem some people suggested to create a loader.swf (where you want to preload) and the site.swf: when the loader.swf have loaded the site.swf then it appear.


    Well, I tried this with the following code:

    var file:Loader=new Loader();
    var: path string.
    load.bar.scaleX = 0;

    run the preLoader (event: Event): void {}
    If (file.contentLoaderInfo.bytesTotal! = 0)
    {
    load.bar.scaleX = (file.contentLoaderInfo.bytesLoaded / file.contentLoaderInfo.bytesTotal);
    Load.txt_perc. Text = String (Math.round ((file.contentLoaderInfo.bytesLoaded/file.contentLoad erInfo.bytesTotal)*100))+"%";))
    }
    trace (file.contentLoaderInfo.bytesLoaded);
    }

    function stopLoader (event: Event): void {}
    trace ("Downloaded");
    file.removeEventListener (Event.ENTER_FRAME, preLoader);
    load.bar.scaleX = 0;
    Load.txt_perc. Text ="";
    }

    file.contentLoaderInfo.addEventListener (Event.COMPLETE, stopLoader);

    function loadMovie (): void {}
    load.bar.scaleX = 0;
    var swf:URLRequest = new URLRequest (path);
    leader. Load (SWF);
    file.addEventListener (Event.ENTER_FRAME, preLoader);
    stage.addChild (file);
    }

    function path1(e:Event):void {}
    path = "example.swf";
    loadMovie();
    }

    stage.addEventListener (Event.ENTER_FRAME, path1);


    But he returns this error:

    #2044 error: Unhandled IOErrorEvent:. Text = #2036 Error: incomplete loading.


    Someone told me that this error is due to the impossibility to find the URL of the swf file, but this is false since the swf file is finished.

    If I look at the load simulation I see multiple copies of the swf file are "loaded", but nobody is 100%.

    However, I said "responsible" because if I put a trace (file.contentLoaderInfo.bytesLoaded); I see a 0 permanent.


    Please help me I'm going crazy!

    where did,

    removeChild (file);

    come from?   which removes your swf loaded from the display list.  remove this line of code.

  • Problems loading the SWF in a swf loader

    Hey,.

    I created a shifted image reel that has buttons and so when you click on one it slides through to the other...

    This set works very well in the swf file. However when I pull in through my swf in my main page loader, movie clip buttons will not work.

    He does not even recognize them as anythink you can click.

    The buttons have script on them, because it works through the instant name and then the script is on main parchment and works via the X values and Y, he tells where to go. If you make me?

    Ive tried alsorts on this point, as in turning them into buttons, however the script is on the button, then it's not said not do anythink.

    any ideas how I can sort this out?

    have a time-out to come United and im not the best at flash.

    If you use as2, try adding the following to the main timeline of the frame 1 in the surface layer of your loaded swf (that has the buttons):

    This ._lockroot = true;

  • (MX04) Pause a swf loaded with sound objects

    Hello

    I'm working on a presentation PowerPoint-esque where a user observes and listens to a swf loaded in the main sequence, click the button following (who unload the SWF, advances to the next section and load the next swf file), and the following watches. Make lather, rinse, repeat. Some articles are quite long, and I want to give the user the opportunity to take a break and play by click button.

    I know how to stop and start the MC container, but this does not prevent the sound object (and embedded CSM). I know how to make a break and start a sound object using the name of the instance of the object. Is there a way to pause the main story and keep the general enough so that any object sound stops when the user clicks on?

    Any help is most appreciated! MX04 and AS2.0.

    Thank you!

    you will need to list them all, or scroll through all the likely suspects with a loop (obj in mc).

  • error message "cannot load the main class.

    I ran windows update yesterday and installed the recommended updates, restarted my laptop today the error message "Unable to load the main class" appears in a box and I couldn't do anything until I had closed this box, after the loading of firefox it displays a message not responding, then a bar indicating that plugin adobe did not start successfully so I clicked to reload page Then, I rebooted my laptop to see if this solves the problem, but the same error message appeared and firefox have responded in the same way, someone has an idea how I can fix this problem?  I run anti-virus software and malware from comodo and my OS is windows vista 32. I also downloaded an update for adobe flash yesterday but the problem has not produced until after I had done the updates of windows.  Thank you

    Hello Fiona,

    Thank you for your response.

    You are facing this problem might because of Java program on your computer.

    I suggest you perform the clean boot and check the status of the issue, which will help you identify the problem.

    Keep the computer in a clean boot and check the status of the issue. If everything works well after a clean boot, you can deduce that some third-party services are at the origin of the problem. Continue with the remaining steps to pin-point on the third party service. After find you the program that is causing the problem, you will have to perhaps to update or install a newer version of the program, if you rarely use that you should consider uninstalling the software.

    How to perform a clean boot for a problem in Windows Vista, Windows 7 or Windows 8.

    http://support.Microsoft.com/kb/929135

    Note: please go through the section:How to reset the computer to start as usual after a clean boot troubleshooting section of Kb to start the computer to a normal startup after you fix the problem.

    Hope his helps.

  • How to effectively remove a SWF loaded from the scene?

    I can't understand a correct coding to remove a SWF loded in the scene.

    Here is my set upwards.

    I have a layout that is segmented in section labeled. In the section titled 'products', I have a scheme consisting of images of products acting as buttons that bring a user in another section labeled "prdctsPopUps."

    In the "prdctsPopUps" section, I placed an instance of LoaderMax placed in a container of mc. Place LoaderMax in a container of mc automatically resolved a problem of clearing loaded SWFs from the stadium when I go back to the section "products".

    I specified the variable in the "products" section with the following set up:

    var sourceVar_ProductsPopUps:String;

    function onClickSumix1PopUp(event:MouseEvent):void {}

    sourceVar_ProductsPopUps = "prdcts_popups/sumix1 - popup_tl.swf ';

    gotoAndPlay ("prdctsPopUps");

    }

    So each button has its own "... swf ' URL and they all open very well and I can go back to the topic 'produced' without any problem.

    However inside the swf (that charge by LoaderMax which is placed in a mc) there are other buttons that lead a user to the section labeled "xyz". That works as well. It opens as he's supposed to be and without any previously loaded "... swf ' on the stage.

    In the section labeled "xyz", there is a limited set of buttons with the heading 'products' that must raise a user to the same game in the labeled 'prdctsPopUps' section and open a correspondent "... swf»

    However only the last opened "... swf" will appear in this section. Actually the only one that has been opened at the origin of the "prdctsPopUps" section, not who was supposed to be opened from the section "xyz".

    I do not understand why it would work a labeled section and not the other. I can't know which section what function/code should be placed.

    Here is the set up through a button in the section "xyz" supposed to bring a user to the same section of "prdctsPopUps" but to load another '... swf»

    var sourceVar_ProductsPopUps_fromXYZ:String;

    function onClick_floralytePopUp_fromXYZ(event:MouseEvent): void {}

    sourceVar_ProductsPopUps_fromXYZ = "prdcts_popups/floralyte - popup_tl.swf";

    gotoAndPlay ("prdctsPopUps");

    }

    Here's the code in place for the LoaderMax of the section "prdctsPopUps":

    var loaderProductPopUps:SWFLoader = new SWFLoader (sourceVar_ProductsPopUps,

    {

    estimatedBytes:5000,

    container: holderMovieClip,.

    onProgress:progressHandler,

    onComplete:completeHandler,

    centerRegistration:true,

    Alpha: 1,

    ScaleMode (ScaleMode): 'none',

    Width: 540,

    height: 730,.

    harvest: true,

    autoPlay:false

    });

    function progressHandler(event:LoaderEvent):void {}

    progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;

    }

    function completeHandler(event:LoaderEvent):void {}

    var loadedImage:ContentDisplay = event.target.content;

    TweenMax.to (progressBarPopUp_mc, 1.5, {alpha: 0, scaleX:0.25, scaleY: 0.25});

    }

    loaderProductPopUps.load ();

    Is there something that must be imported, or specific function must be specified in a specific titled section?

    in fact, I think that you will need to use something like:

    var loaderProductPopUps:SWFLoader;

    If ((loaderProductPopUps) {})

    {if (loaderProductPopUps.Content))}

    loaderProductPopUps.unload ();

    }

    }

    loaderProductPopUps = new SWFLoader (sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load several SWF files from the page produced.

    {

    estimatedBytes:5000,

    container: holderMov ieClip, / / convinient and easy to manage cases of placing the LoaderMax one mc empty (holderMovieClip)

    If this is not the case, will work as well. Then the container line: holderMovieClip, must be replaced by container: cela,.

    can be any size, cannot be resized as it distorts the content

    Manager onProgress:progress,

    onComplete: complete the Manager.

    centerRegistration: true,

    x:-260, y:-320, //no need for that is if used: centerRegistration:true,.

    Alpha: 1,

    ScaleMode (ScaleMode): 'none',

    scaleX:0, scaleY: 0,

    vAlign: "high."

    Width: 540,

    height: 730, / / scale proportionately but I need to cut the edges

    harvest: true,

    autoPlay:false

    });

    function progressHandler(event:LoaderEvent):void {}

    progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;

    }

    function completeHandler(event:LoaderEvent):void {}

    var loadedImage:ContentDisplay = event.target.content;

    TweenMax.to (loadedImage, 1.5, {alpha: 1, scaleX:1, scaleY: 1}); only need this line if the corresponding values are changed in Builder SWF loader

    TweenMax.to (progressBarPopUp_mc, 1.5, {alpha: 0, scaleX:0.25, scaleY: 0.25});

    }

    loaderProductPopUps.load ();

  • rinsing of the SWF loaded phase target mc?

    Hi, I'm using buttons to send the playhead to executives in which sovereign wealth funds are then loaded into an empty movieclip called "stage_target_mc"... .how I can then flush out the previously loaded swf then only a newly loaded swf displayed in "stage_target_mc"?  For example, after you click on the button 'about' swf 'about' load... then the "concepts" click the "concepts" swf loads - but the previously 'about' loaded swf plays again... I wish I could rinse the swf 'about' so only "concepts" are display, in this example.  Thank you!

    code associated with buttons that are used to send the playhead to frame "concepts" or "about":

    about_btn.addEventListener (MouseEvent.CLICK, displayAbout);

    function displayAbout(e:MouseEvent):void {}

    root.gotoAndStop ("about");

    }

    concepts_btn.addEventListener (MouseEvent.CLICK, displayConcepts);

    function displayConcepts(e:MouseEvent):void {}

    root.gotoAndStop ("concepts");

    }

    code on frame called "concepts":

    stage_target_loader. Load (new URLRequest("swfs/stages/concepts.swf"));

    MovieClip (root).stage_target_mc.addChild (stage_target_loader);

    code on frame called 'a way':

    stage_target_loader. Load (new URLRequest("swfs/stages/about.swf"));

    MovieClip (root).stage_target_mc.addChild (stage_target_loader);

    Before loading, try to use the method of the Loader class unloadAndStop() If you are using a version of Flash newr

Maybe you are looking for

  • Firefox is stuck on the subject: Homepage homepage and shows not all other pages.

    I just upgraded to the new version of firefox. Now, I can't at all pages except page and the troubleshooting page. Looking at the page that looks like my graphics driver might not be updated with the new version of troubleshooting. I'll paste the inf

  • Satellite A300 will not get before the start screen

    Hi all had a problem with a laptop A300 about 2 to 2.5 years old. I just installed windows 7 prof and it worked fine for about 3 days and then all of a sudden it blocked start. He gets to the toshiba start screen and then reboots. He doesn't even try

  • Why can't read Compact Fieldpoint more tension?

    Hi, im using PSC 2120 with 3 cfp-aio-610. For some reason any, it isImpossible to read more than one my circuit voltage to 2 separatepoints (See Diagram). If I try to join several analog input, I haveDownload high-voltage current smaller. Ive had the

  • How can I disable wireless on Photosmart B110a?

    I had a lot of intermittent problems with the Wi - Fi on my Photosmart B110a, but the USB connection is perfectly OK. I had a few printintouts on my printer from a neiighbour, those unwanted. Please tell us how to completely disable my wireless conne

  • Firewall rules

    I have a router ea6500 and I was wondering if there is a way to change the built-in firewall? I want to block access to all websites except for Netflix from a device.