Jump to content
Search Community

krazl

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by krazl

  1. I've this,

     

    _scene_MainMenu = new scene_MainMenu();
    
    _progressDisplay = new ProgressCircleLite({radius:26, thickness:4, trackColor:0xFFFFFF, trackAlpha:0.25, trackThickness:4, autoTransition:false, smoothProgress:0});
    this.addChild(_progressDisplay);
    _progressDisplay.mouseEnabled = false;
    _progressDisplay.x = stage.stageWidth / 2;
    _progressDisplay.y = stage.stageHeight / 2 + 100;
    _progressDisplay.addLoader(_scene_MainMenu );
    
    

     

    Is there any method using "ProgressCircleLite" to load external class "scene_MainMenu"

  2. I think something is wrong with your concept. Try this instead:-

     

    public var tmpXML:XML;
    private var tmp_name_Attributes:Array = new Array();
    private var name_Attributes:XML = new XML();
    private var tmpXML_Attributes:XMLList = new XMLList();
    
    public function ConstructurNamePutHere() 
    {
    loader = new XMLLoader("UrXMLFileName.xml", {name:"whatEverNameHere_xml", onComplete:completeHandler, estimatedBytes:5000});
    loader.load();
    }
    
    public function completeHandler(event:LoaderEvent):void 
    {
    tmpXML = new XML(LoaderMax.getContent("whatEverNameHere_xml"));
    var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler_SWF, onError:errorHandler});
    tmpXML_Attributes = tmpXML.LoaderMax.BottomPanel.SWFLoader.attribute("ButtonInstanceName");
    
    i = 0;
    j = 0;
    
    for each (name_Attributes in tmpXML_Attributes) 
    {
    	//trace("name_Attributes: " + String(name_Attributes));
    	tmp_name_Attributes[i] = String(name_Attributes);
    	i++;
    }
    
    var tmpXML_URL_Attributes:XMLList = tmpXML.LoaderMax.SWFLoader.attribute("url");
    for each (var url_Attributes:XML in tmpXML_URL_Attributes) 
    {
    	queue.append( new SWFLoader( String(url_Attributes), { name:String(tmp_name_Attributes[j]) } ) );
    	j++;
    }
    
    queue.load();
    }
    
    public function completeHandler_SWF(event:LoaderEvent):void 
    {
      //trace(event.target + " is complete!");	
    }
    
    

     

    To retrieve the content

    public function retrieve_Content(tmpStr:String):Object
    {
    return LoaderMax.getContent(tmpStr);
    }
    

     

    here your xml example

    <?xml version = "1.0" encoding = "utf-8" ?>
    
    
    
    
    CHILDCONTENTHERE
    
    
    CHILDCONTENTHERE
    
    
    
    
    

  3. i don't have problem loading multiple swf (in my case i load 20 swf). Maybe u want to share ur source code?

     

    private static var loaderName:String = "MainMenu";
    private static var _sound_Music1:String = "sound_Music1";
    
    public function scene_MainMenu()
    {
    //var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); 
    queue = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); 
    queue.append( new SWFLoader("resources/MainMenu.swf", { name:loaderName } ) );
    queue.append( new MP3Loader("resources/music1.mp3", {name:_sound_Music1, autoPlay:false}) );
    queue.load();
    }
    
    private function completeHandler(event:LoaderEvent):void {			
    var image:ContentDisplay = LoaderMax.getContent(loaderName);
    addChild(image);
    
    image.addEventListener(MouseEvent.CLICK, onButtonClick);
    
    aDynamicObject_Sound[string(_sound_Music1)] = new Sound();
    aDynamicObject_Sound[string(_sound_Music1)] = Sound(retrieve_Content(_sound_Music1));
    aDynamicObject_SoundChannel[string(_sound_Music1)] = new SoundChannel();
    aDynamicObject_SoundChannel[string(_sound_Music1)] = aDynamicObject_Sound[string(_sound_Music1)].play(0, 2);
    
    var _event:Event = new CustomEvent(Event.COMPLETE);
    dispatchEvent(_event);
    }
    
    public function retrieve_Content(tmpStr:String):Object
    {
    return LoaderMax.getContent(tmpStr);
    }
    
    
    
    

  4. a huge memory free after i implement this method.

     

    public function CustomEvent(type:String, data:* = null)
    {
    this.data= data;
    super(type);
    }
    
    override public function clone():Event 
    { 
    return this; 
    }
    

    private function completeHandler(event:LoaderEvent):void 
    {			
    var _event:Event = new CustomEvent(Event.COMPLETE);
    dispatchEvent(_event);
    }
    
    _scene_xmlLoader.addEventListener(Event.COMPLETE, onAsset_scene_xmlLoader_Complete, false, 0, true);
    
    private function onAsset_scene_xmlLoader_Complete(event:CustomEvent):void 
    {
    _scene_xmlLoader.removeEventListener(Event.COMPLETE, onAsset_scene_xmlLoader_Complete, false);
    }
    

     

    I suspect "override public function clone():Event " doing the trick .. Btw I love GreenSock classes :)

  5. I suggest u visit here :- http://www.krazl.com/blog/index.php/pag ... developer/

    Flash Player version

    ================

    http://www.adobe.com/support/flashplayer/downloads.html

     

    Flash Develop (IF you dont have money to buy CS5.. this is an alternative)

    ========================

    http://www.flashdevelop.org

     

     

    Flex SDK (if you love opensource, you’ll love this)

    ==========================================

    http://opensource.adobe.com/wiki/displa ... k/Flex+SDK

     

    FlashPlayer_10_sa_debug.exe

    ==========================

    Download this as a developer debug tools (instead of using browser)

×
×
  • Create New...