Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 7 of 7
  1. #1

    Default Preloader giving trouble

    Hi

    could someone please tell me what the right action script is - for a simple preloader ? my preloader seems to do it's own thing, and doesn't show when the movie has loaded. In other words, once my pre-loader shows up, one can go make one'self a cup of coffee, have a snack, have a chat etc. etc. and come back, it still show loading. What is it that I'm doing wrong ?

    Rachna

  2. # ADS
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Post some sample code of how you have your preloader set up. There are many different ways to code a preloader but for the most part it is just a matter of checking getBytesLoaded to see if it is equal to getBytesTotal. Example3 frame preloader......
    Frame 1...
    Code:
    //you could leave this code out and make it a 2 frame preloader
    //but I like having the extra check
    ifFrameLoaded (2) {
    gotoAndPlay(2);
    }
    Frame 2...
    Code:
    total = int(_root.getBytesTotal());
    download = int(_root.getBytesLoaded());
    if (total == download) {
    	_root.gotoAndPlay("mainstart");
    } else {
    	play();
    }
    Frame 3...
    Code:
    gotoAndPlay(2);
    Hope it helps
    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  4. #3

    Default Loaded !!!

    Hey that worked ! Thanks a ton. Had to work on it a bit, but figured it out finally.

    Thanks again

  5. Default

    I've also been having problems with a preloader....

    My movie has 12 scenes right now and for whatever reason i can't get a preloader to load all of them at once

    The code posted above doesn't work, do I need something else to make sure it loads all of the scenes??

  6. #5
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    A preloader is not responsible for the loading of content. It is merely an indicator to the user that the content has loaded or how much of the content has loaded. When you call an .swf or html page with an .swf file embedded, the browser will download the full contents of the file whether a preloader is in place or not. The code above works well in most situations. There are a few known issues with using preloaders. One is if your using export for actionscript with attachMovie. Another is using Flash components, which export thier actionscript in the first frame. Both of these issues deal with the content having to fully load on frame one of the movie before any other content(including preloader code) can fire. This issue is usually noticeable by the preloader not appering visually until 50% or more of the file has downloaded. Is this the problem your experiencing?

    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  7. Default

    the problem is that _root.getBytesLoaded seems to only be returning how many bytes it has loaded of the preloader scene and the same thing for _root.getBytesTotal

    because the preloader scene is actually very small the preloader itself just flashes up and is gone and the movie plays right away

    i tried to export my movie minus the preloader and then impre that as a movie clip into another swf that contain the same preloader. the problem i got there was that for whatever reason the sounds didn't import along with the rest of the movie

  8. #7
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    When you add scenes in flash, it is basically like extending the main timeline. Flash actually counts total frames, not scenes. _root.getBytesTotal returns the size value for all content on all frames. One thing to keep in mind is when testing a preloader, it should be done in an online environment. Flash author mode will connect to a local file too quickly for a preloader to be effective. This is also an issue with broadband connection speeds. If there in not much content, the preloader will never be seen. Try creating a test movie with the code above. To ensure the content is a sufficient amount, use any avi video imported into a flash movie. Post the preloader code on the top scene, upload it to your website and test it. I make extensive use of this method with my MP3 player. The sounds that stream use this method to show the user how much of the sound has loaded. I also use this method to preload .jpg images for the album covers. Here is a demo.....

    http://ntdesigns.net/ntPlayer/GroupyBandMate.swf

    With that said....... a little rant about using scenes. The real power of Macromedia Flash is the movieclip object. Anything that can be put in a seperate scene, can be contained in a single movieclip. Movieclips have thier own independent timeline and properties. The advantage of organizing content with movieclips instead of scenes is apparent in editing. It is much easier to manage content on a single timeline as opposed to switching back and forth between scenes to edit content. Scenes are notorious for dropping variable values. This is hard to explain or give a demo, but on occasion, a variable value will simply become null when switching between scenes. An example of movieclip simplification of a scene project would be ..... a 12 scene flash movie...... each scene converted to a single movieclip residing on the main timeline.... would make the project a 12 frame single timeline with a movieclip on each frame containing the "scene". Editing becomes centralized and you can see everything in the project without searching scenes.

    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Giving random movement to a movie clip?
    By Melicbot in forum Flash Scripting
    Replies: 2
    Last Post: 11-02-2006, 12:33 AM
  2. Trouble with ID3
    By gaffa in forum Sound and Music
    Replies: 3
    Last Post: 06-16-2005, 10:50 AM
  3. Having Trouble
    By NoDQForums in forum General Flash
    Replies: 0
    Last Post: 06-11-2005, 04:05 PM
  4. Vineet Jain is giving free readings at www.askastro.com
    By vineet jain in forum Software Review
    Replies: 0
    Last Post: 09-11-2004, 10:07 AM
  5. Help Me! Targeting trouble.
    By efron in forum Advanced Flash
    Replies: 2
    Last Post: 03-16-2004, 03:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial