0 Replies Latest reply on Feb 4, 2011 8:21 AM by inZania

    Creating a SDK (.swc) in Adobe Flash CS5 - Error + Best Practices Questions


      Hello all,


      I'm currently developing a client library for a server-based API which is developed by my company.

      The goal is for the .swc to be usable in both Flash and Flash Builder (any Actionscript environment, really).  So far I've just been creating it in Flash CS5 and have yet to test it in Flash Builder.  It contains a single piece of UI (a login window) but is intended to expose a number of actionscript classes as API interface points to the developer.  The login window is a single Movie Clip placed onto the stage.  I have been testing by simply running the Flash project for the SDK and it works well.


      However, I run into problems when I attempt to use the SWC in other projects (I have the Flash project for the SDK set to create a SWC as well as a SWF)...

      • I link the SWC to the other project using the flash compiler settings
      • com.mycompany.SDK is a class required for initialization (singleton) and com.mycompany.LoginWindow is the UI window for logging in
      • The developer needs to call SDK.Initialize(), which seems to work fine
      • When the following code is added I get the below error: addChild(new LoginWindow())
      • 1046: Type was not found or was not a compile-time constant: InstanceInfo.


      I take it that the error is a result of an undefined class - but I cannot figure out where InstanceInfo (it is not a class of mine) is being used or how to fix this...