Page 1 of 1

SmartFoxBits without MXML (AS3 project)

Posted: 13 Jul 2011, 18:09
by Damace
Can I use SmartFoxBits is a pure AS3 project?

I tried to make a simple app just to get the connector working:

Code: Select all

   import com.smartfoxserver.smartfoxbits.bits.Connector;
   import flash.display.Sprite;

   public class SmartFoxBits extends Sprite
      public var connector:Connector = new Connector();
      public function SmartFoxBits()
         connector.x = stage.stageWidth / 2;
         connector.y = stage.stageHeight / 2;


But an error pops up saying something with the constructor of Connector is wrong:

Code: Select all

Error: No class registered for interface 'mx.styles::IStyleManager2'.
at mx.core::Singleton$/getInstance()[E:\dev\hero_private\frameworks\projects\framework\src\mx\core\]
at mx.styles::StyleManager$/get impl()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\styles\]
at mx.styles::StyleManager$/getStyleDeclaration()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\styles\]
at com.smartfoxserver.smartfoxbits.bits::Connector$/classConstruct()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/SmartFoxBits/Flex/Base Pack/source/src/com/smartfoxserver/smartfoxbits/bits/]
at com.smartfoxserver.smartfoxbits.bits::Connector$cinit()
at global$init()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/SmartFoxBits/Flex/Base Pack/source/src/com/smartfoxserver/smartfoxbits/bits/]
at SmartFoxBits()[/Users/Damace/Dropbox/Projects/Game Dev/SmartFoxBits/src/]

From the look of this error I guess that he is looking for some MXML class that he can't find in an AS3 project.

Posted: 14 Jul 2011, 10:02
by Bax
The SmartFoxBits for Flex use the mx UI framework classes, so you should extend the Application class at least.
This link can provide additional informations:
What about using the Flash version of the Bits?