Preloader for external JPG

  • soumik
  • Novice
  • Novice
  • soumik
  • Posts: 29

Post 3+ Months Ago

I am loading a jpg into a movieClip with a button click:

Code: [ Select ]
on(release){
    loadMovie("5.jpg", "container");
}
  1. on(release){
  2.     loadMovie("5.jpg", "container");
  3. }


I am trying to build a preload bar while the jpg loads into the movieclip. can anyoen suggest which way I should go for? I need to know the logic behind creating this. I would like to try if I could make this for me becus I am new in actionscript.
  • montyt
  • Proficient
  • Proficient
  • User avatar
  • Posts: 275

Post 3+ Months Ago

use this script

Code: [ Select ]
this.onEnterFrame = function() {
    filesize = img1.getBytesTotal();
    loaded = img1.getBytesLoaded();
    preloader._visible = true;
    if (loaded != filesize) {
        preloader.preload_bar._xscale = 100*loaded/filesize;
    } else {
        preloader._visible = false;
    }
};
  1. this.onEnterFrame = function() {
  2.     filesize = img1.getBytesTotal();
  3.     loaded = img1.getBytesLoaded();
  4.     preloader._visible = true;
  5.     if (loaded != filesize) {
  6.         preloader.preload_bar._xscale = 100*loaded/filesize;
  7.     } else {
  8.         preloader._visible = false;
  9.     }
  10. };


for image load u can use flash components also "loader".

:)[/code]
  • soumik
  • Novice
  • Novice
  • soumik
  • Posts: 29

Post 3+ Months Ago

Great! let me try with this.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 3 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.