Queue Loader加载类库使用

I'm having an error with my Queue Loader.

"1067: Implicit coercion of a value of type String to an unrelated type Number."
"1120: Access of undefined property root."
"1136: Incorrect number of arguments. Expected 4."

I have basically a TopLevel Document class that has this code.


TopLevel.as

ActionScript Code:
package
{
    import flash.display.*;
    import flash.net.URLRequest;
    import flash.events.*;
    import caurina.transitions.*;
    import StageEvent;
    import Load;
    
    public class TopLevel extends MovieClip
    {
        public static var stageAlign:StageAlign;
        public static var stageScaleMode:StageScaleMode;
        
        public static var stage:Stage;
        public static var root:DisplayObject;
        
        public var stageEvent:StageEvent = new StageEvent();
        
        public var load:Load = new Load();
        
        public function TopLevel()
        {
            TopLevel.stage = this.stage;
            TopLevel.root = this;
            TopLevel.stage.scaleMode = StageScaleMode.NO_SCALE;
            TopLevel.stage.align = StageAlign.TOP_LEFT;
            
            if (stage.stageWidth < 965)
            {
                stageEvent.xWidth = 965;
    
            } else 
            {
                stageEvent.xWidth = stage.stageWidth;
            }
            if (stage.stageHeight < 780)
            {
                stageEvent.yHeight = 780;
                
            } else
            {
                stageEvent.yHeight = stage.stageHeight;
            }
            
            stage.addEventListener(Event.RESIZE, onStageResize);
        }
        
        private function onStageResize(ev:Event):void
        {
            if (stage.stageWidth < 965)
            {
                stageEvent.xWidth = 965;
    
            } else 
            {
                stageEvent.xWidth = stage.stageWidth;
            }
            if (stage.stageHeight < 780)
            {
                stageEvent.yHeight = 780;
                
            } else
            {
                stageEvent.yHeight = stage.stageHeight;
            }
        }
    }
}
  Load.as
ActionScript Code:
package
{
    import queueLoader.hydrotik.QueueLoader;
    import queueLoader.hydrotik.QueueLoaderEvent;
    
    public class Load
    {
        private static var bgObj:Object = new Object();
        bgObj.slide_id = "main background";
        private static var mainUIObj:Object = new Object();
        mainUIObj.slide_id = "main user interface";
        
        private static var _oLoader:QueueLoader = new QueueLoader();
        
        _oLoader.addItemAt("flash_bg.swf", root.mainBg_mc, bgObj);
        _oLoader.addItemAt("flash_ui.swf", root.mainUI_mc, mainUIObj);
        
        _oLoader.execute();
        
        _oLoader.addEventListener(QueueLoaderEvent.QUEUE_START, onQueueStart, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.ITEM_START, onItemStart, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.ITEM_PROGRESS, onItemProgress, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.ITEM_COMPLETE, onItemComplete, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.ITEM_ERROR, onItemError, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.QUEUE_PROGRESS, onQueueProgress, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.QUEUE_COMPLETE, onQueueComplete, false, 0, true);
        
        trace("Loaded");
    }
    
    //Listener functions
    function onQueueStart(event:QueueLoaderEvent):void {
        trace(">> "+event.type);
    }               
    function onItemStart(event:QueueLoaderEvent):void {
        trace("\t>> "+event.type, "item title: "+event.title);
    }               
    function onItemProgress(event:QueueLoaderEvent):void {
        trace("\t>> "+event.type+": "+[" percentage: "+event.percentage]);
    }                  
    function onQueueProgress(event:QueueLoaderEvent):void {
        trace("\t>> "+event.type+": "+[" queuepercentage: "+event.queuepercentage]);
    }               
    function onItemComplete(event:QueueLoaderEvent):void {
        trace("\t>> name: "+event.type + " event:" + event.type+" - "+["target: "+event.targ, "w: "+event.width, "h: "+event.height]+"\n");
    }               
    function onItemError(event:QueueLoaderEvent):void {
        trace("\n>>"+event.type+"\n");
    }               
    function onQueueComplete(event:QueueLoaderEvent):void {
        trace("** "+event.type);
    }
}
 

你可能感兴趣的:(UI,.net,Flash,Access,actionscript)