Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by kikster

  1. Hello, I'm sure this is pretty simple to do but i'm new to LoaderMax and was hoping someone could put me in the right direction. I have a swf that contains 7 icons as the menu. I want each icon onClick to unload current child swf and replace it with a new swf. So basically each icon represents animation1.swf, animation2.swf, animation3.swf, etc. At the end of each animation swf two buttons will appear to either load the menu.swf or go to the next animation[#].swf. I have downloaded the LoaderMax_subload_parent.as example and I believe I understand what is going on but it loads/unloads the same swf. how do I take the code below and make it load/unload multiple swfs where only one swf shows at a time? thanks, Stephen ---------------------------------------------------------- public function LoaderMax_subload_parent():void { //create an _swfLoader = new SWFLoader("LoaderMax_subload_child.swf", {x:25, y:60, estimatedBytes:780000, onComplete:_completeHandler}); //create the "overall" circular progress display in the lower left corner of the screen that shows the loading progress for the full-size images after the user clicks "load()" _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 = 69; _progressDisplay.y = 389; _progressDisplay.addLoader(_swfLoader); //set up listeners this.load_btn.addEventListener(MouseEvent.CLICK, _loadHandler, false, 0, true); this.unload_btn.addEventListener(MouseEvent.CLICK, _unloadHandler, false, 0, true); } //---- EVENT HANDLERS ---------------------------------------------------------------- private function _completeHandler(event:LoaderEvent):void { //add the SWFLoader's content to the stage addChild(event.target.content); } private function _loadHandler(event:Event):void { _swfLoader.vars.integrateProgress = this.integrateProgress_cb.selected; //remove the content from the stage (if it's there). We'll add it again when the loader completes. if (_swfLoader.content.parent != null) { _swfLoader.content.parent.removeChild(_swfLoader.content); } _swfLoader.load(true); } private function _unloadHandler(event:Event):void { _swfLoader.unload(); }