Adding %age Preloader to External SWF files
This is the most asked question on all the swish forums, so I thought to write an easy tutorial for you guys.
Description This tutorail demonstrates the procedure to create a percentage preloader (with simple progressbar), for Externally loaded SWF files within your sprites.
Follow the steps
1. Create a Dynamic TextBox name it _myMsgObj and name its variable target myMsg 2. Create a rectangle for 20x20 pixles 3. Group it as Sprite 4. Name the sprite 'progBar' 5. Put a stop(); action in first frame of your first preloader Scene as:
| CODE | onFrame(1) { stop(); }
|
6. Copy following code and paster in the main timeline anywhere
| CODE | onEnterFrame() { pLoaded = this.percentLoaded(); tBytes = this.getBytesTotal(); myMsg = pLoaded+"% Loaded of "+tBytes+" bytes"; progBar._width = pLoaded; if(pLoaded == 100) play(); }
|
and your preloader is added.....
post questions if you dont understand any of its steps.
regards Ali Imran
|