![]() ![]() | |
您刚才创建了这样一个函数:它会在用户单击鼠标按键然后松开时,将影片剪辑的 visible 属性设置为 true。您可能已经猜到隐藏 screen_mc 影片剪辑的函数的创建方法:当用户单击“关”按钮时,将影片剪辑的 _visible 属性设置为 false。现在,您就可以创建该函数。
offButton_btn。
记住,先前您曾将 offButton_btn 这一实例名称指定给了一个实例。
visible 属性从 true 更改为 false。function to hide animation。
您的整个脚本应如以下所示:
//Initialize document to hide screen movie clip。
this.screen_mc._visible = false;
//function to show animation
this.onButton_btn.onRelease = function(){
screen_mc._visible = true;
};
//function to hide animation
this.offButton_btn.onRelease = function(){
screen_mc._visible = false;
};
![]() ![]() | |