How to load several SWF my main flash file?

I use the following code

In stock for 1 frame:

( var myrequest:URLRequest =new URLRequest ()'A.swf'();
( var myloader:Loader =new Loader()();
myLoader. load () myrequest ();

img1. addEventListener () MouseEvent. ( CLICK, button click();

( function button click ()event: MouseEvent ():void{ }
Stadium. addChild () myloader ();
}

img1.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);

function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void

{

gotoAndStop (13).

}

In action to frame 13: (img2 is another button)

img2.addEventListener (MouseEvent.CLICK, unloadFunction);

function unloadFunction(event:Event):void {}

stage.removeChild (myloader);

}

This code works perfectly fine. My only problem is how to make several swf loaded. When I tried to copy and paste the same code for the another swf, but the following errors appear. I'm sure theres a way to have several sovereign wealth funds (btw the multiple SWFS will be bound to different frames).

Scene 1, Layer 'PAGES!', frame 2, line 7 1021: duplicate function definition.

Scene 1, Layer 'PAGES!', frame 2, line 2 1151: there is a conflict with the myloader definition in the internal namespace.

Scene 1, Layer 'PAGES!', frame 2, line 1 1151: there is a conflict with myrequest definition in the internal namespace.

Can anyone help me please with this. Thank you

I have to get a new keyboard one day... it ignores things...  That sentence was supposed to have read "You can not set the same variable name or function more than once in a file" If you don't know not what that means, read it a few times because it's as simple as possible.

In regards to the other code, try and see what you get... No need to wait for me to try something yourself and see.

Tags: Adobe Animate

Similar Questions

  • Help! How to load several SWF files by using the following code?

    In stock for 1 frame:

    ( var myrequest:URLRequest =new URLRequest ()'A.swf'();
    ( var myloader:Loader =new Loader()();
    myLoader. load () myrequest ();

    img1. addEventListener () MouseEvent. ( CLICK, button click();

    ( function button click ()event: MouseEvent ():void{ }
    Stadium. addChild () myloader ();
    }

    img1.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);

    function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void

    {

    gotoAndStop (13).

    }

    In action to frame 13: (img2 is another button)

    img2.addEventListener (MouseEvent.CLICK, unloadFunction);

    function unloadFunction(event:Event):void {}

    stage.removeChild (myloader);

    }

    you want to load another swf (for example, B.swf) when you are in frame 13 and img2 is clicked?  If so, and you do not want A.swf continue to play, use:

    In action to frame 13: (img2 is another button)

    img2.addEventListener (MouseEvent.CLICK, loadF2);

    function loadF2(event:Event):void {}

    myLoader.Load (new URLRequest ("B.swf"));

    }

  • adding smaller SWFs in a main flash file

    First of all I am new to Flash.
    I created a main flash file that matter smaller SWFs (via loadmovie actionscript). All in the same folder.
    So when I download the main swf as well as the smaller sovereigns in one folder, it does not appear there a HDMI.

    Is there anything else I need to do.
    Help, please

    the way to loadMovie should be compared to your HDMI but not main swf.

  • How to load several HTML5 canvas on the same page (the right way)

    Hello

    I struggled to load several animations of canvas on the same page. At the beginning, I thought that export movies with different namespaces and reload the libraries in a sequential workflow might work, but it doesn't. It still load just the last loaded movie. More info here: coding challenge: what am I doing wrong?

    Here's a sample of what I'm doing:

    1: publish two flash animations with namespaces customized to "lib" defined in the "publication settings": "libFirst" and "libSecond".

    2nd: Edit the canvas tags in the HTML page. One called "firstCanvas" and another one called "secondCanvas".

    3rd: change the javascript like this:

            <script>
                // change the default namespace for the CreateJS libraries:
                var createjsFirst = createjsFirst||{};
                var createjs = createjsFirst;
            </script>
            <script src="//code.createjs.com/easeljs-0.7.1.min.js"></script>
            <script src="//code.createjs.com/tweenjs-0.5.1.min.js"></script>
            <script src="//code.createjs.com/movieclip-0.7.1.min.js"></script>
            <script src="{{assets}}/js/first.js"></script>
            <script>
                function initFirstAnimation() {
                    var canvas, stage, exportRoot;
    
                    canvas = document.getElementById("firstCanvas");
                    exportRoot = new libFirst.first();
    
                    stage = new createjsFirst.Stage(canvas);
                    stage.addChild(exportRoot);
                    stage.update();
    
                    createjsFirst.Ticker.setFPS(libFirst.properties.fps);
                    createjsFirst.Ticker.addEventListener("tick", stage);
                }
            </script>
            <script>
                // change the default namespace for the CreateJS libraries:
                var createjsSecond = createjsSecond||{};
                var createjs = createjsSecond;
            </script>
            <script src="//code.createjs.com/easeljs-0.7.1.min.js"></script>
            <script src="//code.createjs.com/tweenjs-0.5.1.min.js"></script>
            <script src="//code.createjs.com/movieclip-0.7.1.min.js"></script>
            <script src="{{assets}}/js/second.js"></script>
            <script>
                function initSecondAnimation() {
                    var canvas, stage, exportRoot;
    
                    canvas = document.getElementById("secondCanvas");
                    exportRoot = new libSecond.second();
    
                    stage = new createjsSecond.Stage(canvas);
                    stage.addChild(exportRoot);
                    stage.update();
    
                    createjsSecond.Ticker.setFPS(libSecond.properties.fps);
                    createjsSecond.Ticker.addEventListener("tick", stage);
                }
            </script>
    
    <body onload="initFirstAnimation(); initSecondAnimation();">
    
    
    
    

    Could someone please answer with best practices on how to do it? If possible, without the need to reload all libraries...

    If I only need to show a flash animation at the same time, it would be more efficient to cut/paste the canvas using jQuery tag in the DOM and reload a different lib on this subject?

    Thank you very much!

    #flash #reborn

    I was able to remedy. In the end, it was easier than I thought. Just publish using namespace different 'lib' for each film, load all the scripts at the end of theand add the following in the onload or ready events:

    $(document).ready(function () {
    
            var canvas, stage, exportRoot;
    
            // First movie
            canvas = document.getElementById("firstCanvas");
            exportRoot = new libFirst.first();
    
            stage = new createjs.Stage(canvas);
            stage.addChild(exportRoot);
            stage.update();
    
            createjs.Ticker.setFPS(libFirst.properties.fps);
            createjs.Ticker.addEventListener("tick", stage);
    
            // Second movie
            canvas = document.getElementById("secondCanvas");
            exportRoot = new libSecond.second();
    
            stage = new createjs.Stage(canvas);
            stage.addChild(exportRoot);
            stage.update();
    
            createjs.Ticker.setFPS(libSecond.properties.fps);
            createjs.Ticker.addEventListener("tick", stage);
    
            // Third movie
            canvas = dument.getElementById("thirdCanvas");
            exportRoot = new libThird.third();
    
            stage = new createjs.Stage(canvas);
            stage.addChild(exportRoot);
            stage.update();
    
            createjs.Ticker.setFPS(libThird.properties.fps);
            createjs.Ticker.addEventListener("tick", stage);
    });
    
  • How to load external swf file and unload the swf file parent?

    I have a question. Let's say I have file1.swf, file2.swf and file3.swf, how can I link this 3 files together.

    Let's assume that file1.swf is the main content file, but as I load file2.swf, I want the file1.swf get replaced by file2.swf. How could unload file1.swf at that time, so that my file2.swf will become the main content file?

    and even once, when my current post file2.swf and I want it get replaced by file3.swf tinkle of a button. so that i can unload the file2.swf and let them file3.swf become the main content file...
    Anyone have ideas on this?
    Thank you..

    If you're publishing to fp 10 + use:

    var loader: Loader = new Loader();

    var urlR:URLRequest = new URLRequest();

    addChild (loader);

    Btn1.addEventListener (MouseEvent.Click, f);

    btn2.addEventListener (MouseEvent.Click, f);

    function f(e:Event):void {}

    {if (Loader.Content)}

    loader.unloadAndStop ();

    }

    {if(e.currentTarget==btn1)}

    urlR.url = "file2.swf";

    } else {}

    urlR.url = "file3.swf";

    }

    Loader.Load (urlR);

    }

    p.s. Please check the useful/correct, if there is.

  • Loading a SWF in my flash banner

    Hello

    I am creating a banner for a website, and I need to load an external images scroll swf located behind the layers in my flash banner.  Another example is the site: www.miracledetail.co.uk.

    I created managed to create everything in this banner except the scrolling images, so I have an external swf file to load into my flash banner project.

    I tried this...

    createEmptyMovieClip ("anim", 0); create a new, but empty film (anim) clip
    anim.loadMovie ("animation.swf"); load "animation.swf" into the void (anim) video clip
    Anim._x = 100; Adjust the position of the imported file "animation.swf".
    Anim._y = 100;

    I clicked on a first framework on a layer on the timeline and inserted the above actionscript code, with the anim.loadMovie function calls the external swf file.  However, when I do this, the drumming swf loaded and displayed on the top of my banner, and I see no banner at all.

    I tried to put the script on multiple layer action so that the swf file will play behind the other layers in the banner, but again it keep loading on the banner.

    I hope you know what I'm saying here and what I'm trying to achieve.  Also to add that I am not very good with flash at all (as you have probably already guessed) so ideas tutorial or instructions on how to do this would be ideal.

    Kind regards

    Volterony22

    Hello

    Just to make it simple, create an empty clip on the stage itself rather than use an actionscript and use the actionscript code just to load external swf file in the clip.

    Create an empty clip on a layer below your expected layer where you want to load an external swf on the stage. Now, you can position the empty clip to the desired direction x, y on the stage OR you can use actionscript code to do. Give an instance name to this empty clip called "loadermc" in the properties panel. Add the following at the top most layer code (have one devoted to stocks if you have not already)

    your movie clip instance void name.loadMovie ('your external SWF file URL');

    loadermc.loadMovie ("animation.swf");

    If you do not position the empty movieclip earlier, you can use your code to make

    Anim._x = 100; Adjust the position of the imported file "animation.swf".
    Anim._y = 100;

    I hope this helps.

    Thank you!

  • How to connect several swf in the same application for iOS

    Hello

    I have a problem.

    I have lot of swf files, each of them is related to another: I have a menu with botton page linked to the different games (a swf for the game).

    Now, I need to convert this into an iPad app.

    My question is: which is the best way to create a link between all my swf files?

    I read a lot of things, but I really don't understand how I can move.

    Thx for the help,

    Stefano

    Add them to your files included in the iOS settings panel and use the sdk air 3.6 + and use the current application domain http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air-apps-sur-ios /

  • How to load several books in planning using FDM ERPI?

    Hello

    I use FDM and ERPI 11.1.2 to load data from Oracle GL R12 to Hyperion Planning 11.1.2.

    In Oracle GL, I have several books: one for each accounting entities.

    In ERPI:
    -an import format is associated with a single entity accouting
    -a location is associated with an import format, then with a reporting entity
    -a rule of data loading is associated with a place, then with a reporting entity

    In FDM, when configuring the ERPI adapter, you must enter the data load rule name that you want to use.

    So: How to load data from several reporting entities (= books) in planning through FDM/ERPI?

    Thank you in advance for your help!

    Fanny

    Fanny,

    You have no need to fill the data rule option - load adapter. By the documentation, you can also fill the places metadata integration Option n ° 1 with load rule name. This lets you use an adapter in the application of FDM; but the pull of several great books.

    Of course, each book would be a separate location of the FDM.

    Thank you

  • With the help of a ClassLoader to load several SWF files?

    Hello community,

    Pulling my hair out on this one. I want to use a single charger (from the class Loader) to, in order, load a SWF to a single movieclip on the stage. I have a charger that I want to load external files: 'peel0.swf', 'peel1.swf',..., 'peel9.swf' in 10 corresponding clips (that already exist on my scene): 'peel0_mc', 'peel1_mc',..., 'peel9_mc '.

    The problem with my code is that it does not load, but the last peel. Everything seems to be cranking away as you like, until I have look at the contents of my peeling - only the 'peel9_mc' Gets the external file "peel9.swf" in charge. When I slow down things with 'Simulate download' I see the 0-8 "peelX_mc" loaded with the correct SWF but when the 'loop' moves to the next line, it disappears from the mc. It's as if the *.addChild method does not stick.

    Any input would be greatly appreciated,

    -john

    VarioPegged!

    Yes! It worked like a charm. I do * love * this community.

    I sincerely appreciate your time and efforts to help me.

    Kind regards

    -john

  • How to access the elements in main.mxml file ActionScript?

    I'm having problems creating a panel using the Extension Builder SDK. It seems that all the examples explain how a CS5 document using a control panel, but I found no examples of how to control the items in the Panel via ActionScript code.   Furthermore, we use CS Extension Builder SDK with Flash Builder 4.  Here's a simple example of were I'm stuck.

    I create a project Extension generator for a panel of PS named: 'CSExtensionTest '.  In the main.mxml file create a button with id = "btnPSCode".

    ****************************************************************************************** *****************************************

    File:

    hand. MXML

    ****************************************************************************************** *****************************************

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application

    ' xmlns:mx = ' http://www.Adobe.com/2006/MXML " " layout ="absolute" historyManagementEnabled = "false""">

    < mx:Script >

    <! [CDATA]

    [

    Bindable ]

    private var hostName:String = HostObject.mainExtension;

    []] >

    < / mx:Script >

    "" < mx:VBox height = "100%" width ="100%" verticalAlign = "middle" horizontalAlign ="center">

    " < mx:Button id ="btnPSCode"label ="PS code run"click ="CSExtensionTestPhotoshop.run ()"enabled =" hostName.indexOf{('photoshop') >-1}"/ >

    " < mx:Button id ="btnJSXCode"label ="code JSX run"click ="CSExtensionTestJSX.run ()"/ > "

    < / mx:VBox >

    < / mx:Application >

    ****************************************************************************************** *****************************************

    How can I access the properties of this element in the CSExtensionTesJSX.as file?

    ****************************************************************************************** *****************************************

    File:

    CSExtensionTesJSX.as

    ****************************************************************************************** *****************************************

    package

    {

    Import com.adobe.csxs.core.CSXSInterface;

    Import com.adobe.csxs.core.csxs_internal;

    Import com.adobe.csxs.types.SyncRequestResult;

    Import mx.binding.utils.BindingUtils;

    Import mx.core.ButtonAsset;

    Import mx.core.mx_internal;

    Import MX.utils.object_proxy;

    public class CSExtensionTestJSX

    {

    public static function run():Sub

    {

    var myCSXS:CSXSInterface = CSXSInterface.getInstance ();

    var result: SyncRequestResult = CSXSInterface.instance.evalScript ('jsxFunction');

    btnPSCode.enabled = false;

    }

    }

    }

    ****************************************************************************************** *****************************************

    I get this error:

    image001.png

    I had initially written a panel using a Flex project and was able to access the properties of the items in the file main.mxml directly.  It seems that I can't do that.  Did I miss something in the code?  Am I missing some kind of library?  I'm sorry, I'm not very experienced in the development of Adobe, but we are trying to become more involved in the development of plugins and extensions for CS5.  Any help will be greatly appreciated.

    You must pass a reference to your object main mxml in the run method. For example:

    hand. MXML:


    http://www.Adobe.com/2006/mxml"layout ="absolute"historyManagementEnabled ="false">
       
           

    [Bindable]
    private var hostName:String = HostObject.mainExtension;
               
    ]]>
       
       
           
       

    testJSX.as:

    package
    {
    import com.adobe.csxs.core.CSXSInterface;
    import com.adobe.csxs.types.SyncRequestResult;
       
    Import mx.controls.Button;

    public class testJSX
    {
    public static void run(m:main):void
    {
    var result: SyncRequestResult = CSXSInterface.instance.evalScript ("jsxFunction");
    var b:Button = m.myButton;
    }
    }
    }

    HTH.

  • 5510E how to scan several documents into a pdf file?

    On a HP 5510E how to scan several documents for filing and turn them into a single pdf? The way it works now, it's that each scanned document is a separate pdf file.

    After you scan the first page using the HP scanner at the bottom of the scanning window, you should see a + sign click on it after completing the first page of scanning

  • How to load and object to read a file in CC Json animate?

    I'm a little puzzled about how to load an external Json file and have for example a text box display the Json file information.

    I'm used to make this way on the edge, but how the cabin = n I do this with the new animate CC 2016?

    Thanks a bunch,

    SAL

    Here is the code example:

    var LQ is new createjs. LoadQueue (true);

    lq.addEventListener ('complete', completeF);

    lq.loadFile ({id: "json", CBC:"test.json"});})

    function completeF (event) {}

    JSON = event.target.getResult ('json') var;

    parseJSONF (json);

    }

    function parseJSONF (obj) {}

    for (^ s in obj) {}

    {If (typeof {obj [s] = 'object'})}

    parseJSONF (obj [s]);

    } else {}

    Console.log (s + ': ' + obj [s])

    }

    }

    }

  • How you load in an external text (txt) file using edge animate CC?

    Hello

    Does anyone know how to load in an external txt file using edge animate? I think you have to make ajax calls, but I am a totally newbie here.

    Would be grateful for the help.

    Thank you and best regards,

    James

    Use a JSON file. Ingestion of external data | Learn edge CC animated | Adobe TV

  • How can I insert html into a flash file?

    Hi, I am trying to insert Paypal code that takes the user directly on site with all paypal account is paying options and I have the Paypal html code, but my site is all Flash. Is it possible to insert this code into a flash file?

    no code should be attached to objects:

    var sendLV:LoadVars = new LoadVars();

    var receiveLV:LoadVars = new LoadVars();

    {receiveLV.onData = function (src)}

    trace (SRC);  This allows to manage the return of paypal

    }

    {your_btn.onRelease = Function ()}

    sendLV.cmd = "_s-xclick".

    sendLV.hosted_button_id = "C8G49C6MKV2QL";

    sendLV.on0 = "Christmas memories";

    sendLV.currency_code = "USD";

    sendLV.sendAndLoad ("https://www.paypal.com/cgi-bin/webscr", receiveLV, "POST");

    }

  • How to load several files DBF table 1 target using only 1 interface?

    Hello, I am a beginner in ODI and I have a problem.

    I have several DBF / Foxpro files that is stored in a directory like this:
    2010_10/account.dbf
    2010_11/account.dbf

    All DBF files have the same structure, but stored in a different folder (the folder name is < year > _ < month >)

    I managed to create an interface to load a DBF unique for the target table and the source table is hardcoded in the interface. Ideally, the interface will take place once a month.

    How can I use the same interface to load other DBF files?

    I know, if the data source is a text file, you can link the resource name to a variable, and the variable can be set to a file name. But I can't do since I use a JDBC driver to connect to the DBF file.

    Any help will be appreciated

    Hello

    I have no idea on the DBF files, yet...

    What is create a variable to build the 'months' and then pass this variable to OdiFileCopy, move this file to a specific directory. Then run your interface to load this file into your database. Once the work is successful, you can delete the file using OdiFileDelete (optional)

    Thank you
    Fati

