A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Preloader for loading a jpeg?

  1. #1
    I am loading a jpeg into a movie clip and was wonering if there is anyway of having a simple preloader for this. any suggestion?
    mike

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Posts
    316
    i wouldnt mind a simple preloader for jpgs either. check out this site i just did. http://www.ultrasounds.com and look at the gallery. if i could put a preloader in for the jpg, it would be great.

    if anyone has made one before... could you explain and post the code and everything?

    thanks in advance

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    102
    u can load the jpg in a target instead of _level
    then use the MovieClip.getBytesLoaded action!
    You can compare the value of the getBytesLoaded action with the value of the getBytesTotal action to determine what percentage of a movie clip has loaded. just like u do when u make one for a .swf <---- but for a swf u use the _framesloaded and _totalframes actions


  4. #4
    Member
    Join Date
    Oct 2000
    Location
    san franacisco, ca
    Posts
    43
    I'm working on that right now (jpg Preloader)
    I'm testing this you can try it if you like. let me know and I'll email you the fla.

    here's the code on an empty mc:
    onClipEvent (load) {
    targetClip.loadMovie("contactUs_slides/4.jpg")
    }
    onClipEvent (enterFrame) {
    //readout values for the loading jpgs in dynamic text boxes
    bytesLoaded = targetClip.getBytesLoaded();
    bytesTotal = targetClip.getBytesTotal();
    }

    on an emptyMC in the (it wasnt really) emptyMC named targetClip:
    onClipEvent (data) {
    trace("Data Recieved");
    if (getBytesLoaded()>1 && getBytesLoaded()>=getBytesTotal()) {
    //count hao many are loaded
    _root.numJpgLoaded++;
    //check to see if they are all loaded. if they are this function maked other stuff happen.
    _root.areJpgAllLoaded();
    }
    }

    hope this helps!

    also look at the thread i started the other day
    http://board.flashkit.com/board/show...hreadid=348704




  5. #5
    Senior Member
    Join Date
    Mar 2000
    Posts
    116
    Have you got this working yet?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center