Jump to content
GreenSock

milcon

Members
  • Posts

    5
  • Joined

  • Last visited

Reputation

0 Newbie

Profile Information

  • Location
    Italy Cuneo
  1. I not have words for thanks you... going the you code in timeline of flash autoriting tool, the progressBar begin the her length fine....
  2. Hi, all you... My problem is, that the myProgressBar in the stage to see for first, in all the her length than loading my swf on the stage, while after two seconds begin the loading in her scaleX, and all to go fine... here my code that use, there is also the field with percentage.... package Max_SWF{ import com.greensock.loading.LoaderMax; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import flash.display.MovieClip; import flash.events.*; public class LoaderMaxSWF extends MovieClip { public function LoaderMaxSWF() { addEventListener(Event.ADDED_TO_STAGE,init); } private function init(evt:Event):void { removeEventListener(Event.ADDED_TO_STAGE,init); var queue:LoaderMax=new LoaderMax({onProgress:progressHandler}); queue.append(new SWFLoader("contatti.swf",{onComplete:completeHandler})); queue.load(); } public function completeHandler(event:LoaderEvent):void { addChild(event.target.content); } public function progressHandler(event:LoaderEvent):void { var kbps:int=(event.target.bytesLoaded/event.target.bytesTotal)*100; mc_txt.text="LOADING: " + kbps.toString()+"%"; myProgressBar.scaleX=event.target.progress; } } } Thanks for my help milcon
  3. thanks for your answer, but my code not function: the error is : 1119: Access of possibly undefined property bytesLoaded through a reference with static type com.greensock.events:LoaderEvent. I have also imported the all package: import com.greensock.loading.*; and I did as you told me... kbps+=Number=(event.bytesLoaded/event.loadTime)/1024; mc_txt.text="loading"+kbps.toString()+"%";
  4. Hi, I want to do with Loader Max a percentage of field, but get the error: This is my code without percentage of field, that function well: package Max_SWF { import com.greensock.loading.LoaderMax; import com.greensock.events.LoaderEvent; import com.greensock.loading.SWFLoader; import flash.display.MovieClip; public class LoaderMaxSWF extends MovieClip { public function LoaderMaxSWF() { var queue:LoaderMax=new LoaderMax({onProgress:progressHandler}); queue.append(new SWFLoader("contatti.swf",{onComplete:completeHandler})); queue.load(); } public function completeHandler(event:LoaderEvent):void { addChild(event.target.content); } public function progressHandler(event:LoaderEvent):void { myProgressBar.scaleX=event.target.progress; } } } Here the code with percentage of field creating error: package Max_SWF { import com.greensock.loading.LoaderMax; import com.greensock.events.LoaderEvent; import com.greensock.loading.SWFLoader; import flash.display.MovieClip; public class LoaderMaxSWF extends MovieClip { private var kbps:Number; public function LoaderMaxSWF() { var queue:LoaderMax=new LoaderMax({onProgress:progressHandler}); queue.append(new SWFLoader("contatti.swf",{onComplete:completeHandler})); queue.load(); } public function completeHandler(event:LoaderEvent):void { addChild(event.target.content); } public function progressHandler(event:LoaderEvent):void { kbps+=(event.bytesLoaded / event.loadTime) / 1024; mc_txt.text="loading"+ kbps.ToString()+"%"; myProgressBar.scaleX=event.target.progress; } } } thanks for your help milcon
×