hide buttons outside the for-loop
Hi,
I'm trying to hide listbuttons on fullscreen mode. But hiding only the last one.
how can i hide total buttons on fullscreen mode.
function playlistLoaded(e:Event):void {
xmlPlaylist = new XML(urlLoader.data);
//trace(xmlPlaylist.vid[0].@src);
for (var i:int=0;i<xmlPlaylist.vid.length();i++) {
var listbutton:Button = new Button();
listbutton.x = 482;
listbutton.y = i * 19 + 1;
listbutton.width = 197;
listbutton.height = 20;
listbutton.label = xmlPlaylist.vid.attribute("desc");
listbutton.name = xmlPlaylist.vid.@src+"__"+i;
listbutton.addEventListener(MouseEvent.CLICK, playVidlist);
addChild(listbutton);
}
}
//==================FullScreen SetUp ========================
//===========================================================
controlBar.fullscreen_btn.addEventListener(MouseEvent.CLICK, fullscreenOnClicked);
controlBar.normal_btn.addEventListener(MouseEvent.CLICK, fullscreenOffClicked);
stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreen);
function fullscreenOnClicked(e:MouseEvent):void
{
stage.displayState = StageDisplayState.FULL_SCREEN;
}
function fullscreenOffClicked(e:MouseEvent):void
{
stage.displayState = StageDisplayState.NORMAL;
}
function onFullscreen(e:FullScreenEvent):void
{
if (e.fullScreen)
{
controlBar.fullscreen_btn.visible = false;
controlBar.normal_btn.visible = true;
//listbutton.visible = false;
removeChild(listbutton);
controlBar.x = (Capabilities.screenResolutionX - 480) / 2;
controlBar.y = (Capabilities.screenResolutionY - 116);
vidDisplay.height = (Capabilities.screenResolutionY);
vidDisplay.width = vidDisplay.height * 4 / 3;
vidDisplay.x= (Capabilities.screenResolutionX - vidDisplay.width) / 2;
}
else
{
controlBar.fullscreen_btn.visible = true;
controlBar.normal_btn.visible = false;
//listbutton.visible = true;
addChild(listbutton);
controlBar.x = 0;
controlBar.y = 244;
vidDisplay.width = 480;
vidDisplay.height = 360;
}