Flash 1172:定义caurina。转换:找不到Tweener
嗨,我是flash新手,我正在测试一个来自网站的flash代码 但它会产生如下错误Flash 1172:定义caurina。转换:找不到Tweener,flash,Flash,嗨,我是flash新手,我正在测试一个来自网站的flash代码 但它会产生如下错误 Scene 1, Layer 'Layer 1', Frame 1, Line 1 1172: Definition caurina.transitions:Tweener could not be found. Scene 1, Layer 'Layer 1', Frame 1, Line 1 1172: Definition caurina.transitions:Tweener could not
Scene 1, Layer 'Layer 1', Frame 1, Line 1 1172: Definition caurina.transitions:Tweener could not be found.
Scene 1, Layer 'Layer 1', Frame 1, Line 1 1172: Definition caurina.transitions:Tweener could not be found.
Scene 1, Layer 'Layer 1', Frame 1, Line 31 1120: Access of undefined property Tweener.
Scene 1, Layer 'Layer 1', Frame 1, Line 41 1120: Access of undefined property Tweener.
Scene 1, Layer 'Layer 1', Frame 1, Line 44 1120: Access of undefined property Tweener.
我的代码是:
import caurina.transitions.Tweener;
var last_item:Number;
var first_item:Boolean = true;
var rand_num:Number;
var timer:Timer = new Timer(4000, 1);
// Create MovieClips
for(var i=0; i<8;i++) {
var newNum = i + 1;
var clip = new Array();
clip[i] = new item();
clip[i].name = "clip" + newNum;
clip[i].x = 337;
clip[i].dyn_text.text = newNum;
addChild(clip[i]);
}
// Begin scrolling of content
auto_scroll();
function auto_scroll():void {
//Generate random number between 1 and array length
rand_num = randomNumber(1, clip.length);
//Generate another random number until is doesn't equal the last one
while(rand_num == last_item) {
rand_num = randomNumber(1, clip.length);
}
//Only scroll in content if item is the first one
if(first_item == true) {
Tweener.addTween(getChildByName("clip" + rand_num), {x: 10, time:1, transition:"Linear"});
first_item = false;
last_item = rand_num;
}
timer.addEventListener(TimerEvent.TIMER, transition_items);
timer.start();
}
function transition_items(event:TimerEvent):void {
// Scroll last item out of view and scroll new content in
Tweener.addTween(getChildByName("clip" + last_item), {x: -336, time:1, transition:"Linear", onComplete: function():void {getChildByName("clip" + last_item).x = 337;} });
Tweener.addTween(getChildByName("clip" + rand_num), {x: 10, time:1.2, transition:"Linear", onComplete: function():void {last_item = rand_num;auto_scroll()} });
}
function randomNumber(low:Number=0, high:Number=1):Number {
return Math.floor(Math.random() * (1+high-low)) + low;
}
import caurina.transitions.Tweener;
var最后一项:编号;
变量第一项:布尔值=真;
变量rand_num:数字;
var定时器:定时器=新定时器(4000,1);
//创作电影唇
对于(var i=0;i在Game.fla所在的目录中创建一个新文件夹,命名该文件夹Classes
之后,将caurina文件夹放入Classes文件夹,现在转到文件->动作脚本设置->源路径单击(+)并写入/Classes
这对我起了作用