Because the event of the button element does not stop except the pop-up, you need to make the component yourself. Then, you need to determine if you have clicked on yourself. -- That's simple
Production process:
1. Draw a shape image you like as a button in the scenario. Select this image and press F8 to convert it into a video clip component. Insert a key frame at 2nd, and change the color (or shape ). Create a layer. Stop () at 1-2 times ()
2. Right-click the component in the library and select "link". A link name is displayed after the identifier. Here, "FANG" is selected"
3. Return to the main scenario. Write code in the first frame:
Var zt: Number;
For (I = 0; I <7; I ++ ){
_ Root. attachMovie ("fang", "fang" + I, I );
_ Root ["fang" + I]. _ x = 55 + I * 45;
_ Root ["fang" + I]. _ y = Stage. height/2;
_ Root ["fang" + I]. sz = I;
_ Root ["fang" + I]. onPress = function (){
H = 0;
Zt = this. sz;
};
_ Root ["fang" + I]. onMouseDown = function (){
This. onEnterFrame = function (){
Trace (this. onEnterFrame );
If (this. sz = zt ){
This. gotoAndStop (2 );
} Else {
This. gotoAndStop (1 );
}
};
};
_ Root ["fang" + I]. onMouseUp = function (){
Delete this. onEnterFrame;
Trace (this. onEnterFrame );
};
}
-----------------------------------------------------------------------