运行时错误wirth FLASH CS5

时间:2011-03-25 03:05:26

标签: actionscript-3 runtime

当我到达第三帧时,我遇到了运行时错误。但是,运行时错误说它在frame2:6上。 第3帧的代码为:

stop();
buy_cups.addEventListener(MouseEvent.CLICK, buycups);
function buycups(event:MouseEvent):void{
    cash1 = cash1 - 0.25;
    cups=cups+5;
}
buy_ice.addEventListener(MouseEvent.CLICK, buyice);
function buyice(event:MouseEvent):void{
    cash1 = cash1 - 0.25;
    ice=ice+1;
}
buy_lemons.addEventListener(MouseEvent.CLICK, buylemons);
function buylemons(event:MouseEvent):void{
    cash1 = cash1 - 1.25;
    lemons1=lemons1 + 2;
}
buy_straws.addEventListener(MouseEvent.CLICK, buystraws);
function buystraws(event:MouseEvent):void{
    cash1 = cash1 - 0.25;
    straws=straws+100;
}

第2帧的代码为:

stop();
//stand.addEventListener(MouseEvent.CLICK, check);
addEventListener(Event.ENTER_FRAME, check);
function check(ev : Event) : void {
    cash.text.text = cash1;
    storage_count.text.text = storage1;
    lemons_count.text.text = lemons1;
    cups_count.text.text = cups;
    straws_count.text.text = straws;
    ice_count.text.text = ice;
}
shop.addEventListener(MouseEvent.MOUSE_OVER, over_shop);
function over_shop(event:MouseEvent):void{
    shop.gotoAndStop(2);
}

shop.addEventListener(MouseEvent.CLICK, shop_now);
function shop_now(event:MouseEvent):void{
    gotoAndStop(3);
}

我收到的错误是: 警告:由于您的发布设置,没有库链接为运行时共享库​​(RSL):AIR Android [SWF] Lemonade-boy.swf - 解压缩后的942698字节 TypeError:错误#1009:无法访问空对象引用的属性或方法。     在Lemonade_fla :: MainTimeline / check()[Lemonade_fla.MainTimeline :: frame2:6]

如果任何人知道可能是什么,或是什么,请告诉我。谢谢!

1 个答案:

答案 0 :(得分:0)

它正在尝试访问返回null的内容(也称为尚未定义)

需要为该帧加载它。 storage1在哪里? (那是第2帧第6行吧?)