FAQ: How do I load an external SWF file into a parent SWF file?

A ton of Flash users visit Adobe’s we site every month wondering  about how to load an external SWF file from within another SWF.
Adobe's own TechNote on the subject attempts to answer the basic question, along with some common follow-up questions, including:
How do I load more than one SWF?
How do I load a SWF into a specific location in the display list?
How do I resize the loaded SWF?
How do I set its X and Y location?
Here are some additional resources that elaborate on loading content and on working with the display list:
Sample files for the above TechNote. A set of 3 FLA and 3 corresponding SWF files, including a parent SWF and 2 SWFs that the parent loads.
Help > AS3 Developer’s Guide > Loading an external SWF file
Help > AS3 Developer’s Guide > Loading display content dynamically
Loading multiple external SWFs within a main SWF – CreativeCow.net forums
Video tutorial: ActionScript 101 – Episode 6: Adding named objects to the Stage. By Doug Winnie. An example of how to add the loaded external asset to the Stage and modify its location or other properties.
Video tutorial: Preloading in ActionScript 3.0.  By Lee Brimelow. A slightly more complicated example, showing how to  make the parent SWF display information about the progress of loading  the external SWF.
Tutorial: Loading and unloading SWFs - FlashAndMath.com
This article provides several examples of how to communicate between a parent SWF file and the loaded SWF:
SWF to SWF Communcation via ActionScript 3.0 (by kglad)

quote:
Originally posted by:
NedWebs
You now seem to want to get rid of the swf once it has loaded
and played itself thru. To do that you would need to have something
in the swf itself that triggers its removal in its last frame. The
following might work...
MovieClip(this.parent).removeChild(this);
Unfortunately I couldn't get this to work. I placed it on the
last frame of the SWF to be called - is that right?
I am not sure I am doing it correctly...

