Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Alright, I'll try that and post again if I have any more problems. Thanks for the help.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now