0

I and a coworker are working on a Flash game.

My coworker uses Adobe CS5, where he create symbols on the "stage" and then simply uses them in the ActionScript file, for example "GoodGuy.visible=true".

I use Flash Develop, so I don't have that stage, but I do have an SWC file, compiled by him, that contains some symbols and properties. However, when I use the same ActionScript file, I get an error "Access of undefined property GoodGuy". What should I do?

Erel Segal-Halevi
  • 33,955
  • 36
  • 114
  • 183
  • The SWC will containt symbols Exported for Actionscript from the Flash Library. Even if he exports/sets up linkage for the GoodGuy library symbol, you'd need to re-write `GoodGuy.visible=true` or whatever code your colleague uses in the timeline. Another option is for him to export a swf and you'd load that swf and add it to the display list of the project you're working on. This way, his code will still run in the loaded swf and you should be able to access symbols (even on timeline,e.g. `MovieClip(swfLoader.contents).getChildByName("GoodGuy");//access loaded content and reference mc by name` – George Profenza Jan 27 '13 at 14:53
  • One catch though is that your colleague should either avoid using accessing the `stage` object in his timeline code, or simply add an event listener for `Event.ADDED_TO_STAGE` before doing that, otherwise there will be a gap between the moment the swf loads and initialized and the time it is added to the stage, hence stage will be a `null` object and will throw errors. HTH – George Profenza Jan 27 '13 at 14:55
  • I tried the code above and got "Access of undefined property swfLoader" – Erel Segal-Halevi Jan 27 '13 at 15:13
  • sorry, I didn't mention swfLoader is actually an example variable name I chose for a [Loader](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html#includeExamplesSummary) instance. feel free to create one, load your friends' swf, then in the `Event.COMPLETE` handler access the swf's inner movie clips via [Loader's content property](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html#content) (another typo there: it's content, not contents) – George Profenza Jan 28 '13 at 17:38

0 Answers0