Submit Your Article Forum Rules

Results 1 to 2 of 2

Thread: Loads but don't pre-loads

  1. #1
    Member
    Join Date
    Aug 2003
    Location
    NJ
    Posts
    84

    Loads but don't pre-loads

    when users come to my site i want a different Flash movie to load. The action script that im useing is
    Code:
    filename = ["mainarea.swf", "mainarea2.swf",  "mainarea3.swf"];
    path = "http://www.rockdamic.com/main/animation/";
    i = filename.length;
    k = Math.floor(Math.random()*i);
    loadMovie(path+filename[k], movieTarget);
    The problem is i already have the flash movies created and they all have preloaders but when the action script call for the movie it doesn't preload all i get is a hugh white box and then finally the movie shows up. I wan it to preload. Do anyone have any ideas on how i can fix this.
    It's better to do business with me than against me!

  2. #2
    Member
    Join Date
    Aug 2003
    Posts
    51
    Hi,

    The problem you are having is that a movie clip will only play when it is fully loaded. In other words, your preloader scripts are running, but they don't run until the entire thing is loaded, meaning that the getBytesLoaded() and the getBytesTotal() (I assmue that's how you're doing it) are already equal and therefore the preloader animation doesn't show.

    What you need to do is remove the preloaders from the movies you're loading (they're worthless where they are) and put the preloader into the main swf.

    I'm not going to go into the onData and onLoad event handler debacle but they're useless to you here so don't bother with them. If you search for them you'll find plenty of info.

    Basically here's roughly what you need (you'll need to tailor it - it's AS1.0).

    filename = ["mainarea.swf", "mainarea2.swf", "mainarea3.swf"];
    path = "http://www.rockdamic.com/main/animation/";
    i = filename.length;
    k = Math.floor(Math.random()*i);
    loadMovie(path+filename[k], movieTarget);
    pauseloader = setInterval(loader, 500);
    function loader(){
    var lb = movieTarget.getBytesLoaded();
    var tb = movieTarget.getBytesTotal();
    trace("bytes loaded = " + lb);
    trace("bytes total = " + tb);
    if(lb>=tb){
    clearInterval(pauseLoader);
    }
    }

    cheers.

Similar Threads

  1. Loads O New Features
    By WPW_Feedbot in forum Search Engine Optimization Forum
    Replies: 0
    Last Post: 11-29-2005, 11:00 AM
  2. Corrected URL - Please tell me how site loads
    By richvisions in forum Submit Your Site For Review
    Replies: 6
    Last Post: 11-06-2005, 12:37 PM
  3. CSScript loads Slowly..................
    By Memoire in forum Web Programming Discussion Forum
    Replies: 1
    Last Post: 11-15-2003, 12:12 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
  •