load an external swf on a mc that is on the screen

This seems like a basic question, but if I have a swf file in the same directory as the fla and wants her to be on a mc, is there an easy way? so I make a movieclip on the screen and you want it to load. someone at - it a small example?

Use the loader class to load an external swf.

var loader: Loader = new Loader();

Loader.Load (new URLRequest ("yourexternalswf.swf"));

addChild (loader);  Adds the charger to the current timeline

If you want to add the loader to a movieclip, the method addChild to this movieclip, for example:

yourmovieclip.addChild (loader);

Tags: Adobe Animate

Similar Questions

  • How can I load an external SWF into a clip that is inside another video clip?

    Hello.

    I create my first flash (actionscript 3.0) Web site, but I'm stuck with a visual effect, I want to create.
    I have a window on my website called contentWindow. Whenever you click on a button, this window is supposed to leave the scene, loading the requested content and back on the scene.
    The sliding window is a clip with 83 frames, 21 to enter the stadium, 21 to leave the scene once again, 20 for anything (it's just to simulate the load time) and 21 to the back on the scene.

    Now, my goal is, when the user clicks a navigation button, the window leaves the scene, loading an external SWF with the content and then returned to the scene.

    I have the clip of 'window' with an instance name of "contentWindow". Inside there is an another film clip with an instance name of "contentLoader. The content that the user has requested must appear inside the 'contentLoader.

    Now, when the contentWindow leaves the scene, 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()
  • loading an external swf that loads an object from url

    I am trying to load an external swf which in turn automatically load an object. I want the external swf will only be loaded once the object is loaded in it. for now, it loads the external SWF first, then the external swf file loads the object specified in a URL...

    exactly.  you will need a preloader that checks if your external swf finished loading its dependent objects.

  • Problem with loading an external swf of in an external swf...

    OK, everything was going well on a Web site project, I worked, until yesterday. I will try to explain the whole scenario first, and I'll put the code here too so anyone can try to understand what the problem is. Here is a breakdown of the site:

    1) there a MAIN SWF file that plays an intro and then stops on the last image with the Navigation buttons 'hand'.

    2) in the root folder where the MAIN SWF resides, there is another folder called "sovereign wealth funds", which contains six main external navigation pages, but also another folder called "galleries" which contains additional external SWFs for six pages in the gallery.

    3) on one of the layers of the MAIN SWF, there is a clip called 'mySWFLoadingClip' that the buttons of Navigation of the 'hand' loading and unload pages external to swf. It all works perfectly. The beginning of the problem to the next step. This is the code I used for the buttons of navigation on the MAIN SWF scenario:

    var Xpos:Number = 0.0;
    var Ypos:Number = 0.0;
    var swf:MovieClip;
    var loader: Loader = new Loader();

    var defaultSWF:URLRequest = new URLRequest("swfs/home_page_swf.swf");

    Loader.Load (defaultSWF);
    Loader.x = Xpos;
    Loader.y = Ypos;
    this.mySWFLoadingClip.addChild (loader);
    ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////

    Function universal BTNS
    function btnClick(event:MouseEvent):void {}

    this.mySWFLoadingClip.removeChild (loader);
    var newSWFRequest:URLRequest = new URLRequest ("SWFs /" + event.target.name + ".swf");
    Loader.Load (newSWFRequest);
    Loader.x = Xpos;
    Loader.y = Ypos;
    this.mySWFLoadingClip.addChild (loader);
    }
    Listeners of BTN
    home_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    portfolio_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    services_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    about_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    team_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    contact_page_swf.addEventListener (MouseEvent.CLICK, btnClick);


    4) one of the external navigation SWF pages is called "portfolio_page_swf" and gets loaded into the moveclip of 'mySWFLoadingClip' on the MAIN SWF. This is where the problem begins. The "portfolio_page_swf" has six buttons facing an additional external swf in the file galleries. Now when I open the file "portfolio_page_swf" to test if the buttons work, they work perfect. When I click the buttons, the external swf gallery files appear as they should. But the problem is that when I open the "MAIN SWF" file to test the site, I can click on the main Navigation buttons and they work. I click the portfolio button on the time line of Hand SWF and place of 'portfolio_page_swf' on the stage as it should, but when I click the buttons located in the 'portfolio_page_swf' galleries are not displayed. The page "portfolio_page_swf" buttons work only if I open the file 'portfolio_page_swf' directly. The following code is used in the "portfolio_page_swf":

    var Xpos:Number = 0.0;
    var Ypos:Number = 0.0;
    var swf:MovieClip;
    var loader: Loader = new Loader();

    var defaultSWF:URLRequest = new URLRequest("galleries/gallery_print_swf.swf");

    Loader.Load (defaultSWF);
    Loader.x = Xpos;
    Loader.y = Ypos;
    this.mySWFLoadingClipGALLERY.addChild (loader);
    ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////

    Function universal BTNS
    function btnClick(event:MouseEvent):void {}

    this.mySWFLoadingClipGALLERY.removeChild (loader);
    var newSWFRequest:URLRequest = new URLRequest ("galleries /" + event.target.name + ".swf");
    Loader.Load (newSWFRequest);
    Loader.x = Xpos;
    Loader.y = Ypos;
    this.mySWFLoadingClipGALLERY.addChild (loader);
    }
    Listeners of BTN
    gallery_print_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_packaging_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_web_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_video_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_others_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_logos_swf.addEventListener (MouseEvent.CLICK, btnClick);

    If anyone can help understand me this I would really appreciate. This is a very important project and the deadline is coming up very soon. Please help me understand how to load an external SWF on the main timeline and then charge an additional external swf within the first external swf. I'm puzzled.

    If I'm following the structure you describe, it's probably a problem of targeting.  If you load a swf into another swf I think the scenario is the same that if you load a swf in a web page...  The charging base is the document down the chain, which is your main swf if you test Flash (otherwise it would be so stable web page in a web page).  So when your portfolio is responsible in the hand, it's like living in the folder of the hand, so your swf portfolio should probably include sovereign wealth funds in targeting... as in...

    var defaultSWF:URLRequest = new URLRequest("swfs/galleries/gallery_print_swf.swf");

  • Load an external swf as a different size?

    Hello - it seems that it would be quite easy, but I couldn't understand the research in the Flash help documentation.

    I am using Flash CS3 and AS2.0.  I use the loadMovie function to load an external swf into an empty movieclip.  The problem is that the external swf file is bigger that the image I am load, so I would load it with specific width/height settings (essentially to load it in and resize it down).

    What would be the command loadMovie to do it with?

    Thank you!!!

    You will have to wait for the movie to load before you can change its size.  To know that the film is loaded, you want to override the method MovieClipLoader.loadClip, loadMovie.  The loadClip method supports having a similar earpiece so that you can know when the file is loaded and ready to use.  If you are looking for the MovieClipLoader.addListener method in the help documentation, there is an example that should help you through most of it.  He uses an onLoadInit event listener which is what you want to use because you have to wait as the SWF to be loaded and ready for use before trying to influence it.

  • Load an external SWF since an external SWF

    Hello

    I'm kinda caught between a rock and a hard spot on a flash site project. Here's the situation:

    I created a parent movie (that load all external SWF inside) that has built-in navigation menu. However, my client wants to place me some more inside the external swf links that lead to other pages (external SWF) on the site. Is this possible? I was hoping there is a way to tell a button in an external SWF to make the parent film from an external SWF.

    ANY help is appreciated. Thank you.

    Another question: it does not use the _parent script?

    Elijah

    If you want, for example, a button in welcome.swf to load a SWF into support, then welcome.swf will be unloaded. is that what you want? If so, in welcome.swf you can use:

  • Load an external SWF file without overwriting my container SWF (AS2) file

    Hello world

    I want to load an external SWF with AS2, but file without overwriting my container file. How can I achieve this? What is the correct code?

    Here is the code I use :

    loadMovieNum ("external.swf", 0);

    countdown = function() {}

    trace ("OK");

    }

    countdownIt = setInterval (countdown, 1000);


    It works well, but as I said, it overwrites my container SWF file. If I load into level 1, my container file works but not the one I try to load... .



    Can someone help me with this, please?

    Try to use the loadMovie method... meaning container.loadMovie.  See below for an explanation: Load external in another SWF SWF

    If the loaded file does not work when you load it, it is probably because you have references to _root in there who do not find the expected _root.  You must set the file loaded _lockroot property to be true.

  • Need help to load an external SWF

    I'm not very proficient in Flash, so any help will be greatly appreciated. I am trying to load an external SWF with the following code:

    T1_Bttn_BloodCar.onRelease = function() {}

    (" t1_images_mc.loadMovie("images/T1_Gallery/BloodCar_SWF/T1_BloodCar.swf ");

    t1_images_mc._alpha = 0;

    It loads the SWF file, but it is not playing correctly when I test it. Here's how the loaded movie is supposed to look like:

    http://www.theroboteye.com/T1_BloodCar.html

    But instead, he plays without the transitions, like this:

    http://www.theroboteye.com/TRE2009b.html

    I tried to figure this out for a few days and have tried to add "this ._lockroot = true;" to the SWF I am trying to load, but I can't play properly. Can someone tell me what I am doing wrong? Thanks in advance.

    Try using MovieClipLoader (loadClip method) class rather than the loadMovie method.  In this way, you can have a listener who expects the movie to be loaded and then pull it in-game, by assigning actions and properties after the fact.

  • After the loading of barbie, equestrian club, his game is ok but the screen is black and doesn't let me do anything

    After the loading of barbie, equestrian club, his game is ok but the screen is black and doesn't let me do anything

    Hello

    1. what operating system is installed on your computer?
    2. is it works much earlier?
    3. don't you make changes before the problem?

    Check if the game is compatible with Windows 7 Compatibility Web site. The game mentioned above is not listed in the compatibility Web site, it may or may not be compatible with Windows 7.

    I suggest that you follow these steps and check if the problem persists.

    Step 1:

    Update of your display drivers and check if the problem persists.

    Step 2:

    Reduce hardware acceleration and check.
     
    a. click the Start button, Control Panel.
    b. now, select appearance and personalization. under display, select adjust screen resolution.
    c. now, select adjust the resolution.
    d. click Advanced settings.
    e. now, click the Troubleshooting tab, and select the change settings button.
    f. in the Security dialog box, click on continue.
    g. move the hardware acceleration slider to the third notch.
    h. click OK.
    i. restart Windows.

    Step 3:

    If the game worked fine in the earlier version of the operating system, I suggest you run the game in compatibility mode.

  • How to stop messages that appear on the screen locked when they arrive?

    How to stop messages that appear on the screen locked when they arrive?

    Settings > Notifications > Messages > turn off display on the lock screen. -AJ

  • When Windows starts it is always a dialogue box that flashes on the screen and the CPU usage high (above 50%), after I connect sometimes for several minutes.

    Original title: at the start of Windows there is always a dialogue box that flashes on the screen, but I've known idea what it is.

    How can I determine which program is using this dialog box? I also don't expect high utilization of the processor (over 50%) after that I connect sometimes for several minutes. I see not all applications running in the Task Manager. The amount of CPU utilization in the services tab doesn't match what I see compared to what the gadget is read in my sidebar. Any ideas?

    Thanks in advance

    Hi Soan,

    1. What is exactly mentioned in the dialog box?

    2. when the problem started?

    3. did you of recent changes on the system?

    Method 1:

    Step 1:

    You can check if the problem occurs in safe mode.

    Start your computer in safe mode

    Step 2:

    If you are not faced with the question in safe mode, you can perform a clean boot and check.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    After the troubleshooting steps, please refer to clean the boot link to put the computer to normal startup mode.

    Method 2:

    You can read the following article and perform a full scan of security on your computer.

    Microsoft safety scanner

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss. You can take a backup of important data before performing analysis.

    Method 3:

    You can also read the following article and try to optimize the performance of Windows Vista.

    Optimize the performance of Microsoft Windows Vista

    Hope this information is useful.

  • When I close my laptop running 2 files and when I do the closing and after that I open the screen is white... what I need to do?

    When I close my laptop running 2 files and when I do the closing and after that I open the screen is white... what I need to do?

    Hello

    Let us try these methods and check if that helps.

    Method 1.

    You can try the last good known Configuration and check if that helps.

    Using the last good known Configuration: http://windows.microsoft.com/en-in/windows7/using-last-known-good-configuration

    Method 2.

    You can use the restore points for Windows 7 to return to a previous state, when your computer was working properly.

    System Restore: http://windows.microsoft.com/en-us/windows7/products/features/system-restore

    Important: System Restore will return all system files not as documents, email, music, etc., to a previous state. These files of types are completely affected by the restoration of the system. If it was your intention with this tool to recover a deleted file to non-system, try using a file instead of system restore recovery program.

    Let us know if you need assistance with any Windows problem. We will be happy to help you.

  • When you watch a movie on netflix after that 10 minutes, the screen turns white

    original title: when you watch a movie on netflix after 10 minutes, the screen goes white, I can hear the movie but not see it. How to stop going empty?

    When you watch a movie on netflix after that 10 minutes, the screen becomes white, I can hear the movie but not see it. How to stop going empty?

    If I move it, it comes back. I went to personalize and click never. I know you if it's ok now!

  • Firefox start page - the page went so big that it overwhelms the screen, how do I resize the start page

    Start page for Firefox - I don't know how the original size of the page disappeared so large that it overwhelms the screen. I don't know what button I pressed the home page becomes so big on the screen.

    Please help me how to resize the start page. Thanks.
    

    Press 'left ctrl' + '0 '. (click on "View" on the menu bar (or press the 'Alt' button first to open the menu bar), then 'zoom', then 'normal'.)

  • Loading an external SWF that loads XML

    Hey all, I have a SWF that loads a swf file in that load images from a XML file with Ned Murphy.  I have a new problem with him.  It works everywhere I try except on the Web server.  When I try I get nothing.  It does not seem to load external SWf file or it cannot load the XML file.  I don't know why.  Has anyone encountered this before? Thank you.

    EDIT

    It works if I try the SWF for the Web server but when I embed in an HTML file and run it through a broweser I get nothing.

    If the swf file is one of the html page that incorporates, you might have to adjust how target you files that loads SWFs.

    When you embed a SWF in a web page, whatever is in that loads the swf file must be targeted as if the swf is in the same folder as the html page that got him.  So if the html page uses something like "flash/main.swf" to integrate the SWF of high level, so if the top-level file is loaded another swf from the same flash file that it should also use the "flash/other.swf" without worrying that it is in the same folder on the server.  When it is embedded in the page, it's like being anywhere where this page.

Maybe you are looking for