Skip to main content
Participant
June 26, 2013
Question

How To Create a Preloader to a Flash Game

  • June 26, 2013
  • 1 reply
  • 874 views

I'm just beginning to get into flash game programming. I know enough to make a functioning project, but not how to make it efficient or do specific tasks, in this case how to add a preloader. I've found several tutorials online, but none that go along with how I've seen is the best method to program. From what I've seen, it is best to program all of my code into one .as file and link this file to the main document. This makes it easy for me to make all of my variables global in scope, which lets me addChild/removeChild in various different functions. The only problem is that I can't find a tutorial on creating a preloader with this method in mind. All tutorials that I've found generally have two frames in the timeline, one with the preloader and one with the content, but I've been told this is not a good way to program. If anyone could help I'd appreciate it a lot. I can paste the source code of one of my learning projects if it would help to provide an answer to my question.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 26, 2013

you'll probably find it easiest to create a new main fla that will load your game swf.  your new main fla will contain the assets to display your preload and nothing else.

Participant
June 26, 2013

Hi, do you mean create 2 seperate files? I'm making games to be sent in to flash portals, which means that my options are limited to keeping it within the single file.

kglad
Community Expert
Community Expert
June 26, 2013

then you'll need to export your classes in frame 2 (file>publish settings>advanced actionscript settings, export in frame2 and change the export frame of exported class symbols in your library) and you'll need to stop your main timeline on frame 1, run your preloader and, when loading is complete, advance your main timeline to frame 2.