Similar Messages

  • 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

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

  • Source code organization: How to divide large JavaScript files into several smaller JavaScript files?

    Hello,
    some of my JavaScripts have become considerably large over time. What I would like to do is to split a single (large) JavaScript source file into several smaller source files plus an additional JavaScript file containing code or directives to recombine the split files.
    In other words, I would like to organize my JavaScript source code into re-usable modules.
    Although I searched the Acrobat JavaScript developer documentation and did a lot of Web searching, I still have no idea...
    whether the Acrobat JavaScript scripting environment itself does provide a code structuring mechanism
    how to properly organize large Acrobat JavaScripts in general.
    Any help would be greatly appreciated! Thanks a lot in advance!
    Sebastian

    Document-level scripts are not accessible to other documents/scripts, so they're not a good option.
    Folder-level scripts, on the other hand, are accessible to all other documents/scripts. So if you have a general function that creates a 3D annotation, for example, you can place it in a folder-level script and then call it from other scripts (you will probably need to provide it a handle for the document and properties of the annotation).
    One thing to be aware of, though, is that the folder-level scripts are loaded alphabetically, so don't put a reference in script aaa.js to something that loads in zzz.js, or you will get an error message when you open Acrobat. (this is not a problem if zzz.js is not called during the launch of Acrobat)

  • How do i combine multiple pdf file into a single pdf file?

    how do i combine multiple pdf files into a single pdf file?

    The thread was started in early March and it's Mid-April, I know this very well. The OP of this thread posted a very common and simple question or maybe he/she would have resolved this. For an Adobe Acrobat user it's not at all difficult to combine multiple PDF files into one. But to combine PDF files full version of Adobe Acrobat is mainly required, otherwise PDF files can't be combined. For example, I'm using Adobe Acrobat 9 Pro. These simple steps are mainly required to combine PDF files:
    Open Adobe Acrobat.
    Click on Combine and click on Merge files into a single PDF.
    A window will be appearing, click on Add Files and select the PDF files you want to combine.
    Arrange the selected files in any order with the help of Move Up and Move Down button.
    Now click on Combine File and the selected PDF files will be combined within a few seconds.
    A new PDF file will be created. Click on Save As and name this new PDF file. Then, click on Save.
    A new PDF file will be created and all the selected PDF files are combined in it. The steps shown above might be different in other versions of Adobe Acrobat. Other than this, some third-party PDF merge software are also available. Most of them are available with a demo version for free evaluation. I've heard much about SysInfoTools PDF Merge software on other forums and directories and it's demo version is freely available. One may check its demo version if Adobe Acrobat (full version) is not available.
    Regards

  • How to transfer input file into XI through sender file adapter

    Hi
    I am quite new to XI. Want to know how I can transfer a file into XI through sender file adapter. I dont have any input file, so I have to create a sample input file and I want to transfer that into XI. Can you please advise me of the steps involved in that. I have finished work in design and directory, now I want to push file the sample file into XI. The receiver adapter is an IDoc adapter. And also a very trivial question. How I can place my sample file into my source directory. Thanks

    Hi Rajiv,
    If your transport protocol is NFS then you need to put the file in the XI server. Because it becomes the Network File System. For that you can just type the ip address of the XI server in the "run" command or in the browser with "
    " then in any of the Folders you can paste your file. But ensure that this is the path you give in your Sender File Adapter.
    If your transport protocol is FTP then you need to see that ftp is running in your system. for that go to Control Panel>Add/Remove Programs>Add/Remove Components. In that check the IIS server and go to details and see that ftp is also checked. Now ftp is running in your system.
    Now open your C:> drive >InetPub>ftproot . and create a folder here and paste your file. In the configuration of your File sender adapter just mention the name of the folder.
    For your information, you can create a file with xml tags and namespace and message type manually (or) you can directly get it from the test tab of message mapping and generate source code.

  • I want to insert .pdf files into a "Master" .pdf file at pre-determined intervals - how do I do this?

    I want to insert .pdf files into a "Master" .pdf file at pre-determined intervals - how do I do this?

    Hi markm11762689,
    When you insert pages, you can determine whether they go before or after the first or last page, or a page number that you specify.
    If you're inserting multiple files at once, they will all be inserted in the same spot that you specify in the Select File to Insert dialog box.
    There may be a way to handle this programmatically, and there are some very clever folks who visit these forums regularly. Let's see if they chime in...
    Best,
    Sara

  • How to export the same mb size of my cr2 files into jpg or tiff files in Lr?

    How to export the same mb size of my cr2 files into jpg or tiff files in Lr?
    Let's say my file size is 22mb, when i export the file to tiff or jpg, although Iam careful with the settings- file size, dimension, resolution, I can't manioukate how I want it.
    With jpg I tried everything, no matter what i do or change in files size or resoltion it remains the same size- 7mb as opposed to 22..
    Please advise,
    Best wishes,
    T

    I would noramlly opt for a tiff file, sending such a high res through the nest a nightmare
    This is probably just an improper use of terminology, but the resolution of a JPG, DNG and TIF should all be the same.
    The files differ in size, not resolution and not number of pixels.
    Jpg is not that bad, but its a pitty they have to be edited under a jpg format..
    Your raws are edited as raw. There is no loss of quality in the editing process. The files are then exported as JPG, which will cause a loss of quality. For just about any use, the loss of quality in the image when you export a JPG at quality level 12 is NOT noticeable. For many uses, exporting a JPG at a quality level of 8 will not be noticeable either, unless you intend to print the photo at a very large size. As twenty_one (not his real name) said, "Jpeg compression is fantastically effective".

  • How to correctly load an external swf file into iosAir app? I'm getting blank screen.

    So this code works flawlesly on Air for Android, it even works fine when I test the movie in Flash, but once I export it, I'm getting a blank screen. I made an swf with a square and withotu any code, and flash still fails to load it. It's weird cause everything works fine when I use the interpreter debugging option, but when I switch to standard debugging the blank screen appears on my ipad. I've read somewhere that it's caused by the way flash saves the link to external files. Thus after the file is compiled Flash fails to find the prefiously added files, which results in a blank screen. There's clearly something wrong with how the process of compiling the application.
    Tried this:
    var Xpos:Number = 0;
    var Ypos:Number = 0;
    var loader:Loader = new Loader();
    var link:URLRequest = new URLRequest("Untitled-1.swf");
    loader.load(link);
    addChild(loader);
    And this:
    var ldr:Loader = new Loader();
    ldr.load(new URLRequest("Untitled-1.swf"));
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
    function loaded(event:Event):void {
    addChild(event.target.content);
    But nothing works. I'm still getting a blank screen. Is there any way to add the swf file manually into the descriptor file cause flash most likely messes it up? I don't really want to use through command line.

    Read this article, especially the bit about loadercontext and currentdomain:
    http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air- apps-on-ios/

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

  • How can I load a graphic in SOFFCONT1 into an SAP picture control?

    At my customer site, GOS attachments to PM notifications are stored in SOFFCONT1, so I can't use cl_bds_document_set to get a URL that I can pass to the load method of the SAP picture control.
    How can I load the actual graphic in SOFFCONT1 into an SAP picture control?
    Or do I have to configure IW22 so it stores in BDS content servers, not SOFFCONT1?
    If this is the case, how do configure IW22 so GOS knows to store attachments as BDS documents rather than in SOFFCONT1 ???
    Thanks
    djh

    This explains how to make sure your PC and bin documents are saved on your HTTP content server, instead of in the database:
    http://help.sap.com/saphelp_nw04/helpdata/en/c0/1aca5823ee11d3a2db00a0c943858e/content.htm

  • How do I encrypt my external hard drive and subsequently a specific file within it, using my Mac? I tried creating a disk image but permission was denied.

    Encrypting an external hard drive and specific folders within. Permission denied using disk image.

    VKP90 wrote:
    When I tried to encrypt a single file within the hard drive itself, I got the following: Disk Utility Progress: Unable to create "Name of my file" (Permission Denied).
    When I tried encrypting the entire hard disk itself, I got: A GUID Partition Table (GPT) partitioning scheme is required.
    I have also currently used Time Machine on the external hard drive, along with saving other data. Hence, I am not sure if partitioning is going to delete any of this (a video I watched mentioned that using the + button when creating partitions retains current data). Backing up the external hard drive is out of the option since it is the back up to my Mac.
    You can't encrypt a single file. I'm not sure what you did to try. You can make an encrypted disk image which begins with a folder, if desired. Or, you can just create a blank, encrypted disk image, then move your desired files into that.
    While you could partition off the free space without erasing the disk, you cannot encrypt it because you need a GUID Partition table which requires you to repartition the entire drive, not just the free space.

  • Concatenate two single frame swf's into one singleframe swf?

    Hi
    Is it possible to combine multiple swf's into one "single frame" swf?
    I have an flex application, that has a scroller with a swfloader inside, and the swfloader should load the "single frame" swf and it is possible to navigate up and down, via the scroller.
    Any help is appreciated.
    /Allan

    I've experienced the same thing sometime long in the past,
    and I probably did a frame by frame Print Screen to get around it.
    If it's single frame swf, then that's probably all you're going to
    get is one frame as an output.
    You may be able to incorporate a jpeg encoder of some sort to
    take snapshots as the piece animates in some form of loop fashion,
    but I'm not savvy in that dept.

  • How Can I Convert Multiple TextEdit Files Into A Single Giant File?

    For example. I have multiple chapters for my new book each saved as individual files, and I want to combine all the chapters into one single continual file that I can work with in either Text Edit or Word. How can I do this? It's hundreds of files... ∆
    Thanks!

    Hi Bruce, Tex-Edit Plus for OS X...
    http://www.tex-edit.com/
    It can Merge files then Sort them easily, even has a remove duplicate lines script available.
    If the version you get doesn't have the sort perchance, here's a link, put sort in the search scripts box, get the second one, Sort Selection...
    http://dougscripts.com/texedit/

  • Info on How to install adobe pdf as a printer into my device -printer file in windows 7

    Need information on how to install adobe pdf as a printer in my device-printer file in windows 7. I currently have adobe 8 pro & acrobat distiller on my pc.

    Acrobat appears to be running just fine- I am running windows 7 Ultimate 64 bit. I don't know why it just didn't automatically install- I just replaced an older HD that was going bad. Copied my entire system using windows mirrow image. Adobe pdf converter was in my device and printer file before and now its's not. I did have to reinstall several programs, such as Adobe Acrobat, etc.

Maybe you are looking for

  • How do you remove a potential malware on Macbook Pro?

    When I am opening new tabs in Google Chrome I get pop up widows looking like coming from Chrome, prompting update of browser as supposedly the video player is out of date. Looks suspicious as directs to zipCloud page. I have run iAntivirus, Avast and

  • Variable Range not working in BPS-Layout.

    Hi BI Guru's, I am facing Problem in BPS - Layout. My requirement is to get YTD Budget Quantity in Single Coulumn. For Example, I need Quantiy for the Period 001.2009 to 12.2009 in single Column as Budget YTD 2009. For this I defined a variable on th

  • Single  file is processing multiple times

    Hello All, I am working on a File-IDOC Scenario. I have a strange situation that when I place a .CSV file in the FTP server once and the File adapter is picking it up and when i check the SXI_MONITOR it appears twice or some times thrice and the cont

  • Youtube Not working in Mozilla Firefox 30.0

    in youtube any video play for 1 Sec and Stop. black screen came and showing error

  • What's the deal with AmEx?

    I'm currently rebuilding after a period of unemployment and lower income during the recession. From the second half of 2012 on, I have had no new chargeoffs/lates on any of my credit reports. Within the past year, I opened new deposit accounts with B