Maybe you are looking for

  • Create account Firefox Sync - limit exceeded attempt

    I didn't know that I needed to upgrade to a newer version of Firefox Sync and I tried to connect several times before understanding. I am now trying to create a new account Firefox Sync, but I get the message 'Outdated attempt limit.'

  • Qosmio F30: installed new drivers now no sound.

    I have a Qosmio F30 (PQF32), have just started to use Driver Detective to update the drivers, problem is now I have no sound.Control Panel says no. Audio Device, and more when I boot it says new hardware found PCI but can not find the driver.Would ap

  • Accidentally shut-off valve in the process of Sir on my laptop, now Windows does not...

    As the title suggests my... If was an accident, but I stopped the process of Sir in the Task Manager window and I got a blue screen of death. He created a backup file and then turns off. I tried to turn it back on, but all I get is an error message f

  • No connection Internet Windows 7

    First off I have COMODO net security on my Windows 7 computer. I write from my other windows XP computer to tell you what happened on my Windows 7. I'm not showing any Internet connection and can't open any browser. He wants me to use a system image

  • ScrollView Center vertically

    import bb.cascades 1.0 Page { Container { background: style.bgColor Container { preferredWidth: Infinity background: style.black TopBar { id: bar layoutProperties: StackLayoutProperties { spaceQuota: -1 } } layoutProperties: StackLayoutProperties { s