Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 1120访问未定义的财产Ibar&;工控机_Actionscript 3_Flash_Actionscript - Fatal编程技术网

Actionscript 3 1120访问未定义的财产Ibar&;工控机

Actionscript 3 1120访问未定义的财产Ibar&;工控机,actionscript-3,flash,actionscript,Actionscript 3,Flash,Actionscript,您最好启用“允许调试”,但是,问题出现在第14行和第15行。这意味着您在内存中没有这些名称的对象。如果您在Flash IDE中工作,并且这些是库中的符号,请将它们添加到后台,问题将得到解决。嗯,此代码结构看起来有点杂乱无章。我不确定这些更改是否重要(因为我目前无法访问flash),但我通常会这样写: stop(); import flash.display.*; this.stop(); this.loaderInfo.addEventListener(ProgressEvent.PR

您最好启用“允许调试”,但是,问题出现在第14行和第15行。这意味着您在内存中没有这些名称的对象。如果您在Flash IDE中工作,并且这些是库中的符号,请将它们添加到后台,问题将得到解决。

嗯,此代码结构看起来有点杂乱无章。我不确定这些更改是否重要(因为我目前无法访问flash),但我通常会这样写:

stop();


import flash.display.*;

this.stop();


this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);

function PL_LOADING(event: ProgressEvent): void {
    var pcent: Number = event.bytesLoaded / event.bytesTotal * 100;

    lbar.scaleX = pcent / 100;

    lpc.text = int(pcent) + "%";

    if (pcent == 100) {
        this.gotoAndStop(2);

    }
}

像这样的小改动以及周到的组织可以节省您的代码。如果您的代码仍有问题,请通知我,我会尽力帮助您。

Good point@Atriace。处理令人困惑的编译器错误时,您希望启用“允许调试”。
stop();
import flash.display.*;
//no need for this.stop() if you've already stopped

this.loaderinfo.addEventListener(ProgressEvent.PROGRESS,PL_LOADING);

function PL_LOADING(e:ProgressEvent):void{
//possibly part of the problem is that the var keyword was on the wrong line
var pcent:Number = e.bytesLoaded/e.bytesTotal*100;
ibar.scaleX=pcent/100;
ipc.text=String(int(pcent)+"%");
//typically you want to make it clear that it's a string when dealing with text fields
if(pcent==100){
    gotoAndStop(2);
    }
}