Is there a "CLOSE ALL OTHER SCREENS" command?

hello.

In my application, i have various buttons that open various screens. I’d like only one screen to be open at a time - Is there a way to send a command that hides/closes any open screen whenever a new screen is opened?

can you tell me a little more about your code?

Basically what you would do is loop through all screens/windows, close them, and then open the selected windows

Ok.

I have 10 buttons on one screen. Each button opens a new screen. However, the buttons remain visible - so each time another button is pressed, windows pile up on each other.

Each time a new window is opened, I’d like to send a command to close all other open windows.

You can use javascript…I can’t remember 100% but its something like:

window.self.close();

That doesn’t tell me much about your code. What does the code to launch a window look like?

on (release) {

  // Show Screen behavior
  if((this.SCREEN1 != undefined) && (this.SCREEN1!= null))
  {
    var screen = null;
    var target = this;
    while((screen == null) && (target != undefined) && (target != null))
    {
      if(target instanceof mx.screens.Screen)
      {
        screen = target;
      }
      else
      {
        target = target._parent;
      }
    }
    this.SCREEN1.setVisible(true);

    if((screen != null) && (this.SCREEN1 != screen.rootSlide.currentSlide))
    {
      screen.rootSlide.currentSlide.setVisible(false);
    }
  }
  // End Show Screen behavior

}

Help still needed with this issue.

Anyone?

By the way - I am using the “FLASH FORM APPLICATION” format - everything loads in 1st frame.