2007年4月4日星期三

SimpleButton Instances

ActionScript 3 now supports a new class called SimpleButton (flash.display.SimpleButton). This class lets you create button symbols in ActionScript - something previously not possible older versions of ActionScript.

ActionScript Code:

var myButton:SimpleButton = new SimpleButton();


The SimpleButton class contains 4 properties that relate to the various states of a button; upState, overState, downState, and hitAreaState. Create display objects for these states and assign them to those properties to create a fully functional button symbol using ActionScript 3.

ActionScript Code:

myButton.upState = mySprite1;
myButton.
overState = mySprite2;
myButton.
downState = mySprite3;
myButton.
hitAreaState = mySprite4;

0 评论: