Write a function for a button. - Flash
Write a function for a button.
The following are the steps to create a function for a button:
- A function is a script to write once and use repeatedly in a document that performs a task.
- Here is the process to create a function to appear a movie clip when the mouse button is released.
- Click after the last line of code in the Script pane of the Actions panel.
- Press enter and type function to show animation.
- Press enter and click on Insert Target Path on the top of the Actions panel.
- Select onButton_btn from the hierarchical tree, and click on OK.
- Type a period (.) i.e., a dot in the Script pane and double click onRelease from the list of code.
- This appears as ‘ this.onButton_btn.onRelease=function()
- Press enter and type the script - screen_mc_visible=true;
- Press enter to terminate the statement.