2 Replies Latest reply on Jun 13, 2007 1:17 PM by OukaHiga

    global .visible=false syntax in flash form application?

    OukaHiga
      Hi all,

      I have a flash form application tutorial file developed in Flash MX Pro 2004 that has over 200 static screens and I see no end in sight of its continued expansion. I need a way to simplify my screen navigation scripts if I'm going to continue with this tool.

      What I have are literall dozens of nested screens that look like thus:

      on(load)
      {
      // button to navigate back to application root
      btn_app.onRelease=function():Void
      {
      var x:String="navigate: App Root";
      trace(x);

      _root.ATHENA.WebRoot.WebFunc.WebType.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvMenu.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvHome.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvMice.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvProjects.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvGenetics.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvReqRoot.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvReqRoot.WebInvReqMenu.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvReqRoot.WebInvReqSum.visible=false;
      _root.ATHENA.WebRoot.WebFunc.WebInvRoot.WebInvReqRoot.WebInvReqMoveRoot.visible=false;

      //etc etc etc

      _root.ATHENA.Home.visible=true;
      _root.ATHENA.RootMenu.visible=true;
      }
      }

      As you can see, I'm trying to create a button that sits on a root screen for a given section that will take the user back to the application's _root

      What I want:

      on(load)
      {
      // button to navigate back to application root
      btn_app.onRelease=function():Void
      {
      var x:String="navigate: App Root";
      trace(x);

      _global.visible=false;

      _root.ATHENA.Home.visible=true;
      _root.ATHENA.RootMenu.visible=true;
      }
      }

      Essentially what I'm asking for is a code snipet that will make all screens in the clip invisible without having to discretely reference them, then rebuild the visible screen path.

      Any help would be greatly appriciated. Thanks in advance!

      --Oukachiru
        • 2. Re: global .visible=false syntax in flash form application?
          OukaHiga Level 1
          anyone? Maybe having the following file owuld help illustrate what my problem is:

          http://transcendents.net/Work/example.fla

          It was an early concept fla for the app, the real app is about 30x bigger and growing.

          An example of the code I'm trying to reduce can be found on ATHENA.WebRoot on the onRelease of btn_w_AthenRootMenu

          You can see there that there are only about 20 lines of code needed in the example file. My real app has almost 500 lines right there. And every time I have a cross-screen-tree navigation event I have 200-400 lines.

          as an aside, you can see where I've inserted some additional code at the suggestion of some forum posters.

          on _root.ATHENA there are a couple of lines trying to declare a pair of public functions, on _root.ATHENA.Home.RootMenu I'm setting the value to the myHold function, and on _root.ATHENA.WebRoot I'm trying to call the hideAll function. Unfortunatly it is not working, and I think it is because even though I've decalred and set the myHold function there are other screens visible other than the one set to that function, so therefore the hideAll fails?