11/24/2010

as2 A跟B交集跟沒交集各發生事件

//這邊可以因為變數引發兩件事情
A.onEnterFrame = function() {
if (this.hitTest(this._parent.B._x, this._parent.B._y, false) != true) {
//AS CODING HERE
B.gotoAndStop(2);//B物件去他本身的第二格
}else {B.gotoAndStop(1);}
};
//以下是A物件拉動的code
A.onPress = function() {
startDrag(this);
};
A.onRelease = function() {
stopDrag();
};

No comments:

Post a Comment