SmartFoxBits without MXML (AS3 project)

Everything about the SmartFoxBits UI Components for SmartFoxServer 2X. Post your questions, suggestions and bug reports.

Moderators: Lapo, Bax

Post Reply
Damace
Posts: 58
Joined: 04 Jul 2011, 16:45

SmartFoxBits without MXML (AS3 project)

Post 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

package
{
	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;

			addChild(connector);
			connector.connect();
		}
	}
}
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\Singleton.as:111]
at mx.styles::StyleManager$/get impl()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\styles\StyleManager.as:78]
at mx.styles::StyleManager$/getStyleDeclaration()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\styles\StyleManager.as:187]
at com.smartfoxserver.smartfoxbits.bits::Connector$/classConstruct()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/SmartFoxBits/Flex/Base Pack/source/src/com/smartfoxserver/smartfoxbits/bits/Connector.as:302]
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/Connector.as:135]
at SmartFoxBits()[/Users/Damace/Dropbox/Projects/Game Dev/SmartFoxBits/src/SmartFoxBits.as:11]
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.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post 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: http://www.actionscript.org/forums/show ... 3?t=181945
What about using the Flash version of the Bits?
Paolo Bax
The SmartFoxServer Team
Post Reply