Problem with loading external swf files

Hello

I am currently working on a project which is an interactive and dynamic elemtry school presentation to the Denmark. I finished my project and it works perfectly, but only locally on my computer.

The final draft should be implemented on the site and public work. I tried to implement the project on the site and unfortunately, it does not work as expected.

When all the files where transferred to the ftp server, only a single files are responding and appear correctly.

Interactivity of the project is based on a structure of Action script, which is based on the smooth transition between swf files (load another swf file after the action is triggered by clicking on a button) do any work.

After days of trying to figure out the solution, I'm totally lost. One thing is to publish the project so that all action script will work and answer between swf files, and the other thing is to make it user-friendly for the Android and apple products.

The presentation is quite heavy because of its loading external swf content files, which are images and movies.

I really hope you can help me with my problem. I will gladly share the files and codes if it would help solve the problem.

Best regards

Agata

It could be a problem of location of file from loading.  When you place a swf file in an HTML base for targeting anything that the SWF load becomes the folder of the html page.  You may need to adjust the target so that the target of swf files, load it as if it were in the same folder as the html page.

Tags: Adobe Animate

Similar Questions

  • Help please! Problems with loading external swf files

    I'm scared, I'm new to both Adobe Flash and Actionscript 3.0.

    I'm trying to create a simple site using a couple of different external sovereigns loaded into a main swf file.

    For the moment, in the timeline panel, I have the following code in frame 1 of the layer actions:

    import flash.events.MouseEvent;

    Stop();

    navbutt.addEventListener (MouseEvent.CLICK, shownavbg);
    function shownavbg (myEvent:MouseEvent): void {}
    gotoAndPlay (10);
    }
    home_btn.addEventListener (MouseEvent.CLICK, showhome);
    function showhome (myEvent:MouseEvent): void {}
    gotoAndPlay (66);
    }
    aboutme_btn.addEventListener (MouseEvent.CLICK, showaboutme);
    function showaboutme (myEvent:MouseEvent): void {}
    gotoAndPlay (49);
    }
    gallery_btn.addEventListener (MouseEvent.CLICK, showgallery);
    function showgallery (myEvent:MouseEvent): void {}
    gotoAndPlay (76);
    }

    var bgLoader:Loader = new Loader();
    stage.addChild (bgLoader);
    ("var url: URLRequest = new URLRequest("Background/sitebackground/Main.swf ");
    bgLoader.load (url);
    stage.setChildIndex (bgLoader, 0);

    Then, in the framework of 76, I have the following code:

    removeChildAt (0);
    bgLoader.unload ();

    In section 77:

    var galleryLoader:Loader = new Loader();
    stage.addChild (galleryLoader);
    var galleryurl:URLRequest = new URLRequest("test/ZenGalleryDemo.swf");
    galleryLoader.load (url);
    stage.setChildIndex (galleryLoader, 0);

    Stop();

    The idea is that, when the file is loaded, the 'sitebackground/Main.swf"flash loads on the stage. Then I want to delete this flash and load a different one when I click on the gallery_btn. So, when I click on the gallery_btn, he plays frame 76, theoretically unloading the Main.swf and the loading of the ZenGalleryDemo.swf in its place.

    For the moment, the Main.swf loads perfectly and works great. But when I click on the button to the Gallery, he jumps to the frame 76 and plays the Main.swf. It does not load the file ZenGalleryDemo.swf...

    If anyone has any ideas, I would be really grateful!

    Thanks in advance

    It's just a glance and reading, but the problem may lie between these two lines... look closely...

    var galleryurl:URLRequest = new URLRequest("test/ZenGalleryDemo.swf");
    galleryLoader.load (url);

  • Problem with loading/unloading SWFs external

    Hey! Thank you in advance for any assistance you can provide. Here's the question: my master I am loading an external swf file. This file overlays the original file, so I started looking for a way to download the original file. I was not very successful. I've looked through these forums and did research on google, too, but found only a partial solution.  Right now, I have created a background layer that allows the loaded file cover the original file without bleed through.  I'd rather have the original file unload before loading the file newly appointed.

    Here is the code that I found so far:

    Declaring Variables
    var Xpos = 0;
    var Ypos = 0;
    var loader: Loader = new Loader();
    var swfFileToLoad: URLRequest = new URLRequest ("holdHumans.swf");

    Go to the creation
    removeChild (loader);
    Loader.Load (swfFileToLoad);
    Loader.x = Xpos;
    Loader.y = Ypos;
    addChild (loader);

    This code is normally associated with a key event, but I have to be able to use it inside a timer function in the original file. When the function is called, I get this message: Error #2025: the supplied DisplayObject must be a child of the caller.

    I get this message too when I try to use it in the swf file loaded externally.

    How to solve this problem?

    Thank you

    Michael

    You are welcome.

  • Load external swf file

    Hi all

    I am trying to load an external SWF file in my site... but it does not work. Here is my code

    public var CD:Loader = new Loader();

    protected function application1_creationCompleteHandler(event:FlexEvent):void

    {

    CD.load (new URLRequest ("http://localhost/assets/slide.swf"));

    addChild (this. (CD);

    CD.x = 2;

    CD.y = 170;

    / / TODO self-generated stub method

    }

    Can someone tell me what goes wrong...

    The url is correct and his works in my browser when I type " " http://localhost/assets/slide.swf ' in the browser... So the problem is with flex...

    I tried to load this swf into my project and it crashed the browser.  What is written this swf?  AS3 or earlier?  If I'm not mistaken load one previous VERSION other than 3 will cause additional problems and needs to work to spare but I'm not 100% sure.

  • AS2 button table to load external swf files

    Hey everybody.  Someone here recently helped me tremendously with a question I had on the creation of a back button in my flash file, allowing the user to click the button and view the file before swf.  I hope someone can help me make the next button now, too.

    I have a movieclip that loads an external swf files table.  I thought that the next button would be as simple as changing a selection just few things for the previous button.  However, this does not work.  When I try it, the movieclip doesn't even load the swf files.  Here's my AS2 code for my folder.  I have bolded the part at the end is for the previous button.  Does anyone know how to make the back button?

    var currentSwf:Number = 0;
    var swfs:Array = new Array ("EZSmartStand/SmartStand.swf", "EZSmartStand/Warnings.swf", "EZSmartStand/LCDDisplay.swf", "EZSmartStand/Operation.swf", "EZSmartStand/Harness.swf", "EZSmartStand/Transferring.swf", "EZSmartStand/800lbvid.swf", "EZSmartStand/Ambulating.swf", "EZSmartStand/Accessories.swf", "EZSmartStand/HarnessLaundering.swf", "EZSmartStand/ChargingBatteries.swf", "EZSmartStand/EmergencyLowering.swf", "EZSmartStand/EmergencyLowering2.swf");

    var listener: Object = new Object();
    var mcl:MovieClipLoader = new MovieClipLoader();
    mcl.addListener (listener);

    Function to load the film "next".  It uses the current value of currentSwf
    to access the table of sovereign wealth funds, then increments this value.  This version loops
    around at the beginning after the last of them.

    function loadNext (): Void {}
    mcl.loadClip (SWF [currentSwf], theTargetClip_mc);
    currentSwf ++;
    If (currentSwf > = swfs.length) currentSwf = 0;
    }

    When the SWF load, put in place to constantly check its current image
    against the total number of frames, and so those that match, the SWF is done playing.
    If this is the case, then load the following.

    listener.onLoadInit = {function(targ:MovieClip):Void}
    theTargetClip_mc.onEnterFrame = function (): Void {}
    If (this ._currentframe = this ._totalframes) {}
    loadNext();
    delete this.onEnterFrame;
    }
    }
    }

    loadNext();
    function loadNext (): Void {}
    If (currentSwf > = swfs.length) return;
    mcl.loadClip (sovereign wealth funds [currentSwf], theTargetClip_mc);
    currentSwf ++;

    }

    function loadPrevious (): Void {}

    if(currentSwf>1) {}


    currentSwf-= 2;


    loadNext();


    }


    }

    rewind_btn.onRelease = loadPrevious;

    You must change your code so that the value of currentSwf reflects the real current swf being viewed.  It makes it easier to manage in the aspect of thinking.  While I'm not show all your code, here's how I recommend you change functions, by adding one specifically for loading, and change the other just increment/decrement the value currentSwf.

    function loadNext (): Void {}
    currentSwf ++;
    If (currentSwf > = swfs.length) currentSwf = 0;
    loadSWF (currentSwf);
    }

    function loadSWF (nextSWFToLoad) {}
    mcl.loadClip (SWF [nextSWFToLoad], theTargetClip_mc);
    }

    loadSWF (currentSwf);

    function loadPrevious (): Void {}
    -currentSwf;
    if(currentSwf==-1) currentSwf = swfs.length - 1;
    loadSWF (currentSwf);
    }

    rewind_btn.onRelease = loadPrevious;

  • Loading external SWF files...

    I hope that I can make sense of it. I have my main SWF, which is a background image and a bar of buttons at the bottom. When you click on one of the buttons, the loader object is another SWF to cover the bottom. First time isn't a problem, but if you click on another button at the bottom, the original background image flashes through the new page will load in.

    I know this isn't a big deal, but it bothers me. How can I go about creating a smooth transition between files?

    Place the background image into a MovieClip. Place the MovieClip on the stage where you got the background image. Give it a name in the Properties window for the instance on the stage and then his set _visible to false on all buttons or call a function from buttons that does this.

    However if you use loadMovie, you will always see a difference if the same target is used because the target is destroyed at the beginning of the loadMovie method and until the internet serves the first frames of the external swf file target is empty.

    A buffering approach can be explored by using more than one target, MovieClipLoader and exchanging multiple depths (or interpolation of transition) when the MovieClipLoader.onLoadInit method is called.

  • How to load external swf files into the AIR

    I try this code its working at the computer, but when I publish this .apk or .ipa file, my external swf file does not open

    (I included my external file as well)

    places_btn.addEventListener (MouseEvent.MOUSE_DOWN, newvid);

    function newvid(event:MouseEvent) {}

    trace ("you clicked me");

    var loadit = new Loader();

    addChild (loadit);

    loadit. Load (new URLRequest ("scene02.swf"));

    }

    01.jpg

    Add this in your newid function:

    You forgot to put the beginning of your original function:

    var loadit = new Loader();

    addChild (loadit);

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

    loadit. Load (new URLRequest ("scene02.swf"), _lc);

  • Loading external SWF files: make things simple... Still need to help here =)

    Hi all! First of all, sorry for my English... I'm Brazilian and English is not my mother tongue.

    This is my first post , supposed to be my first post and I'm learning AS3. Didn't know this forum, but now I hope to have time to visit it a lot for help and be helped! =)

    Well, I am trying to import external files to my main flash with buttons file. Yes, this is a newbie question, but I'm learning... I click the button 1 and content 1 is loaded, click on the button 2 and content 2 is loaded and so on. So, I got two ways to do:

    edit: The code below works fine now...

    montreal.addEventListener (MouseEvent.MOUSE_UP, loadCity);
    dublin.addEventListener (MouseEvent.MOUSE_UP, loadCity);
    sydney.addEventListener (MouseEvent.MOUSE_UP, loadCity);
    ...

    var box: MovieClip = new MovieClip();
    addChild (box);
    Box.x = 20;
    Box.y = 20;

    function loadCity (event: MouseEvent): void {}
    currentCity var = event.target.name;
    remove all the children from the box
    While (box.numChildren > 0) {box.removeChildAt (0) ;}}
    var swfRequest:URLRequest = new URLRequest (currentCity + ".swf");
    var swfLoader:Loader = new Loader();
    swfLoader.load (swfRequest);
    box.addChild (swfLoader) ;}

    The problem with this first selection, is that whenever I click on a button, it repeats the content of the 'box'... instead, the loaded content is stacked on the last of them, and I know not how to clean it... The user Andrei toured with the statement "all" so that the code above works, but I don't know how to use tween with him...

    So here's the second option:

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    Montreal .buttonMode = true;
    dublin.buttonMode = true;
    sydney.buttonMode = true;
    rio.buttonMode = true;
    paris.buttonMode = true;
    london.buttonMode = true;
    home.buttonMode = true;

    var box: MovieClip = new MovieClip();
    addChild (box);
    Box.x = 20;
    Box.y = 20;

    var cityLoader:Loader = new Loader();
    var cityURL:URLRequest = new URLRequest ("montreal.swf"); I use it to show a city when the site is open
    cityLoader.load (cityURL);
    box.addChild (cityLoader);

    * Here I add headphones to button, each calling its own function as:

    montreal.addEventListener (MouseEvent.CLICK, loadMontreal);

    function cityTweens (): void {}
    var cityIn:Tween = new Tween (box, "y", Strong.easeOut,-350, 20, 1, true) ;}

    function loadMontreal(event:MouseEvent):void {}
    var cityURL:URLRequest = new URLRequest ("montreal.swf");
    cityLoader.load (cityURL);
    cityTweens() ;}

    function loadDublin(event:MouseEvent):void {}
    var cityURL:URLRequest = new URLRequest ("dublin.swf");
    cityLoader.load (cityURL);
    cityTweens() ;}

    function loadSydney(event:MouseEvent):void {}
    var cityURL:URLRequest = new URLRequest ("sydney.swf");
    cityLoader.load (cityURL);
    cityTweens() ;}

    function loadRio(event:MouseEvent):void {}
    var cityURL:URLRequest = new URLRequest ("rio.swf");
    cityLoader.load (cityURL);
    cityTweens() ;}

    function loadParis(event:MouseEvent):void {}
    var cityURL:URLRequest = new URLRequest ("paris.swf");
    cityLoader.load (cityURL);
    cityTweens() ;}

    function loadLondon(event:MouseEvent):void {}
    var cityURL:URLRequest = new URLRequest ("london.swf");


    cityLoader.load (cityURL);
    cityTweens() ;}

    function loadHome(event:MouseEvent):void {}
    var cityURL:URLRequest = new URLRequest ("home.swf");
    cityLoader.load (cityURL);
    cityTweens() ;}


    Well well, the second option "" works, but I have some problems with interpolation of... I have to wait the Tween to complete before you click another button or the interpolation will be bug... I know not how to disable buttons until the Tween is finished .

    Now, I used to have a Tween for each function, but now I got inside a function and just call it inside each function. Simple for you but I thought WOW, when I had the idea and put it into practice! But I repeat myself again a lot of code here with the "cityLoader.load (cityURL); but when I try to put it inside the function "cityTweens", it will just open the city of Montreal, maybe because I'm the appellant as soon as the site opens...

    I'm pretty sure I can make simple things, like mixing the idea of the first code (currentCity + ".swf") so I do not need to call a function for each button. I don't know how... ...

    Could someone help me? Also, I will be VERY happy if you give me a tip as good practices that I'm not following.
    Thanks in advance!

    Post edited by: newToAS3

    Adjustments to the code that deal with it below. This is not a complete code - make full changes yourself.

    import flash.events.EventDispatcher;
    // hold all the buttons in an array
    var buttons:Array = [montreal, dublin, sydney, rio, paris, london, home];
    // add listeners
    addListeners();
    // function that adds listeners
    function addListeners() {
         for (var k:String in buttons) {
              EventDispatcher(buttons[k]).addEventListener(MouseEvent.CLICK, loadSWF);
         }
    }
    // removes event listeners
    function removeListeners() {
         for (var k:String in buttons) {
              EventDispatcher(buttons[k]).removeEventListener(MouseEvent.CLICK, loadSWF);
         }
    }
    
    function loadSWF(e:MouseEvent):void {
         // remove listeners
         removeListeners();
         // the rest of code goes here
    }
    
    function tweenFinished(e:TweenEvent):void {
         // add listeners back
         addListeners();
         // make Tween instance eligible for arbage collection
         e.target.removeEventListener(TweenEvent.MOTION_FINISH, tweenFinished);
         // now you can remove tweened object from the box
         box.removeChild(e.target.obj);
         e.target.obj = null;
    }
    
  • Loading external SWF files: make things simple...

    Hi all! This is my first post and I'm learning AS3 =)

    I didn't know this forum, but now I hope to have time to come hear a lot, to help and be helped!

    Well, I am trying to import external files to my main flash with buttons file. Yes, this is a newbie question, but I'm learning... I click the button 1 and content 1 is loaded, click on the button 2 and content 2 is loaded and so on. So, I got two ways to do:

    * various buttons with the listeners to run the function 'loadCity '.

    var box: MovieClip = new MovieClip();
    addChild (box);
    Box.x = 20;
    Box.y = 20;

    function loadCity (Event: MouseEvent): void {}
    var currentCity = Event.target.name;
    var swfRequest:URLRequest = new URLRequest (currentCity + ".swf");
    var swfLoader:Loader = new Loader();
    swfLoader.load (swfRequest);
    box.addChild (swfLoader); }

    The problem with this first selection is that the content of the box is not renewed with each click, but he stacked one on the other, so I can't use it.

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    var box: MovieClip = new MovieClip();
    addChild (box);
    Box.x = 20;
    Box.y = 20;

    var cityLoader:Loader = new Loader();
    var cityURL:URLRequest = new URLRequest ("montreal.swf");
    cityLoader.load (cityURL);
    box.addChild (cityLoader);

    * various buttons with listeners to run its own functions, such as 'montreal.addEventListener (MouseEvent.CLICK, loadMontreal)';

    var box: MovieClip = new MovieClip();
    addChild (box);
    Box.x = 20;
    Box.y = 20;

    function loadCity (Event: MouseEvent): void {}
    var currentCity = Event.target.name;
    var swfRequest:URLRequest = new URLRequest (currentCity + ".swf");
    var swfLoader:Loader = new Loader();
    swfLoader.load (swfRequest);
    box.addChild (swfLoader); }

    The problem with this first selection is that the content of the box is not renewed with each click, but he stacked one on the other, so I can't use it.

    You can remove all the children from the box before placing another object inside:

    function loadCity (event:MouseEvent):void {
         var currentCity = event.target.name;
         // remove all the children of the box
         while (box.numChildren > 0) {
              box.removeChildAt(0);
         }
         var swfRequest:URLRequest = new URLRequest(currentCity + ".swf");
         var swfLoader:Loader = new Loader();
         swfLoader.load(swfRequest);
         box.addChild(swfLoader);
    }
    

    I see that you intend to use tween - in this case code above you does not have transitions gracefully...

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

  • Problem with loading of metadata files

    Hello

    I'm working on the loading of my test AAHPTR request account dimension metadata in version 11.1.2.1 contour utility charge.
    In the face of the sub question every time I run the cmd utility.
    Error messgae: Unrecognized value for column header
    Here's the File Format:
    Parent, counts, Alias: by default, the storage of data, account Type, Description, Data Type, the Type of Plan (2), aggregation (PLAN2)
    Account, result, dynamic Calc, recipes, currency, True, ~.

    Please suggest

    Thank you

    If you get stuck, add a dummy in the planning, and then use the utility to export the metadata to a file, then you have the right format.
    If you do not know how to do to export then have a read of http://john-goodwin.blogspot.co.uk/2011/04/planning-11121-exporting-metadata.html

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Problem with loading external images

    I have a small gallery that I did (Nothing fancy) and want images to load fully before they fade. The process would be, first image load in, click Next, shows preloader bar above the current picture (still on display), and then once fully loaded, replaces the last image with the new it fading... I hope that makes sense...

    Why doesn't this work? I use a loader movie clip...

    Alrighty... I have moved things and I now call to the function loadClip mcl in a different place, so it fades the current image, image, image new charges fades in... Let's see if my customer purchases (they wanted a more seamless transition) with on the pause between showing the loading preloader...

  • Preloader which modifies the external SWF files every 5 seconds

    Hello

    I made a web banner in flash that loads an external swf and another external swf changes after 5 seconds. The banner have a preloader, but the problem becomes when you load the first time. As sovereign wealth funds are not cached in the cache of the browser and yet, time 5 seconds start counting from the preloader, and when the external swf file, shows only 1 second rest and it is replaced by another. There is a way to 'freeze' the time for each external swf until it loads completely?

    The code that loads SWFs every 5 seconds (this code is placed in a layer of action):

    start of the code:

    var intervalId: number;
    var: number = 0;
    var maxCount:Number = 23;
    var duration: number = 0;
    var banners: Array = new Array)
    "abatrade.swf,"
    "bancobrasil.swf,"
    "caparao.swf,"
    "cedro.swf,"
    "cesama.swf,"
    "copasa.swf,"
    "damatta.swf,"
    "emtel.swf,"
    "engedrain.swf,"
    "extel.swf,"
    "feedback.swf,"
    "iti.swf,"
    "intermedium.swf,"
    "magnesita.swf,"
    "maquenge.swf,"
    "maxxdata.swf,"
    "orteng.swf,"
    "paiva.swf,"
    "paraibuna.swf,"
    "paraopeba.swf,"
    "sabesp.swf,"
    "serpro.swf,"
    "soll.swf,"
    'thawte.swf '.
    );

    function executeCallback(param:String) {}
    var duration: number = 5000;
    loadMovie (banners [count], loadmovie_mc);
    loadmovie_mc._x = 0;
    loadmovie_mc._y = 0;

    clearInterval (intervalId);
    if(Count < maxCount) {}
    Count ++;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    }
    else {}
    Count = 0;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    }
    }

    If (intervalId! = null) {}
    clearInterval (intervalId);
    }

    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);

    end of the code
    ----------------------------------------

    And the code to the preloader (this code I place in the movieclip that loads external SWF files):

    start of the code:

    {onClipEvent (enterFrame)}
    var gtT:Number = this.getBytesTotal ();
    var gtL:Number = this.getBytesLoaded ();
    var gtP:Number = int ((gtL/gtT) * 100);
    If (TWG > gtL) {}
    This ._alpha = 0;
    _root. Loader._alpha = 100;
    _root. Loader.bar._width = gtP;
    clearInterval (intervalId);
    } else {}
    This ._alpha = 100;
    _root. Loader._alpha = 0;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    delete onEnterFrame;
    }
    }

    end of the code

    Note that I tried to freeze the time using a clearInterval does in the second code, but he simply doesn't work...

    Any ideas? Thank you

    Edson

    Here's the correct code kglad send me. Thank you very much!

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

    }

  • Problem with several swfloaders and file a swf

    Hello!

    Is it possible to load a SWF file at run time with a charger and then when the load is finished to set that is contained in a source for SWFLoaders two or more property? Because now if I don't have that content is presented on the last SWFLoader and others show just a blank space.

    Here is the code I use:

    _loader = new Loader();
            
    _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);
    _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onIOError,false,0,true);
            
    _loader.load(new URLRequest(a url where the swf file is located));

    private function onLoadComplete(event : Event) : void {
         swf1.source = event.currentTarget.content;
         swf2.source = event.currentTarget.content;
    }

    After the class can be useful in your case:

    package
    {
        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.net.URLLoader;
        import flash.net.URLLoaderDataFormat;
        import flash.net.URLRequest;
    
        import mx.core.FlexLoader;
        import mx.core.UIComponent;
    
        public class superLoader extends URLLoader
        {
    
            private var buffer:Array=new Array()
            private var ldr:Loader=new Loader()
            private var comp:UIComponent
            private var disp:Sprite
            public function superLoader(request:URLRequest=null)
            {
                super(request);
    
            }
            override public function load(request:URLRequest):void{
                this.dataFormat=URLLoaderDataFormat.BINARY
                super.load(request)
    
            }
    
            public function get loadedContent():UIComponent{
                if(this.data!=null){
                    ldr=new Loader()
                    comp=new UIComponent()
                    ldr.loadBytes(this.data)
                    comp.addChild(ldr)
                    return comp
                }else{
                    throw new Error('Invalid Data')
                }
            }
            private function onLoad(e:Event):void{
                    e.target.removeEventListener(Event.COMPLETE,onLoad)
                    buffer.shift().addChild(e.target.content)
                    e=null
            }
            public function get rawLoadedContent():Sprite{
                if(this.data!=null){
                ldr=new Loader()
                    disp=new Sprite()
                    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoad)
                    ldr.loadBytes(this.data)
                    buffer.push(disp)
                    return disp
                }else{
                    throw new Error('Invalid Data')
                }
            }
    
        }
    }
    

Maybe you are looking for