A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: already loaded? skip this scene!

  1. #1
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159

    already loaded? skip this scene!

    normally, when i'm makin a swf, i create (at least) two scenes:

    (1) the preload animation scene
    (2) the main content scene

    the preloader scene has a lil animation to make the wait more fun, and then once y'hit 100%, you travel on to the next, content-filled scene.

    however, when you go back and wanna watch the movie again, there's a lil problem. the swf is already in the cache, so it doesn't have to load again, however...

    the preload scene "blinks" before the viewer gets to the content scene. like, it shows the very beginning of the preload animation, then instantly shows the very end, then moves on to the content.

    its not a huge problem, but something that i find pretty annoying.

    is there any simple line of code i could add to, say, the first frame of the preload scene that says, essentially, "if the swf is already in your cache, just skip this loading scene, and immediately go to scene 2"

    ?
    i'm not new to action scripting. i'm just bad at it.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Label the first frame of your second scene with site, and use at least one first blank keyframe on your preloader scene (you could even add 2 or more other blank frames before your actual code frames), adding the following on that blank keyframe...
    code:

    if(_root.getBytesLoaded() >= _root.getBytesTotal()){
    gotoAndPlay("site");
    }


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