sinclairc5
September 20th, 2009, 07:36 PM
Currently i use a class i made for preloading the swf from within my Document (http://www.kirupa.com/forum/attachment.php?attachmentid=50792&stc=1&d=1253489571) class, see attached files. Now the current method i use is to preload a flash project is to have the first frame empty, the second frame container what ive come to call a sprite dump. The sprite dump is a movieclip containing all the assets used throughout the project all with "Export in first frame" unchecked.
My Document (http://www.kirupa.com/forum/attachment.php?attachmentid=50792&stc=1&d=1253489571) class creates an instance of DocumentPreloader (http://www.kirupa.com/forum/attachment.php?attachmentid=50789&stc=1&d=1253488365) and adds it to the stage. By applying listeners to the DocumentPreloader (http://www.kirupa.com/forum/attachment.php?attachmentid=50789&stc=1&d=1253488365) i listen for progress and completion.
Upon completion i gotoAndStop( 3 ); by skipping over the 2nd frame provides reference to the assets. Once on the 3rd frame i can instantise any of the assets included in the sprite dump.
This method works fine! however im looking for a method of removing the need for a sprite dump. For a completly timeline free preloading solution, if indeed its even possible. Why? just because i want to know if i can!
One solution may be to load in an swf containing all the assets i require, and i believe that would work. However i build viral games! which means that i need my games to be self contained in one swf.
Any suggestions, solutions or hints as to whether this is even possible! The attached files show the current method, you'll need to change the package descriptions to use them.
My Document (http://www.kirupa.com/forum/attachment.php?attachmentid=50792&stc=1&d=1253489571) class creates an instance of DocumentPreloader (http://www.kirupa.com/forum/attachment.php?attachmentid=50789&stc=1&d=1253488365) and adds it to the stage. By applying listeners to the DocumentPreloader (http://www.kirupa.com/forum/attachment.php?attachmentid=50789&stc=1&d=1253488365) i listen for progress and completion.
Upon completion i gotoAndStop( 3 ); by skipping over the 2nd frame provides reference to the assets. Once on the 3rd frame i can instantise any of the assets included in the sprite dump.
This method works fine! however im looking for a method of removing the need for a sprite dump. For a completly timeline free preloading solution, if indeed its even possible. Why? just because i want to know if i can!
One solution may be to load in an swf containing all the assets i require, and i believe that would work. However i build viral games! which means that i need my games to be self contained in one swf.
Any suggestions, solutions or hints as to whether this is even possible! The attached files show the current method, you'll need to change the package descriptions to use them.