首页 > 学院 > 开发设计 > 正文

AS3常用方法

2019-11-06 09:22:09
字体:
来源:转载
供稿:网友
1、延时执行一个方法setTimeout(timeover,10000);function timeover(){}
2、播放位置的跳转gotoAndStop(1);gotoAndPlay(1);
3、获取当前播放的帧的位置fig = currentFrame;//获取当前帧
4、当前鼠标点击的位置var xxUp:int = int(e.localX);var yyUp:int = int(e.localY); 
5、隐藏当前元件mc_name.visible = false;
6、直接复制在时间轴上可以控制音乐的大小(0~1)soundTransform = new SoundTransform(0.2);
7、父类元件MovieClip(MovieClip(this.parent).parent).mc_name;MovieClip(this.parent).mc_name 等价于 this.parent["mc_name"];
8、根目录的使用root["mc_name”]; 这样就可以一级级的向下寻找了元件 而不用受制于元件的位置
9、removeChild(); removeChildAt(0);var num:int = this.stage.numChildren;//获取元件的个数
10、帧方法//注册ENTER_FRAM事件侦听器 icon_x.addEventListener(Event.ENTER_FRAME, mover);function mover(e: Event): void {  }
11、屏蔽左键stage.addEventListener(MouseEvent.RIGHT_CLICK,function(e:MouseEvent):void{});
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表