//左边界
var _left:uint=10;
//顶部位置
var _top:uint=10;
//定义一个自己创建的类
var my_mc:mc;
//希望在场景中显示多少个MC
for (var i:uint=0; i
//实例化
my_mc=new mc();
//当横坐标超出舞台的时候,将MC的横坐标初始化
if (_left+my_mc.width>550) {
_left=10;
//纵坐标垒加
_top+=my_mc.height+10;
}
my_mc.x=_left;
my_mc.y=_top;
_left+=my_mc.width+10;
//为MC添加鼠标点击的动作
my_mc.addEventListener(MouseEvent.CLICK,_goto);
//在舞台中显示出来
addChild(my_mc);
}
function _goto(e:MouseEvent):void {
//鼠标当前正在操作的对象发生变化,跳到随机帧
e.currentTarget.gotoAndStop(int(Math.random()*5));
}
var _left:uint=10;
//顶部位置
var _top:uint=10;
//定义一个自己创建的类
var my_mc:mc;
//希望在场景中显示多少个MC
for (var i:uint=0; i
//实例化
my_mc=new mc();
//当横坐标超出舞台的时候,将MC的横坐标初始化
if (_left+my_mc.width>550) {
_left=10;
//纵坐标垒加
_top+=my_mc.height+10;
}
my_mc.x=_left;
my_mc.y=_top;
_left+=my_mc.width+10;
//为MC添加鼠标点击的动作
my_mc.addEventListener(MouseEvent.CLICK,_goto);
//在舞台中显示出来
addChild(my_mc);
}
function _goto(e:MouseEvent):void {
//鼠标当前正在操作的对象发生变化,跳到随机帧
e.currentTarget.gotoAndStop(int(Math.random()*5));
}