Jump to content
GreenSock

peterpetr4

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by peterpetr4

  1. ok I solved my problem, here's the code. import com.greensock.*; import com.loading.*; import com.events.LoaderEvent; import com.greensock.loading.display.*; private var _queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); private var _menubarLoader:SWFLoader = new SWFLoader("../swf/menubar.swf"); private var _footerLoader:SWFLoader = new SWFLoader("../swf/footer.swf"); private var menuMc:MovieClip; private var footerMc:MovieClip; preload(); private function preload():void { _queue.append(_menubarLoader); _queue.append(_footerLoader); _queue.load(); } private function progressHandler(e:LoaderEvent):void { preloader_mc.percent_txt.text = String(Math.floor(e.target.progress * 100)) + "%"; } private function completeHandler(e:LoaderEvent):void { preloader_mc.visible = false; // VERY IMPORTANT PART menuMc = MovieClip(_menubarLoader.rawContent); footerMc = MovieClip(_footerLoader.rawContent); addChildAt(menuMc, 0); addChildAt(footerMc, 0); menuMc.contact_btn.name_txt.text = "Contacts"; } private function errorHandler(e:LoaderEvent):void { trace("Error has occurred"); }
  2. Hello, do someone know how to edit code below to LoaderMax? All help will be very appreciated. Thanks so much in advance. var menubarLoader:Loader = new Loader(); var menubarReq:URLRequest = new URLRequest("../swf/menubar.swf"); var menuMc:MovieClip; menubarLoader.load(menubarReq); menubarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); function completeHandler(e:Event):void { menuMc = MovieClip(menubarLoader.content); menuMc.contacts_btn.name_txt.text = "Contacts"; }
×