1.
|
In the Script pane, select the entire function that you just typed, including the comment, curly brackets, and semicolon. Copy the text as you normally would, using Control+C (Windows) or Command+C (Macintosh).
|
2.
|
In the Script pane, place the insertion point after the last line of code. Then press Enter (Windows) or Return (Macintosh) twice, and paste the text as you normally would, using Control+V (Windows) or Command+V (Macintosh).
|
3.
|
In the copied function, change the text in onButton_btn to read offButton_btn.
Remember, earlier you assigned an instance name of offButton_btn to an instance. |
4.
|
In the copied function, change the visible property of the screen_mc movie clip from true to false.
|
5.
|
In the copied function, change the commented text after the slashes to read function to hide animation.
Your entire script should appear as follows: // 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; }; |
by
updated