flash cs4 点不到的按键
发布网友
发布时间:2024-10-18 01:39
我来回答
共2个回答
热心网友
时间:2024-12-15 01:29
swf.addEventListener(MouseEvent.ROLL_OVER,connection);
function connection(event:MouseEvent):void
{
swf.x=10*Math.random()*stage.width;
swf.y=10*Math.random()*stage.height;
}
swf为按钮实例名称;在帧上加入上面的代码!!!
热心网友
时间:2024-12-15 01:30
代码在按钮所在的场景输入,按钮名btn
btn.onRollOver = function() {
X = Math.random()*(Stage.width-this._width);
Y = Math.random()*(Stage.height-this._height);
new mx.transitions.Tween(this, "_x", mx.transitions.easing.Strong.easeOut, this._x, X, 1, true);
new mx.transitions.Tween(this, "_y", mx.transitions.easing.Strong.easeOut, this._y, Y, 1, true);
};