Author Topic: Flash help  (Read 616 times)

Jedi

  • Hydlaa Citizen
  • *
  • Posts: 335
    • View Profile
Flash help
« on: April 04, 2004, 07:02:02 am »
Can anyone tell me how to make a Flash loading animation for a webpage? I made this website in Flash, but it has a crazy slow load time (Heck on my laptop it doesn\'t load at all!) and it gets boring looking at a blank white square for so long.

 Perhaps you can help me with my other problem as well. My website is really not that big. The .swf file is only 8 k. I published it with its accompanying html file, but when I use the html, it doesn\'t load. Can someone tell me why, or explain how to fix this? (Note, the .swf file loads fine in my Flash player)
« Last Edit: April 04, 2004, 07:03:34 am by Jedi »

jonmack

  • Hydlaa Resident
  • *
  • Posts: 63
    • View Profile
(No subject)
« Reply #1 on: April 05, 2004, 01:09:31 am »
Hi. You didn\'t say what kind of experience you have with flash or ActionScript, or what verion of flash you\'re on, but here\'s some tips.

Your swf is only 8kb but is loading slow? Does this mean you are loading things externally? You shouldn\'t need a preloader for 8kb even on 56k. But a very simply preloader might go like this:


// first frame
var total _root.getBytesTotal();
var 
loaded 0;
var 
percent 0;

// second frame
loaded _root.getBytesLoaded();
percent loaded total;

_root.loadbar._xscale percent *100;
_root.percentTextBar percent 100;

// third frame
if (percent 1) {
    
// keep looping until loaded
    
_root.gotoAndPlay(2);
}

// fourth frame
// movie loaded, do what you want


If you make a percent variable, instead of just using the getByte() functions directly, you can do other cool things like make a loadbar show the progress, or just send that value to a text box, like I\'ve added in frame 2.

I\'m not sure about your second problem. I\'ve never heard of that. But if you are loading things in from text files etc then that may be the problem.  

If you\'re exporting things from the library using \"Export to first frame\" then they will get loaded before the actual first frame, ie before your preloader code is loaded! So that will make the preloader not work. There are ways around it though.

Hope that is some help. Not much else I can think of without more info. I would definately recomend flashkit.com, some excellent things on there. Source files for just about everything and some good forums.

EDIT:
Yeah, that\'s not really PHP! Just for code formatting, it\'s the only thing on this forum...
« Last Edit: April 05, 2004, 01:11:51 am by jonmack »
jonmack