Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Skeenee

  1. The trace is indeed working, i can grab the progress, and i don´t get any run time error. Loading wise everything works perfectly. this is the complete code i am using: package { import flash.display.MovieClip; import flash.events.*; import flash.display.*; import flash.utils.*; import com.greensock.*; import com.greensock.easing.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import com.greensock.loading.display.*; public class Preloader extends MovieClip { private var projectLoader:ProjectLoader = new ProjectLoader(); private var bg:BG = new BG(); public var mainLoader:SWFLoader = new SWFLoader("project.swf",{name:"project",onProgress:progressHandler,onComplete:completeHandler, autoplay:true,container:this,x:0,y:0}); public function Preloader() { this.addEventListener(Event.ADDED_TO_STAGE, addedToStage); } private function addedToStage(event:Event):void { stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(Event.RESIZE, resizeListener); preload(); positionElements(); } private function resizeListener(e:Event):void { positionElements(); } private function positionElements():void { projectLoader.x = stage.stageWidth / 2; projectLoader.y = stage.stageHeight / 2; bg.width = stage.stageWidth; bg.height = stage.stageHeight; } private function preload():void { addChild(bg); addChild(projectLoader); mainLoader.load(); } private function progressHandler(event:LoaderEvent):void{ trace("progress: " + Math.round(event.target.progress*100)); MovieClip(projectLoader).gotoAndPlay(Math.round(event.target.progress*100)); } private function completeHandler(event:LoaderEvent):void{ trace(event.target + " complete"); removeChild(projectLoader); removeChild(bg); this.removeEventListener(Event.ADDED_TO_STAGE, addedToStage); stage.removeEventListener(Event.RESIZE, resizeListener); } private function errorHandler(event:LoaderEvent):void{ trace("error occured with " + event.target + ": " + event.text); } }//class }//package Thanks for your help, i really appreciate
  2. I am trying to make a timeline based animated preloader: I made a 100 frame animation, and would like progressHandler function to define the frame on my timeline. The preloader works perfectly, but i am having issue with the progressHandler function. I am using: private function progressHandler(event:LoaderEvent):void{ //trace("progress: " + Math.round(event.target.progress*100)); MovieClip(projectLoader).gotoAndStop(Math.round(event.target.progress*100)); } The movieClip "projectLoader" is the 100 frames preloader animation. Issue: the projectLoader animation is stuck on frame 1 and does not increase with the progressHandler. I am sure I am making a stupid mistake, but i am quite new to this so go easy on me Thanks for your help
  3. Quick and probably stupid question regarding ImageLoader. I am trying to load an image and set it as fullscreen without deformation but i cannot seem to find the right settings. Can anyone give me tips? Tx in advance, Skee