I'm trying to override loginBox.loginButton, as described here: http://www.smartfoxserver.com/bits/docs/as3Flash_SFS2X/html/com_smartfoxserver_smartfoxbits_bits_LoginBox.html. Specifically, "If you need to override the default behaviour (execute login) when the login button is clicked, you can register to the BitEvent.LOGIN_CLICK event..."
I followed the example, and I can create the loginBox just fine:
Code: Select all
import com.smartfoxserver.smartfoxbits.bits.LoginBox;
// Create LoginBox instance
var loginBox:LoginBox = new LoginBox();
// Set SmartFoxServer zone to connect to
loginBox.zone = "simpleChat";
// Add LoginBox instance to stage
addChild(loginBox);
However, I cannot figure out how to import com.smartfoxserver.smartfoxbits.events so I can register my eventlistener. Here's what I have:
Code: Select all
import it.gotoandplay.smartfoxbits.events.*;
// loginBox.loginButton.addEventListener(BitEvent.LOGIN_CLICK, onLoginClick);
When I try to run, I get - "Definition it.gotoandplay.smartfoxbits.events could not be found."
I think I'm missing something basic in the setup.
I downloaded the Bits package and ran the .mxp file.
I dragged the LoginBox from my components window into my library.
In my Actionscript settings Source Path, I added a path to "c:\SmartfoxBits\Flash\SmartfoxServer_1"
I added the same path for my Library Path.
I also found "SmartFoxBits_BasePack_CE.swc", so I added a link to that in my Library Path.
Still... no luck. Where do I need to place my Bits library, and how should I link to it???