dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5
  1. #1
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    916

    How to load an swf in an swf

    Hi, does anyone know how to load and swf in a parent swf, it works fine for me but the child swf can not use any stage. functions for some reason which causes me to only be able to scale the child swf by using a movieclip as a stage and stretching everything based on the mc stage.
    app awesome like opposum

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,768
    Hi

    Without seeing any example or code or fla regarding your issue, have you tried referencing the class

  3. #3
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    916
    The swf loader:
    PHP Code:
    var new_swf:Loader = new Loader();

    var 
    loader:Loader = new Loader();
    var 
    loaderInfoStuff:LoaderContext = new LoaderContext(falseApplicationDomain.currentDomainnull);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETEcache_load);

    loaderInfoStuff.allowCodeImport true;

    function 
    load_init_swf(a){
    new_swf.contentLoaderInfo.addEventListener(Event.COMPLETEinit_swf_loaded);
    new_swf.load(new URLRequest(a));
    }
    function 
    init_swf_loaded(e:Event):void{
    var 
    myBytes=e.target.bytes;
    loader.loadBytes(myBytesloaderInfoStuff);
    new_swf.contentLoaderInfo.removeEventListener(Event.COMPLETEinit_swf_loaded);
    }

    function 
    cache_load(e:Event):void{
    var 
    loaded_mc e.target.content as MovieClip;
    addChild(loaded_mc)
    }
    load_init_swf("swf_client.swf"); 
    For the child swf just use any stage.addEventlistener functions and they wont run but addEventlistener alone will, I'll treat your paypal to fix this.
    app awesome like opposum

  4. #4
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,762
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  5. #5
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    916
    Wow I tried a few from online and none worked, well that link worked thanks northcode, let me get your paypal email or else.
    app awesome like opposum

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

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.