A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: trying to stop() loaded swf

  1. #1
    Senior Member
    Join Date
    Oct 2008
    Posts
    179

    trying to stop() loaded swf

    I am loading an external swf that is just an animation. When I open a section in my app, I want that swf to stop playing. I cant manage to figure out how to stop it. Here is my function to load the swf
    PHP Code:
    var target:String "data/clouds.swf";
    var 
    req:URLRequest = new URLRequest(target);
    var 
    ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETEcloudsHandler);
    ldr.load(req);
    cloudHolder.addChild(ldr);
    //then trying to stop it
    function buildVideo():void
    {
        var 
    cloudHolder.getChildAt(0);
        
    c.content.stop(); //this does not work

    any idea?

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    PHP Code:
    function cloudsHandler(e:Event):void{
        
    MovieClip(e.target.content).stop();


  3. #3
    Senior Member
    Join Date
    Oct 2008
    Posts
    179
    I am not using it in my event handler. Its in a function that has no relation to the loader. I'll try this after my photoshop batch is done
    PHP Code:
    function buildVideo():void
    {
        var 
    cloudHolder.getChildAt(0);
        
    MovieClip(c.content).stop();


  4. #4
    Senior Member
    Join Date
    Oct 2008
    Posts
    179
    alright i figured it out. I named the movie clip in my clouds.fla and then did c.content.cloudmc.stop();
    Last edited by rondog; 12-22-2008 at 08:03 PM.

  5. #5
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    PHP Code:
    var myLoadedMC:MovieClip;

    function 
    cloudsHandler(e:Event):void
        
    myLoadedMC MovieClip(e.target.content);
    }


    // ...


    function buildVideo():void{
        
    myLoadedMC.stop();


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center