跟踪闪烁到不存在的线,闪光CS5 / AS3 [英] Tracing flash to a line which doesn't exist, flash CS5/AS3
本文介绍了跟踪闪烁到不存在的线,闪光CS5 / AS3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在帧1的错误:26。在code这个框架(完整的code)为如下。我得到的错误信息是:
类型错误:错误#1034:类型强制失败:无法转换为0〜flash.display.DisplayObject。
在用于fl.motion :: AnimatorBase /播放()
在用于fl.motion :: AnimatorBase $ / processCurrentFrame()
在用于fl.motion :: AnimatorBase / handleEnterFrame()
在flash.display使用::影片剪辑/ nextFrame()
在Lemonade_fla :: MainTimeline /开始()[Lemonade_fla.MainTimeline ::帧1:26]
如果我正确地读此消息,它说遇到上没有任何code上有一条线一个错误。见(21线不是26 /不管):
进口对象类型:flash.events.Event;
停止();
VAR bg1_menue:声音=新的声音();
bg1_menue.load(新的URLRequest(/ bg1_menu / bg1_menu.mp3));
bg1_menue.play();
VAR cash1:数= 5.00;
VAR maximum_storage:数= 500;
VAR存放1:数= lemons1;
VAR lemons1:数= 10;
VAR杯:数= 10;
VAR吸管:数= 100;
VAR冰:数= 5;
VAR饮料:数= 0;
startbt.addEventListener(MouseEvent.CLICK,开始);
功能开始(事件:MouseEvent)方法:无效{
nextFrame();
}
帧2 code:
进口对象类型:flash.events.Event;
停止();
stand.addEventListener(MouseEvent.CLICK,检查);
的addEventListener(Event.ENTER_FRAME,检查);
功能检查(EV:事件):无效{
cash.text.text = cash1;
lemons_count.text.text = lemons1;
cups_count.text.text =杯;
straws_count.text.text =秸秆;
ice_count.text.text =冰;
}
如果你需要,我会提供其他来源的code吧。
shop_mc.addEventListener(MouseEvent.CLICK,shopnow);
功能shopnow(事件:MouseEvent)方法:无效{
nextFrame();
}
对于(VAR我:数量= 0;我2;我++)
{
VAR guide_tut:指南=新指南();
的addChild(guide_tut);
}
解决方案
首先:
VAR存放1:数= lemons1;
VAR lemons1:数= 10;
这是不好的,交换两行。
抢
I got an error on frame1:26. The code for this frame (the complete code) is below. The error message I get is is:
TypeError: Error #1034: Type Coercion failed: cannot convert 0 to flash.display.DisplayObject.
at fl.motion::AnimatorBase/play()
at fl.motion::AnimatorBase$/processCurrentFrame()
at fl.motion::AnimatorBase/handleEnterFrame()
at flash.display::MovieClip/nextFrame()
at Lemonade_fla::MainTimeline/begin()[Lemonade_fla.MainTimeline::frame1:26]
If I'm reading this message correctly it says it encounters an error on a line which doesn't have any code on it. See (21 lines not 26/whatever):
import flash.events.Event;
stop();
var bg1_menue:Sound = new Sound();
bg1_menue.load(new URLRequest("/bg1_menu/bg1_menu.mp3"));
bg1_menue.play();
var cash1:Number = 5.00;
var maximum_storage:Number = 500;
var storage1:Number = lemons1;
var lemons1:Number = 10;
var cups:Number = 10;
var straws:Number = 100;
var ice:Number = 5;
var drinks:Number = 0;
startbt.addEventListener(MouseEvent.CLICK, begin);
function begin(event:MouseEvent):void{
nextFrame();
}
Frame 2 Code:
import flash.events.Event;
stop();
stand.addEventListener(MouseEvent.CLICK, check);
addEventListener(Event.ENTER_FRAME, check);
function check(ev : Event) : void {
cash.text.text = cash1;
lemons_count.text.text = lemons1;
cups_count.text.text = cups;
straws_count.text.text = straws;
ice_count.text.text = ice;
}
If you need, I'll supply other source code for it.
shop_mc.addEventListener(MouseEvent.CLICK, shopnow);
function shopnow(event:MouseEvent):void{
nextFrame();
}
for(var i:Number = 0; i<2; i++)
{
var guide_tut:guide = new guide();
addChild(guide_tut);
}
解决方案
First of all:
var storage1:Number = lemons1;
var lemons1:Number = 10;
This is bad, swap the two lines.
Rob
这篇关于跟踪闪烁到不存在的线,闪光CS5 / AS3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文