Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.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 Flex-4预紧器不工作_Actionscript 3_Apache Flex_Flex4 - Fatal编程技术网

Actionscript 3 Flex-4预紧器不工作

Actionscript 3 Flex-4预紧器不工作,actionscript-3,apache-flex,flex4,Actionscript 3,Apache Flex,Flex4,我有简单的自定义预加载程序。 我的代码是 package content { public class CustomPreloader extends SparkDownloadProgressBar { private var pl:Preloader; public function CustomPreloader() { pl = new Preloader(); this.addChild(this.pl); th

我有简单的自定义预加载程序。 我的代码是

package content
{

public class CustomPreloader extends SparkDownloadProgressBar
{
    private var pl:Preloader;
    public function CustomPreloader()
    {
        pl = new Preloader();
        this.addChild(this.pl);
        this.pl.addEventListener(Event.ADDED_TO_STAGE, centerThePreloader);
    }

    override protected function initCompleteHandler(event:Event):void
    {
        pl.ready = true;
        dispatchEvent(new Event(Event.COMPLETE));
    }

    private function centerThePreloader( event:Event ):void 
    {
        this.pl.x = (stage.stageWidth - this.pl.width) / 2;
        this.pl.y = (stage.stageHeight - this.pl.height) / 2;
    }
}
}
预加载程序的代码如下:

public class Preloader extends Loader
{
    [Embed(source = "./embed/loader.swf", mimeType="application/octet-stream")]
    public var loadingCircle:Class;
    public var ready:Boolean = false;

    public function Preloader()
    {
        this.loadBytes( new loadingCircle() as ByteArray);
    }
}
更新:

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/mx"
           xmlns:components="components.*"
           preloader="content.CustomPreloader"
           minWidth="955" minHeight="600"
           creationComplete="load()">


我的问题是,当我运行applocation时,custom和defaulf预加载程序都在工作。我的错误在哪里?什么地方?

请提供设置此预加载程序的代码。请查看我的更新。。。