flash实现背景移动package cn.flash023{
import fl.controls.Button;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.display.Sprite;
public class Ving extends Sprite {
private var show_sprite:Sprite;
private var point:uint;
public function Ving():void {
show_sprite=new Sprite;
point =new uint;
init();
}
private function init():void {
addChild(show_sprite);
for (var p:uint=0; p<9; p++) {
var _pinging=new Ping(String(p+1));
_ping.x=p%3*550,_ping.y=uint(p/3)*400;
show_sprite.addChild(_ping);
_ping.addEventListener("live",onClick);
}
}
private function onClick(_evt:MouseEvent):void {
var _pinging =_evt.target as Ping;
point!=_ping["_btnmode"]&&show_sprite.addEventListener ("enterFrame",moveShow);
point=_ping["_btnmode"];
}
private function moveShow(_evt:Event):void {
var _sprite:Sprite=_evt.target as Sprite;
_sprite.x+=(-point%3*550-_sprite.x)*.2;
_sprite.y+=(-uint(point/3)*400-_sprite.y)*.2;
Math.abs (-point%3*550-_sprite.x)<.2&&Math.abs (-uint(point/3)*400-_sprite.y)<.2&&_sprite.removeEventListener ("enterFrame",moveShow);
}
}
}
package cn.flash023{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.Event;
import fl.controls.Button;
import flash.text.TextField;
public class Ping extends Sprite {
public var _btnmode:uint;
public function Ping(_l:String=""):void {
label_txt.text=_l;
_btnmode=new uint;
init();
}
private function init():void {
for (var _p:uint=0; _p
if (_btn) {
_btn.label =String(_p);
_btn.addEventListener("click",onClick);
}
}
}
private function onClick(_evt:Event):void {
var _btn:Button =_evt.target as Button;
_btnmode=uint(_btn.label)-1;
dispatchEvent(new MouseEvent("live"));
}
}
}
我的博物馆故事 官方安卓版v1.61.2
我的博物馆故事是一款以消除为主题的经营养成类手游,在这里玩家
专业模拟飞行10 手机版v12.2.4
专业模拟飞行10安卓版是一款飞行休闲手游,顶尖的物理飞行引擎
动物起义战斗模拟器二琳同款 最新版v4.1.1
动物起义战斗模拟器是一个非常有趣的模拟类游戏,玩家可以召唤各
迷你世界七周年 安卓手机版v1.43.0
迷你世界7周年是一款由《迷你世界》官方推出的庆祝特别版本,在
劫后公司无限资源版 v1.0.5.1
劫后公司内置菜单版是游戏的破解版本,在该版本中为玩家提供了内