Put a swf into an existing swf

i want to play a swf file inside my flash website, the swf
needs to be an external file, not inside the movie itself, how can
i do this?

Use a loader but a different one everytime.
var myLoader:SWFLoader=new SWFLoader();
myLoader.source="etc.swf";
addChild(myLoader);
If you want to reference them later on, add each loader to an ArrayCollection so you can then remove them, hide them, change size or source, whatever, using holderAC[something].
If you want to add 10 loaders and "remember" them:
private var holderAC:ArrayCollection=new ArrayCollection();
for(var i:uint=9;i<10;i++)
     var myLoader:SWFLoader=new SWFLoader();
     myLoader.source="etc.swf";
     addChild(myLoader);
     holderAC.addItem(myLoader);

Similar Messages

  • How to Load an SWF into the Parent SWF

    Hi all,
    I have 3 SWFs.
    X.SWF - Parent application. Contains an empty movie clip for
    loading external swfs using loadClip() method.
    B.SWF - Has some text and pics. Gets loaded into the empty
    movieclip on X.SWF. Also has a button saying 'Load A.SWF'.
    A.SWF - Similar to B.SWF with a button saying 'Load B.SWF'.
    When I start the main application (X.SWF) and load B.SWF into
    it all is fine.
    But would like to click on the 'Load A.SWF' button on B.SWF
    and load A.SWF into X.SWF. And visa-vesa.
    The problem is I'm not able to refer to the parent container
    (X) from these child (A and B) SWFs.
    Is there any way to do this?
    Thanks

    First if you use
    Button.onPress=function(){
    this._parent.loadMovie();
    the movie try to load swf into B.swf because "this" mean the
    button.Try with more ._parent or just if you X.swf is into the one
    MovieClip in 1st stage _level0.SWF.loadMovie();.Also if you want to
    load the A,B.swf into the stage simultaneously just create two
    movieclips into the X.swf mcA and mcB and the path has gone to
    _level0.SWF.mcA.loadMovie("A.swf"); :)

  • Loading an external swf into my parent swf?

    Does anyone know how I can load an external .swf file into my
    parent file? I have tried to use loader actionscript but think I am
    using the incorrect script or putting it in the wrong place? If
    anyone can tell me the script and where to/how to use it that would
    be amazing? Thanks

    thanks GWD!
    I am using the unloadMovieNum(); command, i have loaded the
    child into level 5 of my parent swf. the parent has multiple scenes
    this one with a layer with a stop(); action and another layer with
    the loadMovieNum("portfolioone.swf", 5); script. it loads the child
    perfectly. The child has a number of pictures in it and a back
    button at the end. I have been adding the
    on (release) {
    unloadMovieNum(5);
    script to the button which unloads the child but stops
    because of the stop action in the first frame of the particular
    scene within the parent. I want to be able to add a script to this
    button which will take me back to a labeled frame in a particular
    scene of the parent, I tried the this.removeMovieClip(); but
    doesn't seem to be working for me, Thanks for the reply, hope you
    can help me further??

  • Loading a Flex3 SWF into an AS3 SWF

    I have an AS3 shell project which bootstraps my application
    by loading several other AS3 and Flex3 SWFs. The problem I am
    seeing is that tooltips in the Flex3 SWFs never show up. The events
    trigger properly but they simply never appear. Anyone know how I
    can get this to work?

    Anyone?

  • Sound plays in stand-alone SWF, but not when SWF is loaded into another SWF

    I have my Main FLA (Main.SWF) into which I load another SWF (1.SWF).  I have a sound the plays in 1.SWF and it works just fine when I publish 1.SWF alone.  When I load 1.SWF into my Main.SWF and publish Main.SWF, the sound in the loaded 1.SWF no longer plays.  I can't figure out why.
    //Here's the code (AS2) in 1.SWF to play the sound; seems pretty straight forward.
    mySound = new Sound();
    mySound.attachSound("soundSWF1");
    mySound.start();

    I found some information on-line that helped me figure out how to fix this issue.  First, I moved the sound object code to the timeline of the movieclip in which I wanted to play the sound, even if the movieclip was in a loaded SWF.  So if I my sound should play in mc_1.mc_2.mc_3, the sound object is created in mc_3 timeline.  Also, when creating the sound object, "this" is placed as the parameter, as such:
    soundObject = new Sound(this);
    Also, when stoping the sound, I'm using stopAllSounds() instead of soundObject.stop().
    I hope this helps someone who is struggling with this same issue.

  • Loading swf into swf in exact position

    It's very simple to load an external swf into a main swf with
    loadMovieNum("name.swf", 50);
    But how do I control the position of the loaded swf?
    Currently it just pops in the top left.

    Try loading your external .swf into a pre-positioned
    movieClip, for example myMovie.loadMovie("name.swf). If you do not
    want to do this you can position the loaded movie later in your
    application or onload by setting the x and y pos with some
    AS.

  • Load SWF file in main SWF with parameters

    Hello everybody,
    I recently got a new flash Application which is a Photo Gallery.
    This App is made of multiple folders (source files), a FLA file, a SWF with its javascript SWFObject and an Html page which instantiate this App with some parameters (size, config file path, ...).
    It needs an XML file to find all the Photos it displays, to do it I need to configure my application in the HTML Page and give it the "xml_path" :
    var so = new SWFObject("index.swf", "gallery", "249", "249", "10", "#111111");
    so.addVariable("xml_path","load/config.xml"); // this line is adding the path to the xml file make sure that it's name is xml_path
    so.addParam("allowfullscreen","true"); 
    so.write("flashcontent");
    By the way, I have a second application, the WebSite, which have to display the Gallery SWF in its "Gallery" page.
    Here is how I do it at the moment (in ActionScript3) :
    var swfRequest:URLRequest = new URLRequest("C:/......../Galerie/index.swf");
    var swfLoader:Loader = new Loader();
    //Charge le SWF Galerie dans le SWF Site
    swfLoader.load(swfRequest, context);
    container1.addChild(swfLoader);
    //Positionne le SWF
    swfLoader.x=10;
    swfLoader.y=120;
    It successfully loads the Gallery application but It shows an error telling me it doesn't find the XML configuration file... In the HTML file I simply had to write the "so.addVariable("xml_path","load/config.xml");" to tell where the XML file is...
    So, my question is : How can I integrate my SWF application giving it some parameters like above, in Action Script 3?
    Thank you ,
    Patrick

    No, nothing with HTML.
    I have 2 SWF applications. One is the Gallery, and the second is my Main Page.
    My Main Page must integrate the Gallery module in one of its page.
    The problem is when I try to integrate it, I think I must give de future loaded SWF some parameters like this :
    (My Main SWF loading in HTML)
    var so = new SWFObject("WebSite.swf", "flashcontent", "520", "700", "10", "#111111");
    so.addParam("allowfullscreen","true");
    so.addParam("allowScriptAccess","always");
    so.addParam("menu","false");
    so.addParam("wmode","opaque");
    so.addParam("bgcolor","#000000");
    so.setAttribute("id","flash");
    so.write("flashcontent");
    It was for the Main App. For my Gallery SWF I had to load it like this (in HTML) :
    var so = new SWFObject("Gallerie.swf", "gallery", "249", "249", "10", "#111111");
    so.addVariable("xml_path","Galerie/config.xml"); // this line is adding the path to the xml file make sure that it's name is xml_path
    so.addParam("allowfullscreen","true"); 
    so.write("flashcontent");
    So at the beginning I had 2 different projects with an HTML page for each.
    Now I wan't to directly integrate the Gallery SWF into the Main SWF. And as you have seen I must give it some parameters such as the "xml_path" and "allowfullscreen". This must be done in ActionScript 3 and I don't know how...
    I think I have to use FlashVars but I don't know how. As I said before, I have tried using the loaderinfo.parameters, but it is in read-only...
    Do you have an idea of how I can make it work ?

  • Need help unloading an External .swf within another external .swf

    My main project loads an external .swf ("room") depending on which button the user clicks. Once that external .swf ("room") is loaded, the viewer chooses a ("demo") .swf to view. I need the "demo" .swf to unload once it is finished playing so that the viewer sees the 1st external .swfs menu again. All .swfs are loaded into an empty loader component. The "demo" swfs were created in captivate thus I don't have access to a timeline for them.
    I imported a .swf into captivate that will call a function at the end ie..._root.unloadCaptivate();
    and I have the following code in the originally loaded .swf
    function unloadCaptivate() {
    mcLoader.unloadClip(accountingLoader_mc);
    btnEndPeriod_btn.enabled = true;
    btnCashCollect_btn.enabled = true;
    btnFinancialMGMT_btn.enabled = true;
    _root.btnHome_mc._visible = false;
    btnAcct_mc._visible = false;
    btnPlay._visible = false;
    btnPause._visible = false;
    That all works fine, but when I load "room" .swfs into the main .swf, the unloadCaptivate(); no longer works...any ideas? Thanks!

    you should be able to use a loop (like onEnterFrame) to check when your demo swf's _currentframe==_totalframes.

  • When importing iPad photos into Aperture, I cannot import into an existing album, only create a new project.

    I dont want to create a new project for every group of photos being brought over from my iPad. My iPhone worked perfectly. I was able to choose which project/album I could import into, why would the iPad, running the same iOS, be any different?

    Hi Dave,
    Welcome to the user-support Aperture discussion forum.
    You would probably benefit from reading Kirby's introduction: [http://discussions.apple.com/messageview.jspa?messageID=13124533&stqc=true]
    Is there any way to simply import photos into those albums without having to create all of those annoying projects?
    That's a loaded question. It's not "yes or no" according to exactly how you asked it.
    You do not have to create a new project for each import, but every picture lives in exactly 1 project. You can then point to any photo from any number of albums. You cannot put a photo directly into an album because an album does not contain photos, it only contains "pointers" to photos.
    So, you, as the user, have the ability to put your imports into an existing project. Why are you creating a new project every time?
    nathan

  • How can I load an external SWF into a movie clip that's inside other movie clip?

    Hi.
    I creating my first flash (actionscript 3.0) website but I'm
    stuck with a visual effect I want to create.
    I have a window on my website called contentWindow. Every
    time you click a button this window is supposed to leave the stage,
    load the requested content and return to the stage.
    The sliding window is a movie clip with 83 frames, 21 to
    enter the stage, 21 to leave the stage again, 20 for nothing (its
    just to simulate the loading time) and 21 to return to the stage.
    Now my goal is, when the user clicks on a navigation button,
    the window exits the stage, loads an external SWF with the content,
    and then returns to the stage.
    I've the "window" movie clip with an instance name of
    "contentWindow". Inside there is another movie clip with an
    instance name of "contentLoader". The content that the user
    requested should appear inside the "contentLoader".
    Now, when the contentWindow leaves the stage, I get this
    error message:
    quote:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at rwd_fla::MainTimeline/trigger()
    If I switch
    "contentWindow.contentLoader.addChild(navLoader);" for
    "contentWindow.addChild(navLoader);" it works fine, but the
    external SWF doesn't move with the window.
    How can I load an external SWF into a movie clip that's
    inside other movie clip?

    Hi,
    Recently, I have been putting together a flash presentation.
    And I am just wondering if the following might help you, in your
    communication with the said swf file:
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onComplete);
    function onComplete(event:Event):void
    event.target.content.thinggy_mc.y -= 100;
    Not the best example, but this allows you to target a mc
    within an external swf file. I think if you look up this code, you
    will have an answer ;)
    Kind Regards,
    Boxing Boom

  • How can I input data from a Frontend site into a Backend SWF, pull data, then send back to Front?

    So here's what I'm trying to figure out...
    I have a site with an SWF that I can put some metrics into, such as ZIP Code, Weight, etc..    then, it takes that info and gives me shipping rates.
    I need to build a front-end site that I can have a forms page that will push data to the backend SWF, and then return the data back from the SWF to the front end.
    Any ideas how to do that?
    Front-end -> SWF (Zip Code, Weight, Size) -> *Calculates* -> Front-End
    That should be the flow..     So I need to send data to the backend, GET the data that it calculated, and return the results to my front-end.
    Thanks Much..  any questions, please ask..

    Depending on what the data looks like coming from the Flash movie, you can use the get or send method to output data from the Flash movie using URLRequest. You can look at the online help example for the URLVariables class. You will still need to use or create a server side script to read in the data, make the changes and send the modified data back. That will be a perl or PHP script and is outside the scope of this forum.

  • A Swf into a Fla.

    Basically I'm making a website and I have an animation that uses a V-Cam. I want to put this animation into my website.
    The probelm is if I just load it, you can "see" the v-cam but you're not looking through it.
    It's wierd to explain now that I actually have to try.
    But the reason I can't export it as a Giff. or maybe an AVI and just load in as a movie, is because you'd see the Vcam and not look through it.. so I have to keep it a swf, but now even when I do it seems to be doing the same thing.
    I need a Swf. player in my website. in my Flash-made website...
    I've looked it up everywhere, but it's the V-Cam thing that's the problem, not loading an external Swf.

    Hi there!
    I was extremely glad to find this post, as it helped me with this same issue, however, in implementing this, it created another issue. I inserted my movieclip exactly as shown, and it works tremendously, except that it now loops continuously. I have tried inserting a stop();  function on the clip's timeline after the mc ends, on its own seperate timeline..it doesn't work no matter where I put it. I do not have just a single actions layer, if that makes any difference.
    So my question is, what code stops the mc from looping and where would I put it? the clips code is as follows;
    this.createEmptyMovieClip("mc",1);
    mc.loadMovie("dnbanner2.swf");
    mc._x = 140;
    mc._y = 13;
    Any help would be very greatly appreciated, I have been at it for days and many, many browsed forums

  • Inserting A SWF into a Captive Project

    Hi All,
    I'm trying to insert a swf into my captivate project. It goes
    onto the slide with no problem but when I preview the project the
    swf is not animated. I'm using AS3 to code the animation so there
    is only one frame. I set the frame rate in Captivate to match the
    frame rate of the swf with no success. Any help is appreciated,
    thanks.

    Hi there
    I suppose that's possible. I'm not a Flash Coder yet but
    would imagine the sky is the limit once you get things into Flash,
    as at that point it's a Flash project, no? I don't believe an
    avenue exists to take a Flash project and pop it into Captivate.
    (By that, I mean to export from Flash as a .CP file - I am well
    aware that one may create a .SWF from Flash and pop it into
    Captivate as an Animation)
    Cheers... Rick

  • Load SWF into empty movieClip?

    Hello,
    Could anyone please point me in the right direction to find
    out how to load an external SWF into an already existing movieClip
    instance that is already placed on the stage? This is the way I've
    always worked in AS2, but I can't find how to do it in AS3. Can
    anyone point me to an example where URLRequest works with a
    specified movieClip instance?
    Thank you!

    I understand why you might think I was ignoring your advice,
    but this isn't the case. You're expertise is much valued and
    respected.
    My purpose for continuing to experiment with loading into a
    movieClip was an attempt to find an easy way to layer the SWF
    behind other elements, but as you know, although it works for this
    purpose, it doesn't allow control of the loaded SWF from the main
    timeline. For others struggling to learn as I am, here's a link
    where I found the answer to my question above:
    http://www.hostingforum.ca/776586-as3-controlling-loaded-swf.html
    The transition to AS3 is not as easy for some as for others,
    and there are new concepts to understand.
    Don't know what "nvm" means... curious, but might be better
    off not knowing ;) Thanks again for all the help you offer to all
    of us who are struggling.

  • Swf into fla

    I'd like to get an existing swf with tweening animation into
    another existing fla file, and be able to place the swf file in a
    specific location, without using another window, and without
    loading movie. Each time i import the swf file into a movie clip in
    the existing fla file, the tween animation gets scrambled, turning
    into frame by frame animation. Is there another way of doing this?
    Thanks.

    You can load the movie using actionscript during runtime, or
    you could take the fla of the countdown and copy its timeline and
    objects into the other file.

Maybe you are looking for