A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Preloader

  1. #1
    Member
    Join Date
    Jan 2005
    Location
    United Kingdom
    Posts
    97

    Preloader

    I want to insert a bar into the first frame of my Flash website that displays the loading progress. I created a bar, used a shape tween on it and then added the following actionship to the movie clip, which is called 'bar_mc':

    --

    stop();
    bar_mc.onEnterFrame=function(){
    this.gotoAndPlay(Math.round((_root.getBytesLoaded( )/_root.getBytesTotal())*100));
    if(_root.getBytesLoaded()==_root.getBytesTotal()){
    play();
    }
    };

    ---

    For some reason when I test the flash file offline it reports 2 errors and the bar repeatedly fills up. Is there something I need to add to the above code? I got it from a web designer magazine.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Hard to say without seeing your actual setup, but I'd say you'd have to delete the onEnterFrame, when the preloading's done...

    You might want to check this other preloading code...
    Last edited by oldnewbie; 03-12-2005 at 12:53 AM.

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