Jump to content
Search Community

Re: LoaderMax, myProgessBar

milcon test
Moderator Tag

Recommended Posts

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...