Hi everyone!
I’ve got a problem with a flash-website I’m creating as follows:
The flash movie has a preloader, it works in the following way:
- Frame 1: Loader symbol
- Frame 2: Class export. The movie jumps through this frame.
- Frame 3: Hidden frame for non-first-frame-exported classes to force them to export. The movie jumps through this frame
- Frame 4: Main website
I’m trying to use an object on the main site that isn’t exported at first frame. I just add the object to the stage from the library. It works till this point, however a wierd thing happens with this is that the object’s constructor runs in frame 1. I don’t really understand this behaviour.
My problem arises when I try to asign an instance name to the object on the stage - I get a runtime error: “TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@xxxxxxxx to <class>.”
The class DOES extend from MovieClip!
Obviously exporting the class at the first frame isn’t a good answer because it messes the preloader up.
I could also try to create the instance programatically, however I’d rather not do that because then all of its members would need to be programatically created as well (at least according to the tests I’ve been able to run).
Any help with this matter would be greatly appreciated! Thanks in advance.
Regards