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

Tags: Adobe Animate

Similar Questions

  • External loading of a SWF file does not

    Hello

    So I have a project that I'm putting in which I would like to learn to take a scratch card. I made the scratch and then it will be 'scratch '.

    Before:                                                                                                                                               After:

    Before.pngAfter.png


    Now, I could save this output and try to load this into my 'support' but I get an error message:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at ScratchTicket()
    

    When I use this code:

    stop();
    
    import flash.events.MouseEvent;
    nextPG_btn.addEventListener(MouseEvent.CLICK, nClick);
    lastPG_btn.addEventListener(MouseEvent.CLICK, lClick);
    
    function nClick(event:MouseEvent):void{
        nextFrame();
    }
    
    function lClick(event:MouseEvent):void{
        gotoAndStop(3);
    }
    
    var mcExt:MovieClip;
    
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
    ldr.load(new URLRequest("ScratchTicketOnly.swf"));
    
    function swfLoaded(e:Event):void {
        mcExt = MovieClip(ldr.contentLoaderInfo.content);
        ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
        mcExt.x = 50;
        mcExt.y = 50;
        addChild(mcExt);
    }
    

    What I am doing wrong?

    It's because of my coding in the External SWF?

    package {
        import flash.display.Sprite;
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.ui.Mouse;
    
        public class ScratchTicket extends MovieClip{
            var scratcherIsActive:Boolean= false;
            var stuffUnderMask:Sprite = new Sprite();
    
            // init class
            public function ScratchTicket():void{
                stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseIsDown);
                stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseIsMoving);
                stage.addEventListener(MouseEvent.MOUSE_UP, mouseIsUp);
                // make mask            
                stuffUnderMaskClip.mask = stuffUnderMask;
                addChild(stuffUnderMask);
                makeCursor();
            }
    
            // helper functions
            private function makeCursor():void{            
                trace("Custom cursor can go here");
            }
            // hover effects
            private function mouseIsDown(e:MouseEvent):void{
                //Mouse.hide();
                Mouse.cursor="hand";
                scratcherIsActive = true;
            }
            private function mouseIsUp(e:MouseEvent):void{
                //Mouse.show();
                Mouse.cursor="arrow";
                scratcherIsActive = false;
            }
            private function mouseIsMoving(e:MouseEvent):void{
                if(scratcherIsActive){
                    stuffUnderMask.graphics.beginFill(0x000000);
                    stuffUnderMask.graphics.drawEllipse(mouseX, mouseY,60, 60);
                    stuffUnderMask.graphics.endFill();
                }
            }
        }// class
    }// package
    

    Any help is great!

    Make sure you check errors when loading...

    import flash.events.IOErrorEvent;

    ldr.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, uhOhError);

    function uhOhError(e:Event):void

    {

    trace (e);

    no doubt put a Visual text here field to view the error

    }

    Side, on the first block of code mentioned, which is a frame script or run away somewhere in a class? In the case of a class and it does not have a display object, so you can't addChild (mcExt) without the slightest mistake.

  • Loading the local swf files in Dir Application (ios)

    Hi guys,.

    I want to load additional local swf files for my ios Release version but I'm a bit confused because of changes in the API again.

    As far as I know at the moment (3.7 Air or newer), it is permitted to load local swf files containing actionscript compiled from local file and a remote host that is predefined as well.

    My assumption, based on this article:

    http://blogs.Adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-SWFs-for-air-apps on ios.

    I created the text file to include all my names swf local and created the next node in the application.xml file:

    < iPhone >

    .

    < externalSwfs > assets/SampleSWFInfoFile.txt < / externalSwfs >

    .

    < / iPhone >

    When I compile the release build (ipa) using the adt command line, it converts all my local SWF files in naked sovereign wealth funds which is perfect, but even if I include all SWFs in the compiler command, it takes only the SampleSWFInfoFile.txt file in the current folder in the ipa, but not swf files.

    I guess, he thinks I have will load these files from an external host, but I want to include them in the application itself.

    I tried to copy files swf stripped in the externalStrippedSwfs folder and comment on the assets/SampleSWFInfoFile.txt < externalSwfs > < / externalSwfs > node application.xml and he and this way, he puts the SWFs in the ipa, but when I try to install and launch the application, it hangs and when I test it using Flash Builder he displays a compilation error message

    «VerifyError: Error #1042: not an ABC file.»

    Anyone of you guys know the solution to this problem?

    Thank you in advance for your help!

    You are the publication in AOT mode as long as you use one of these:

    The AIR Developer Tool ADT a target that allows you to package applications or for the mode of the AOT or interpreter. Targets for packaging in AOT mode are ipa-app-store, ipa-ad-hoc, ipa-test and debugging of the ipa.

    Flash CS6 Pro and Flash Builder automate this process well enough so it's invisible, but the SWF file loads and runs the code very well for me when directly published.

    If I take it on the command line, I can use this to compile successfully (test iPad application):

    ADT-package - target the ipa-ad-hoc - stores pkcs12 - keystore my.p12 - implementation service-profile my.mobileprovision NameOfApp.ipa NameOfApp - app.xml iTunesArtwork SWF/SWF/GenerateText.swf swfs.txt AppIconsForPublish iTunesArtwork@2x NameOfApp.swf

    I include at a minimum the generic icons in there, but I did a "SWF" folder and placed "swfs.txt" and "GenerateText.swf" there. The SWF file uses code to generate random text and change every second using a timer. I load using the same code as you do with the context ApplicationDomain.currentDomain. I see appear the SWF file and text begin to change randomly.

    As I compile there is a generated file called 'externalStrippedSwfs' with the stripped in that SWF.

    One thing to note is that I provide no SWF/swfs.txt in my settings of the iPhone. If I do that it does not. I provide the path to the text file containing the SWF I want be stripped to adt itself as well as funds sovereign I want stripped and he takes care of the rest.

  • join several swf files into a swf file

    Hello everyone

    I've been dealing with this problem for too long and decided to ask for help - how can I gather 15 swf files placed in a folder in a SWF one?

    I tried all kindes of the merger of programs like "Join (Merge, handset) several SWF Files Into One Software" and "WinMerge" without success and I tried to convert swf to flv (cause I found other software merging for flv files), but once again...

    I have CS5, so if I have to open Flash to do this I will, Although I try to avoid it, and even in this case I'll need complete instructions.

    All I need is this simple thing, so I'll thank very much any help

    Thank you & good day

    Keren

    To stay a bit brief, cannot join several swf files in a folder and have still things work if the files involve actionscript.  You need to have the fla files, and then you can copy the timelines of each fla in movieclips into one main file.  What you need to do if you don't have the source fla files is to dynamically load the separate runtime files.

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

  • Cannot nest several SWF files with swfObject 2

    We'll find the site referenced @ http://www.l4dt.com/
    I need to integrate several .swf files into an html file. I perfer using swfObject. Here's what the code looks like now:

    <!-start-> l4dt_header.swf
    < script type = "text/javascript" >
    var flashvars = {};
    var params = {};
    params.menu = "false";
    params. Quality = "best";
    params. Scale = "noscale";
    params.wmode = "transparent";
    attributes of var = {};
    Attributes.ID = "FL1".
    Attributes.Name = "l4dt_header";
    Attributes.styleClass = "l4dt_header";
    Attributes.Align = "middle";
    swfobject.embedSWF ("l4dt_header.swf", "FL", "605", "196", "9.0.0""," expressInstall.swf", flashvars, params, attributes);
    < /script >
    <! - end l4dt_header.swf - >

    <!-start-> l4dt_boomer.swf
    < script type = "text/javascript" >
    var flashvars = {};
    var params = {};
    params.menu = "false";
    params. Quality = "medium";
    params. Scale = "noscale";
    params.wmode = "transparent";
    attributes of var = {};
    Attributes.ID = "FL".
    Attributes.Name = "l4dt_boomer";
    Attributes.styleClass = "l4dt_boomer";
    Attributes.align = 'right ';
    swfobject.embedSWF ("boomer.swf", "FL", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
    < /script >
    <!-start-> l4dt_boomer.swf

    What is happening is one of the embededd sovereign wealth funds ends up replacing the other.

    I also video clip pulse, on and outside rotation and bright lime green. I know the filter radiation in actionscript 3, filters = [new GlowFilter (0x5d7c00, 1, 6, 6, 2, 3)]; But how would I get impulses?

    So if you go to the site ( http://www.l4dt.com/ as shown above), you will see a green cloud, because it's part of the swf file. I want to create the same symbol toxic warning which is rotating in the Center, but much smaller and that several instances of it, flashing in and out at random places in the Green cloud.

    Then I'll create an app Flash where a user can can in layers «posters» This code is sufficient to allow the user to be able to move these individual layers from the perspective of the entire application? :

    MC.addEventListener (MouseEvent.MOUSE_DOWN, {function(evt:MouseEvent):void}
    MC.startDrag ();
    }
    );
    MC.addEventListener (MouseEvent.MOUSE_UP, {function(evt:MouseEvent):void}
    MC.stopDrag ();
    }
    );

    I am not advocating the definitive answer to one of my problems, just 2 cents.

    Oh and if you have the time, tell me what you think of the site in general.

    http://www.l4dt.com/

    You use the same id 'FL' swfobject.embedSWF methods - so a script replaces another in the element of the DOM with the id "FL".

    And I would say that you split your post and more focused on the topics.

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

  • 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.

  • external loading of the joboptions file

    Hi all

    I would use joboptions file in PDF from Indesign export via plugin.

    I don't want to load in Indesign, I want to just use it for export.

    I hope that one of you has experience with the external load of .joboptions

    Help me find the solution

    Kind regards

    Alam

    I need to follow up changes, and it works for me.

    PMString joboptionsFilePath = ' / Library/ApplicationSupport/Adobe/ABC/pdf.joboptions ';

    IdFichier joboptionsFile = (joboptionsFilePath) FileUtils::PosixPathToSysFile;

    If (FileUtils::DoesFileExist(joboptionsFile))

    {

    pdfExportPrefs-> ReadJobOptionsDataFromDisk (joboptionsFile);

    }

  • Load the local swf file with flash

    Dear my friends

    I have a big problem with as3. I have two .swf file: Index.swf - 1 and 2 - page1.swf. Index file has a frame with the following measures:

    var loader_mc:Loader = new Loader();

    addChild (loader_mc) ;// add the loader to the display list
    loader_mc. Load ("d:\\page1.swf"));// loads the file

    I have download the Index file in my site and it can't load page1.swf.

    Please help me.

    Best regards

    For that you must have a web server if you are using Windows you can have IIS or you can choose a free like Apache

    You start the Web server and place the swf file in the wwwroot directory, then you will be able to access using

    http:// page1.swf

  • Try to get _totalframes several swf files

    Hello people,

    I have a list of swf files and I need to know the quantity of frames of each of them. I tried the following:

    1. I created an xml file called "data.xml" (an example with 5 files - lesson1.swf, lesson2.swf, lesson3.swf, lesson4.swf and lesson5.swf):
    <? XML version = "1.0" encoding = "iso-8859-1? >
    < course >
    < id lesson = "1" > < Lesson1 name > < / name > < / lesson >
    < id lesson = "2" > < lesson 2 name > < / name > < / lesson >
    < id lesson = "3" > < Lesson3 name > < / name > < / lesson >
    < id lesson = "4" > < lesson4 name > < / name > < / lesson >
    < id lesson = "5" > < name > lesson5 < / name > < / lesson >
    < / course >

    2. I wrote this script on Flash:

    System.useCodepage = true;
    var MyXML:XML = new XML();
    MyXML.ignoreWhite = true;

    MyXML.onLoad = {function ($success)}
    {if ($Success)}
    for ($i = 0; $i < MyXML.firstChild.childNodes.length; $i ++) {}
    lessonloaded = MyXML.firstChild.childNodes [$i].firstChild.firstChild.nodeValue;
    loadMovieNum (lessonloaded + ".swf", 10); lesson n .swf on _level10 charges
    _level10. Stop();
    trace (_level10._totalframes);
    unloadMovieNum (10);
    }
    } else {}
    trace ($Success);
    trace ("Error!");
    }
    }
    MyXML.load ("data.xml");

    The trace (_level10._totalframes) of undefined five times results command. So I tried the onEnterFrame function, believing that, after some loops, Flash would recognize the amount of frames of the lesson n .swf file loaded on _level10:

    for ($i = 0; $i < MyXML.firstChild.childNodes.length; $i ++) {}
    lessonloaded = MyXML.firstChild.childNodes [$i].firstChild.firstChild.nodeValue;
    loadMovieNum (lessonloaded + ".swf", 10);
    _level10. Stop();
    onEnterFrame = function() {}
    If (_level10._totalframes! = undefined) {}
    trace (_level10._totalframes);
    unloadMovieNum (10);
    delete this.onEnterFrame;
    }
    }

    }

    But, onEnterFrame function is called only once, after the loading of lesson 5.swf. So I get the amount of images of the last file only.

    Now, I am a bit lost... I don't know what to do to improve this script, and I wonder if there isn't a better way to get the _totalframes of a list of swf files...

    Any suggestions will be much appreciated!

    Thanks in advance,
    Zenho

    Woo - hoo! Now I got it! The problem is where was called loadClip... I moved it just below the loop for, and now it works!

  • 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

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

    }

  • How to prevent the sounds of the timeline in external swf files to play during the loading?

    I'm having a problem with the sounds of the external timeline in the swf files play while charging in a main swf file. Can someone help me?

    Here is a part of the main code of the swf. I hope I got enough.

    Thank you.

    import flash.events.MouseEvent;

    import flash.display.MovieClip;

    import flash.display.Loader;

    to import flash.events.ProgressEvent;

    import flash.events.Event;

    import flash.net.URLRequest;

    Import fl.events.SliderEvent;

    import flash.media.SoundTransform;

    preloader_mc.fill_mc. ScaleX = 0;

    var swfA:Array = ["part1.swf", "part2.swf"];

    var frameA:Array = [];

    var currentLoader:Loader;

    var swfTotalFrames:int;

    var tl:MovieClip =;

    var st:SoundTransform = new SoundTransform()

    var int index = 0;

    loadNextF();

    play_slider. Enabled = false;

    function loadNextF (): void {}

    TL ["loader_" + index] = new Loader();

    TL ["loader_" + index] .name = index.toString ();

    TL ["loader_" + index].contentLoaderInfo.addEventListener (ProgressEvent.Progress, progressF);

    TL ["loader_" + index].contentLoaderInfo.addEventListener (Event.Complete, completeF);

    TL ["loader_" + index] .load (new URLRequest (swfA [index]));

    }

    function progressF(e:ProgressEvent):void {}

    var fractionLoaded:Number = index/swfA.length+e.bytesLoaded/(e.bytesTotal*swfA.length);

    preloader_mc.fill_mc. ScaleX = fractionLoaded;

    preloader_mc. TF. Text = (100 * fractionLoaded) + "% Loaded";

    }

    function completeF(e:Event):void {}

    TL ["loader_" + index].contentLoaderInfo.removeEventListener (ProgressEvent.PROGRESS, progress F);

    TL ["loader_" + index].contentLoaderInfo.RemoveEventListener (Event.Complete, completeF);

    SoundMixer.stopAll ();

    var mc:MovieClip = MovieClip (tl ["loader_" + index] content);

    mc.gotoAndStop (1);

    frameA.push (mc.totalFrames);

    index ++;

    if(index<swfA.Length) {}

    loadNextF();

    } else {}

    / / full of all charges.  start playing.

    restart_mc.buttonMode = true;

    restart_mc.Alpha = 1;

    tl.addEventListener (Event.ENTER_FRAME, playUpdateF);

    tl.removeChild (preloader_mc);

    preloader_mc = null;

    play_slider.enabled = true;

    playpause_mc.Alpha = 1;

    currentLoader = tl ["loader_0"];

    tl.addChild (currentLoader);

    MovieClip (currentLoader.content) .play ();

    sliderParamsF();

    }

    }

    I have about 70 sounds in my two external SWF. What I need to stop all of them?

    //---

    more than likely, Yes. I guess it depends on how you have 70 put sounds up in your external swf file... I mean:

    you have 70 movieclips appointed on the external swf stage with a distinct sound in each of them? and each have a stop() action in the first picture?

    or

    you say your external swf to go to a certain image tag that plays a sound on the timeline to this label?

    or

    are your 70 sounds created dynamically with code and told. start()?

    //---

    Keep in mind, a swf loading will start to play even before it is fully charged. So instead of when it is fully charged, try stop the loaded swf with a listener for 'init', i.e. when the swf file loaded passes its first image:

    function loadNextF (): void {}

    TL ["loader_" + index] = new Loader();

    TL ["loader_" + index] .name = index.toString ();

    . contentLoaderInfo.addEventListener TL ["loader_" + index] (ProgressEvent. COURSES, progressF);

    TL ["loader_" + index].contentLoaderInfo.addEventListener (Event.COMPLETE, completeF);

    TL ["loader_" + index].contentLoaderInfo.addEventListener (Event.INIT, initF);

    TL ["loader_" + index] .load (new URLRequest (swfA [index]));

    }

    function initF(e:Event):void {}

    SoundMixer.stopAll ();

    var mc:MovieClip = MovieClip (tl ["loader_" + index] content);

    mc.gotoAndStop (1);

    }

  • Flash cs6 3.8 AIR app questions: can not load child SWF files

    Hello - I have a flash for ios application that loads external swf child on a button click; When I use AIR 3.8 I can't load. Everything works fine on the generator to preview, but when I publish the device, none of the child SWFS play; It's very strange! Help, please... I don't really know why it doesn't work.

    Here is the code on the main timeline to load the child swf file:

    Start button

    start_button_TRI_herrerasaurus.addEventListener (MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_04_3, false, 0, true);

    Import fl.display.ProLoader;

    import flash.events.Event;

    var fl_ProLoader_04: ProLoader;

    This variable keeps track of if you want to load or unload the SWF file

    var fl_ToLoad_04:Boolean = true;

    function fl_ClickToLoadUnloadSWF_04_3(event:MouseEvent):void

    {

    If (fl_ToLoad_04)

    {

    fl_ProLoader_04 = new ProLoader();

    fl_ProLoader_04.load (new URLRequest("dinofilms/triassic_herrerasaurus.swf"));

    fl_ProLoader_04.contentLoaderInfo.addEventListener (Event.COMPLETE, onComplete_04)

    addChild (fl_ProLoader_04);

    fl_ProLoader_04.x = 0;

    fl_ProLoader_04.y = 144;

    }

    on the other

    {

    If (fl_ProLoader_04! = null) {}

    removeChild (fl_ProLoader_04);

    fl_ProLoader_04.unloadAndStop ();

    fl_ProLoader_04 = null;

    }

    }

    fl_ToLoad_04 =! fl_ToLoad_04;

    }

    function onComplete_04(e:Event):void {}

    e.currentTarget.content.addEventListener (Event.ENTER_FRAME, OEF_04);

    }

    function OEF_04(e:Event):void {}

    If {(e.currentTarget.currentFrame is e.currentTarget.totalFrames)

    e.currentTarget.stop ();

    e.currentTarget.removeEventListener (Event.ENTER_FRAME, OEF_04);

    removeChild (fl_ProLoader_04);

    fl_ProLoader_04.unloadAndStop ();

    fl_ProLoader_04 = null;

    }

    }

    for air for ios 3.6 +, you need TO report a loadercontext even if there is no actionscript in the loaded swf file:

    var loader: Loader = new Loader();

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

    Loader.Load (new URLRequest("dinofilms/cretaceous_ankylosaurus.swf"), _lc);

Maybe you are looking for