2 Replies Latest reply on Aug 17, 2009 6:45 PM by alan_lindsay

    Flash 8: Strange swf-in-swf behaviour

    alan_lindsay Level 1

      My application consists of a number of screens/swf's which layer on top of each other.


      layer 0 - user sign-in

      layer 900 - mainmenu

      layer 910 - transaction A part 1

      layer 920 - transaction A part 2


      So, a successful sign-in calls in mainmenu.swf and selection of transaction A-1 calls that swf in. Then, interaction with transaction A-1 leads to loading the A-2 swf and that's where the "strangeness" exists. A-1 has a grid and a listener for that grid. When A-2 loads and you click anywhere on the screen that the A-1 grid would have covered, the A-1 listener responds! I'm surprised by that but perhaps that's my ignorance, is it?

        • 1. Re: Flash 8: Strange swf-in-swf behaviour
          alan_lindsay Level 1

          OK, further exploration tells me that this behavior ALWAYS occurs. Clicking the top layer on a location where a lower layer has a listener or button, causes that object to respond. How can I stop this? When I launch an upper layer, do I kill off the preceeding/lower layer?


          I re-coded some screens to use getNextHighestDepth() instead of nominating layers(this had no effect on the problem) and closely checked for interaction between the first few screens.


          Level 0 - login

          next highest - mainmenu

          next highest - menu2


          There was no uncontrolled interaction between login and mainmenu but there was between mainmenu and menu2 in fact there is uncontrolled interaction between mainmenu and any higher-loaded swf.

          • 2. Re: Flash 8: Strange swf-in-swf behaviour
            alan_lindsay Level 1

            Sorry folks, I seem to keep asking difficult or challenging questions about which nobody is prepared to share their experiences (and I'm CERTAIN that, as a newby, I'm not in unchartered terrritory!). Anyway, I've found a workaround that may be of interest to other newby's.


            I interposed a swf which has no active components on stage and which acts as a launcher. It is launched by a successful login and then will launch the main menu. As selection on the main menu will initiate a request to the launcher to "kill' the main menu and launch a nominated swf. When that completes it requests the launcher to "kill" it and launch the main menu. The launcher also holds any persistent data needed to be shared amongst swf's. In this model, there are only ever 3 layers active:


            Layer 0 - Login/Logout

            Layer 1 - Launcher

            Layer 2 - menu or transaction


            There's a bit of traffic between swf's and I'm sure it's not the most elegant solution but it has one distinct advantage - it works!