Here I create a new Actionscript class to manage the different Flash character components. This is to enable displaying a specified character at runtime for each level. The character symbol classes come from a SWC generated by a Flash file, so we can simply create new instances of them by using their exported class name. Because we are using a SWC, however, we cannot do runtime instantiation of character classes using flash.utils.getDefinitionByName. Flex will only import classes from a SWC that are referenced at compile time, so at runtime the character class will not have been loaded. To get around this I use a character manager class which contains instances of each character, and store those instances in a dictionary that can be easily traversed. We also store the Flash symbols in a FlexSprite to give the dictionary values a consistent type. Overall, this is probably not the best solution, but it should work for now, and the limited number of unique characters there are means we dont have to worry too much about memory issues.
wow..thats cool
Fifa2251 1 year ago
I love watching programming-in-progress videos like this. :D
bludklok 2 years ago