展开全部
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml
" layout="absolute" minWidth="955" minHeight="600">
<mx:Script>
<![CDATA[
protected function button1_clickHandler(event:MouseEvent):void
{
if(this.btn2.visible){//按钮2可见
this.btn2.visible=false;
this.btn1.label = "显示按钮2";
}else{
this.btn2.visible =true;
this.btn1.label = "隐藏按钮2";
}
}
]]>
</mx:Script>
<mx:Button id="btn1" x="133" y="133" width="142" height="45" label="隐藏按钮2" click="button1_clickHandler(event)"/>
<mx:Button id="btn2" x="379" y="134" width="125" height="43" label="按钮2"/>
</mx:Application>
希望对你有帮助!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询