作者ticore ({id:"Ticore"};//)
看板Flash
标题Re: [问题] As2.0 activitLevel 无法作用
时间Fri Jul 20 14:09:54 2012
var cam:Camera = Camera.get();
// 要指定 onActivity function,activityLevel 才会有作用
cam.onActivity = function(mode) {};
var video:Video;
// AS2 不能直接 new Video(),而是要从元件库建立放在舞台上
video.attachVideo(cam);
onEnterFrame = function() {
trace(cam.activityLevel);
};
※ 引述《sherolyn (juji)》之铭言:
: 由於最近在修改前辈的程式
: 前辈是用AS2.0写的
: 我现在要为程式加上摄影机变动侦测 _mc.activitLevel
: 但trace出来都是-1值
: 更诡异的是, 如果我执行as3.0已经写好摄影变动侦测
: 就可以顺利执行了
: 我认真思考是否有那些程式库没有import进来
: 但都无法作用
: 恳请高人指点
: nextFrame();
: //载入背景音乐
: loadMovie("music.swf", 5);
: import flash.display.*;
: import flash.geom.*;
: import flash.display.BitmapData;
: import flash.display;
: cam = Camera.get();
: outport.vid.attachVideo(cam);
: //outport._alpha = 50;
: //box 随影像变化移动
: var timer=setInterval(boxmove,1000);
: timer.start();
: function boxmove(){
: trace(cam.activityLevel);
: var speed:Number=cam.activityLevel;
: if (cam.activityLevel>=5) {
: box._x+=speed;
: }
: if(box._x>300){
: box._x-=400;
: }
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.147.239.66
1F:推 sherolyn:原来如此!可以运作了! 谢谢!! 07/21 09:30