A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: have UILoaded swf talk to parent

Hybrid View

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    2

    have UILoaded swf talk to parent

    I have a main fla that will load many external swfs sequencially in a timeline, two frames for each. The main timeline will advance only one frame, play the newly loaded swf and wait. I want each swf to tell the parent when it is done playing, and advance the parent to the next frame where there will be a next button and a replay button. I figured that I need an event listener in the parent, but how do I write the code for the child? I plan to have all loaded swfs coming from an images folder, and that part works fine

    tahnks in advance for any help

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    I'm not sure what version of actionscript you're using, but in AS2, you can refer to the main swf from a child swf using the scope _root

    Like, inside your child swf, you use something like: root.nextFrame(); or something like that.
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Oct 2013
    Posts
    2

    solution

    used this for the child:
    stage.dispatchEvent(new Event("cComplete"));

    and this in the parent:
    stage.addEventListener("cComplete",slideCompleteHd lr);
    function slideCompleteHdlr(e:Event):void{
    this.nextFrame();
    }

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