A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Control external SWF?

  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    7

    Control external SWF?

    Is it possible to control an external SWF file with buttons on the main clip?

    I have an external SWF loading into the stage, but I wanted to control "play" "stop" and "goto" with buttons outside that SWF.

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    This is part of where you control the movie.

    myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, cHandler);
    function cHandler(e:Event):void
    {
    var mc:MovieClip = e.currentTarget.content as MovieClip;
    mc.gotoAndPlay("whatever");// place this in a button function
    }
    myLoader.load(myRequest);
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Junior Member
    Join Date
    Jun 2008
    Posts
    7
    I've found another way to do it.

    var externalSwf:MovieClip;

    externalSwf = MovieClip(myLoader.content);

    Then control the externalSwf with commands like externalSwf.play();

    But thanks any way. You've been very helpful.

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