A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: images.jpg preloader????

  1. #1
    Hello folks,

    How do I preload an image??
    I´m loading a jpg to my MC dummy, that works fine, but i whant a preloader on it - how do I do that??

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    on the dummy MC

    Code:
    onClipEvent(data)
    {
      bl = this.getBytesLoaded();
      bt = this.getBytesTotal();
      perc = bl / bt * 100;
      _root.percentText.text = perc;
    }
    Something like that should work

  3. #3
    OK -I will try it now, get back to you soon on how it turned out!

  4. #4
    Squareball2 - there is someting that I dont understand, were do I put my textfeilds so I can see how much that is loaded???

    Can you please tell me more about were too put the actionscript and were too put the txtfields.

    I have a MC called "dummy" on the timeline and som buttons on the timeline that tells:

    on (release) {
    loadMovie("bild.jpg", "dummy");
    }

    That works but the preloading script that I put on the dummyMC´s the timeline doesnt work - does it not need a loop or something?? I know that you script is correct, it´s just put on the rong place I think.

    Please help me out here - im stucked!! If you have time I really would appreciate if you can send me a fla and show me how too put it together. My mailadress is veenhuis@bredband.net

    Thanks,
    Spike

  5. #5
    Senior Member
    Join Date
    Mar 2002
    Posts
    334

    Smile

    No problem
    Give me a few mintues to work up an FLA

  6. #6
    Thank you so much =)

    I will be waiting for it over here!!!

    Spike

  7. #7
    Senior Member
    Join Date
    Feb 2000
    Posts
    119
    heres a really nice example from Flashstar.de


    http://www.flashstar.de/tutlist/inde...ich=fsmxextdat

    cheers,
    John

  8. #8
    That´s true - but i don´t understand the words =) If it was in english I hade loved it =)

    Spike

  9. #9
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    Ok
    i'm trying to get time to make this FLA but right now it's not happening..

  10. #10
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    Oh here is an easy way out (until I translate Madokan's tutorial)

    Use the progress bar.

    Drag the progress bar onto the stage and tell it to monitor dummy.

  11. #11
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Creating an image preloader dynamically:

    Code:
    this.createEmptyMovieClip("imageholder",1)
    imageholder.loadMovie("myimage.jpg")
    this.onEnterFrame=function(){
        if(imageholder.getBytesLoaded() == imageholder.getBytesTotal()){
            //image is loaded
            this.onEnterFrame=null
            //dos omething to the now fully loaded image
            var c=new Color(imageholder)
            c.setTransform({ra:33,ga:44,ba:55})
        }
    }
    unfortuneatley any methods/properties/objects you place inside of a movieclip are deleted when the loadMovie method is called. Therefore you have to check the status of the image from another timeline where the methods and properties arent deleted.

  12. #12

  13. #13
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    This weekend I'll translate Madokan's code for every one ok

    My code isn't the best way to do it.. Madokan's code is awesome.

  14. #14
    Thank you very much Squareball2!!

    With this code I can work I think.

    Looking forward too see you translate of Madokan's code.
    Please let me know.

    Spike




  15. #15
    Member
    Join Date
    Sep 2001
    Posts
    39
    any word on the translation??

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