It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Flash Forum

global .visable=false syntax?

Moderator: Phate

global .visable=false syntax?

Postby Ouka on Mon Apr 30, 2007 11:40 pm

Hi all,

New-ish to actionscript 2.0. I'm scripting the button commands in my flash application and was wondering if there was an easy way to globally hide all ui screens instead of having to discretely identify each and every screen.

i.e. is there any way to replace the following with some sort of global.visable=false command?

Code: Select all
overview_nav_btn.onRelease=function(Void)
{
  var x:String="transgenic.tg_overview";
  trace(x)
[color=red]    _root.application.main.home.visable=false
    _root.application.main.home.hm_overview.visable=false
    _root.application.main.home.hm_about.visable=false
    _root.application.main.characterizations.visible=false
    _root.application.main.characterizations.char_overview.visable=false
    _root.application.main.reports.visible=false
    _root.application.main.reports.rp_overview.visible=false
    _root.application.main.new-case.visible=false
    _root.application.main.new-case.nc_overview.visible=false
    _root.application.main.reports.visible=false
    _root.application.main.reports.rp_pverview.visible=false[/color][color=blue]    _root.application.main.transgenic.visable=true
    _root.application.main.transgenic.tg_overview.visable=true[/color]
}



Note: if my application were only this large, it wouldn't be much of an issue to create script for each section to show and hide screens as needed. But when complete there are about 5 sub-screens to each of the above screens, as well as 4 other sections each with multiple screens and subscreens. When I hit a navigation button I want to hide ALL screens and subscreens, then rebuild the visable.

I'd rather do something like this:

Code: Select all
overview_nav_btn.onRelease=function(Void)
{
  var x:String="transgenic.tg_overview";
  trace(x)
[color=red]    global.visable=false[/color]
[color=blue]    _root.application.visable=true
    _root.application.main.visable=true
    _root.application.main.transgenic.visable=true
    _root.application.main.transgenic.tg_overview=true[/color]
}


Basically I'm wanting to put my navigation buttons for this section on the _root.application.main screen instead of having to define the same buttons over and over on each sub-section. The downside is I'll have to discretely define the rebuilt visable ui with each button click. The upside is I'll only have to define about 7 buttons once, instead of defining 7 buttons 50+ times each.

Any help would be most appriciated.

--Ouka
Ouka
 
Posts: 0
Joined: Mon Apr 30, 2007 11:31 pm

Who is online

Users browsing this forum: No registered users and 0 guests