Current location - Education and Training Encyclopedia - Graduation thesis - When flash makes MV, after the loading page is loaded, click the play button and the MV will be played. How to write the button code
When flash makes MV, after the loading page is loaded, click the play button and the MV will be played. How to write the button code
Are the sentences in ActionScript 2.0 given upstairs or in the flash8 era? Now all flash versions have used ActionScript3.0, and the way to create buttons in 3.0 is very similar to that in java. You need to create a function (method) to listen, and then write a listening trigger.

First, create a monitor.

xzgq _ BTN . addevent listener(mouse event。 Click, b2h)

In the previous code, xzgq_btn is the instance name of the button. AddEventListener is used to create a listener.

Mouse event. CLICK is the name of the function (method) whose click event b2h was triggered.

Function b2h(e:MouseEvent)

{

gotoAndPlay(2);

}

In the previous code, function means function, b2h means function name "()", and there is parameter e:MouseEvent.

Is the parameter of the mouse event.

gotoAndPlay(2); Play the animation to the second frame and fill it according to your actual needs.

If your MV is an embedded movie clip, it is xxx. Play (1); Where xxx is the instance name of your movie clip.

I hope I can understand the hardships. If not, please keep asking questions.