A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Load and Unload external .swf

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Posts
    3

    Thumbs up Load and Unload external .swf

    Hello, Im currently loading an external .swf on click of a button with this action script:

    button.addEventListener(MouseEvent.MOUSE_DOWN, button);
    function button(event:MouseEvent):void {
    import flash.display.Loader;
    import flash.net.URLRequest;
    var request:URLRequest = new URLRequest("mapoverlay.swf");
    var loader:Loader = new Loader();
    loader.load(request);
    addChild(loader);}

    It works fine however I also want to be able to UNLOAD this swf with a click of a button. Seems simple. but I just cant figure it out. Please Help.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    loader.unload();
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    And be aware of the Flash9 issue that causes content to rarely unload:

    http://www.gskinner.com/blog/archive...e_to_unlo.html

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