In Flash ActionScript 3, How to Stop a newly-loaded SWF file from playing automatically?

Posted on 2009-12-31
Last Modified: 2012-05-08
In ActionScript 3, the following script loads an external movie clip (swf file), and plays it automatically:
var mc:Loader = new Loader();
var urlReq:URLRequest = new URLRequest("SomeMovieClip.swf");

How can I prevent the newly loaded SWF file from playing automatically, and instead have it go to frame 1 and stop?
Question by:HarmonyClaire
    1 Comment

    Accepted Solution

    I solved the problem myself finally, you have to trap for the "initialized" event, and then stop the movie within that  event function.

    //Load movie
    var urlReq:URLRequest = new URLRequest("SomeMovieClip.swf");
    var mc:Loader = new Loader();
    mc.contentLoaderInfo.addEventListener(Event.INIT, doneInitializing);

    //Script to run after movie load is initialized
    function doneInitializing(evt:Event):void {

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now