I have 2 flash files, one with an intro and the second that just has a document class file that plays out a snake game. How could i import that document flash file and make it play out on like frame 100 off my other flash file.
Thankyou for any help.
You can instantiate the Snake class file in your intro, using code like the following on frame 100:
assuming your document class is called
SnakeGame. You may have to make a few changes inSnakeGamefor this to work, however. Thestageandrootproperties ofSnakeGamewill be null in the constructor when using this method. This is different behavior from it’s was the document class (or placed directly on the stage) —stageandrootare already initialized. So if you do any actions to eitherrootorstagein the constructor, you must change this or you will get an error. To fix this, listen for theADDED_TO_STAGEevent inSnake:Alterantively, you could link the
Snakeclass to an empty MovieClip symbol and place that directly on the stage on frame 100. First, create an empty MovieClip by going to Window->Library and clicking the +. In the Create New Symbol dialog, check “Export for ActionScript” and type inSnakein the Class field under Linkage. Now you can drag that MovieClip directly onto the stage on frame 100 and it hopefully will work without changes to the code.