Previous | Next | Frames | No Frames |
Summary: Field | Property | Contructor | Method | Detail: Field | Property | Contructor | Method |
MovieClip | +--it.gotoandplay.smartfoxbits.bits.LoginBox
import it.gotoandplay.smartfoxbits.bits.LoginBox var loginBox_mc:LoginBox = LoginBox(attachMovie("LoginBox", "loginBox_mc", 10)) loginBox_mc.zone = "simpleChat"
NOTE 1: importing the it.gotoandplay.smartfoxbits.bits.LoginBox class and casting the LoginBox's movieclip to it is useful if you intend to use a development tool having code-completion features. Otherwise this is enough:
var loginBox_mc = attachMovie("LoginBox", "loginBox_mc", 10)NOTE 2: in the following examples loginBox_mc represents the LoginBox instance name.
Property Summary | |
public | autoHide: Boolean (read, write) |
Hide the LoginBox component before connection to SmartFoxServer and after a succesful login. | |
public | backgroundWindow: Window (read-only) |
A reference to the background Window component. | |
public | backgroundWindowTitle: String (read, write) |
The title of the form fields background window. | |
public | buttonText: String (read, write) |
The label of the "login" button. | |
public | errorTextField: TextField (read-only) |
A reference to the error message TextField. | |
public | height: Number (read, write) |
The height of the LoginBox component on the stage, in pixels. | |
public | layout: String (read, write) |
The layout of the login form components. | |
public | loginButton: Button (read-only) |
A reference to the "login" Button component. | |
public | noGuestLoginMsg: String (read, write) |
The error message to be displayed in case of guest login attempt. | |
public | passwordLabel: Label (read-only) |
A reference to the "password" Label component. | |
public | passwordLabelText: String (read, write) |
The label text of the password input field. | |
public | passwordTextInput: TextInput (read-only) |
A reference to the "password" TextInput component. | |
public | restrict: String (read, write) |
The set of characters that a user may or may not enter into the username input field. | |
public | showBackgroundWindow: Boolean (read, write) |
Show/hide the LoginBox background window. | |
public | showFocusRectangle: Boolean (read, write) |
Show/hide the focus rectangle around the input fields and the login button. | |
public | showPassword: Boolean (read, write) |
Show/hide the password input field and label. | |
public | spacing: Number (read, write) |
The number of pixels dividing the form components (username and password inputs fields, login button, error message). | |
public | usernameLabel: Label (read-only) |
A reference to the "username" Label component. | |
public | usernameLabelText: String (read, write) |
The label text of the username input field. | |
public | usernameTextInput: TextInput (read-only) |
A reference to the "username" TextInput component. | |
public | width: Number (read, write) |
The width of the LoginBox component on the stage, in pixels. | |
public | zone: String (read, write) |
The SmartFoxServer zone (application) to login to. | |
Constructor | |
LoginBox ( ) | |
LoginBox class constructor. Initializes the component. | |
Method Summary | |
public | refreshView ( ): Void |
Refresh the LoginBox's view. | |
|
Hide the LoginBox component before connection to SmartFoxServer and after a succesful login. If set to true , the LoginBox won't be visible until a connection to SmartFoxServer is made available (through the Connector component), and will disappear again after a successful login.NOTE: setting this property at run-time only affects the post-login behavior of the component.
|
|
A reference to the background Window component. This reference allows you to take control over the background Window mCOM component, to set its properties. Check the mCOM Flash components documentation for further details.
|
|
|
The title of the form fields background window.
|
|
The label of the "login" button.
|
|
|
A reference to the error message TextField. This reference allows you to take control over the error message TextField, to set its properties (for example text styling). Check the Flash documentation for further details.
|
|
The height of the LoginBox component on the stage, in pixels. Use this property instead of _height to resize the LoginBox mantaining the inner components' aspect ratio. If the size of inner components exceeds the height value, this property is set to the minimum possible value to avoid clipping.
|
|
|
The layout of the login form components. Username and password inputs fields, their labels and the login button can be rearranged according to seven predefined layouts:
|
|
|
A reference to the "login" Button component. This reference allows you to take control over the login Button mCOM component, to set its properties (for example size). Please notice that if you change the component size, you have to call the refreshView method to rearrange the LoginBox's view accordingly. Check the mCOM Flash components documentation for further details.
|
|
|
The error message to be displayed in case of guest login attempt. At login, if no username is provided, SmartFoxServer automatically creates a name for the client using the format "guest_n" (where n is a progressive number). Setting this property prevents the LoginBox to accept a null username, showing the error message if the login button is pressed.
|
|
A reference to the "password" Label component. This reference allows you to take control over the password Label mCOM component, to set its properties (for example text styling). Please notice that if you change the component size, you have to call the refreshView method to rearrange the LoginBox's view accordingly. Check the mCOM Flash components documentation for further details.
|
|
|
The label text of the password input field.
|
|
|
A reference to the "password" TextInput component. This reference allows you to take control over the password TextInput mCOM component, to set its properties (for example text styling). Please notice that if you change the component size, you have to call the refreshView method to rearrange the LoginBox's view accordingly. Check the mCOM Flash components documentation for further details.
|
|
|
The set of characters that a user may or may not enter into the username input field. Check the TextField class documentation in the Flash help for description and usage examples of this property. By default, tag delimiters ("<" and ">" characters) are not allowed, to prevent possible html textfields corruption. |
|
Show/hide the LoginBox background window.
|
|
Show/hide the focus rectangle around the input fields and the login button.
|
|
Show/hide the password input field and label. If you need to implement the Moderator feature in your application, then this property must be set to true .In the LoginBox component, the entered password is checked against the Moderator list only, in the SmartFoxServer's config.xml file. No advanced user identification is available with this component.
|
|
The number of pixels dividing the form components (username and password inputs fields, login button, error message).
|
|
|
A reference to the "username" Label component. This reference allows you to take control over the username Label mCOM component, to set its properties (for example text styling). Please notice that if you change the component size, you have to call the refreshView method to rearrange the LoginBox's view accordingly. Check the mCOM Flash components documentation for further details.
|
|
|
The label text of the username input field.
|
|
|
A reference to the "username" TextInput component. This reference allows you to take control over the username TextInput mCOM component, to set its properties (for example text styling). Please notice that if you change the component size, you have to call the refreshView method to rearrange the LoginBox's view accordingly. Check the mCOM Flash components documentation for further details.
|
|
|
The width of the LoginBox component on the stage, in pixels. Use this property instead of _width to resize the LoginBox mantaining the inner components' aspect ratio. If the size of inner components exceeds the width value, this property is set to the minimum possible value to avoid clipping.
|
|
|
The SmartFoxServer zone (application) to login to.
|
|
|
LoginBox class constructor. Initializes the component. |
|
Refresh the LoginBox's view. If you change the size of the LoginBox's inner components, you have to call this method to rearrange the LoginBox's view accordingly. |
The SmartFoxBits' LoginBox component lets the user login to a specified zone on a SmartFoxServer instance. The component contains two textfields to input a username and a password, and a login button. As for all the other SmartFoxBits components, these form items and their window-like background are based on the mCOM Flash components. You can read more about these components and their features here.
The LoginBox can be customized by setting the form layout (among the seven ones available), the input fields labels and the window title, hide the password field and the window frame. You can also make it invisible until a connection with the server is set, and make it disappear after a succesful login.
As the LoginBox doesn't feature advanced, database driven user identification, both the username and the password are optional. If no username is provided, the server automatically creates a name for the client using the format "guest_n", where n is a progressive number. You can avoid this and force users to enter their own nickname by setting the 'No guest login' message property.
If a password is provided, username and password are checked against the moderators list (configured in the config.xml file on the server side) and if a a matching is found, the user is set as a moderator.