Skip to main content
MathAdor
Participating Frequently
July 16, 2011
Question

Shutting Down activities of loaded CHILD SWF , in main PARENT

  • July 16, 2011
  • 1 reply
  • 294 views

Hi All

  Scenario: in MAIN file, i have a door, when door is open, we can see activities behind the door - LOADED SWF - when the door is shut

                  i would like all the activities behind the door - LOADED SWF to stop

  Problem: my first attempt was to REMOVECHILD when the door closed, however, still functions in child=loaded file are continuing

  Possible Solutions i had in mind: I assumed if PARENT, dispatches an event and CHILD listens, i can say, if the door is closed, dispatch event

                                to the child to stop functions. but it doesnt work, because i assume i dont know how to listen for an event dispatched from parent

     PARENT--------------

     dispatchEvent(new Event("STOPALL"))

    CHILD SWF-----------------

     (what should i write here to target the parent of loaded swf??).addEventListener("STOPALL",stopallactivities)

     function stopallactivities(e:Event)

     { the rest of story...}

    2nd Solution . i read some previous discussions, some recommended LIstening for the DISPATCH EVENT in PARENT, and accessing functions

            inside the CHILD through the parent, which i couldnt achieve using such codes:

          PARENT-------

          LoaderName.addEventListener("STOPALL", (i donno how to say, go to loaded content and run a function there)

    Thank you . I am also open to any alternative solution that helps me shut off the activities when the door closes down, dispatching event was

                        the first thought that came to my mind, not necessarily the only answer i m looking for.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 16, 2011

is your loaded swf setup to stop and start everything (that you want to stop and start)?  ie, you need to setup your loaded swf to do exactly what you want.  there is no magic stop everything function and start everything function.

you can stop and start anything but you have to know what you want to stop and start and set up your swf to do that.