Modifying the RedBox examples
- JarochoCity
- Posts: 180
- Joined: 01 Dec 2005, 01:22
- Location: Mexico
- Contact:
Modifying the RedBox examples
How can I modify the RedBox examples?
is there a .FLA ? or how can i modify it?
I want the .FLA without the SmartFoxBits
is there a .FLA ? or how can i modify it?
I want the .FLA without the SmartFoxBits
Are you talking about AS2 or AS3 examples?
AS3 examples can be found in the latest SmartFoxServer download package, and are distributed as Flex Builder project source files.
AS2 examples can be downloaded from this link: the package contains the FLA files. These examples have been built using the SmartFoxBits. The RedBox requires the Connector only, which you can use even if you don't want to use the other Bits.
AS3 examples can be found in the latest SmartFoxServer download package, and are distributed as Flex Builder project source files.
AS2 examples can be downloaded from this link: the package contains the FLA files. These examples have been built using the SmartFoxBits. The RedBox requires the Connector only, which you can use even if you don't want to use the other Bits.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
- JarochoCity
- Posts: 180
- Joined: 01 Dec 2005, 01:22
- Location: Mexico
- Contact:
Withouth SmatfoxBits
Yeah, I'm talking about the AS2
But I don't want to use the smartfox bits, how can use those examples, using just the connector as you said, but not using the other smartfoxbits.
This is my code, but nothing happens:
It doesn't trace anything, it only trace this:
I can see it doesn't call the onConnectionHandler function, because I don't see the "Response" trace.
I want this using AS2.
But I don't want to use the smartfox bits, how can use those examples, using just the connector as you said, but not using the other smartfoxbits.
This is my code, but nothing happens:
Code: Select all
import it.gotoandplay.smartfoxserver.*
import it.gotoandplay.smartfoxbits.events.*
stop()
var zone:String = "SmartChatAV"
var myUserName:String = "Jack"
var SFSEvent:SmartFoxClient = connector_mc.connection
connector_mc.addEventListener(SFSEvent.onConnection, onConnectionHandler)
connector_mc.addEventListener(SFSEvent.onLogin, Delegate.create(this, onLogin))
function onConnectionHandler(evt:SFSEvent):Void
{
trace("Response");
if (evt.params.success)
{
trace("Great, successfully connected!")
// Log into the "simpleChat" zone without using the LoginBox component
smartFox.login(zone, myUserName)
}
}
function onLogin(evt:SFSEvent):Void
{
var response:Object = evt.params.resObj
if (response.success)
gotoAndStop("chat")
}
It doesn't trace anything, it only trace this:
Code: Select all
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='153' /></body></msg>
[Received]: <cross-domain-policy><allow-access-from domain="*" to-ports="9339" /></cross-domain-policy>
[Received]: <msg t="sys"><body action="apiOK" r="0" /></msg>
I can see it doesn't call the onConnectionHandler function, because I don't see the "Response" trace.
I want this using AS2.
- JarochoCity
- Posts: 180
- Joined: 01 Dec 2005, 01:22
- Location: Mexico
- Contact:
yeah
yeah, its set to true.
and i can see it connects, because it goes green and it says CONNECTED, but it doesnt handle the "SFSEvent.onConnection" function.
and i can see it connects, because it goes green and it says CONNECTED, but it doesnt handle the "SFSEvent.onConnection" function.
- JarochoCity
- Posts: 180
- Joined: 01 Dec 2005, 01:22
- Location: Mexico
- Contact:
tried before
I have also tried that, and once again, nothing happened.
So what should i do?
So what should i do?
- JarochoCity
- Posts: 180
- Joined: 01 Dec 2005, 01:22
- Location: Mexico
- Contact:
hey
hey, ive send you the file through PM!
- JarochoCity
- Posts: 180
- Joined: 01 Dec 2005, 01:22
- Location: Mexico
- Contact:
another problem
Now it shows me this:
What can I do?
Code: Select all
SmartFoxClient.myUserId and/or SmartFoxClient.myUserName properties not set: in case of custom login they must be set manually to the actual server values
What can I do?
When using a regular login, the client will handle the login response via the onLogin event handler. Behind the scenes the client API will assign the SmartFoxClient.myUserName and SmartFoxClient.myUserId properties.
When using a custom login the response is sent back to the client via the extension and it is handled in the onExtensionResponse handler. In this case the myUserName and myUserId properties ARE NOT populated auto-magically, so you will need to do it manually.
In your custom login response from server to client also send the username and smartfoxserver id, and assign those properties manually.
When using a custom login the response is sent back to the client via the extension and it is handled in the onExtensionResponse handler. In this case the myUserName and myUserId properties ARE NOT populated auto-magically, so you will need to do it manually.
In your custom login response from server to client also send the username and smartfoxserver id, and assign those properties manually.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
- JarochoCity
- Posts: 180
- Joined: 01 Dec 2005, 01:22
- Location: Mexico
- Contact:
hey
I have stablished the user and id, with the custom login and nothing happens :S
Still getting the same error.
I stablished the id and username this way on the onExtensionResponse:
And its working because I trace it.
But if that is not the way to set the user and id, how can I do it?
Still getting the same error.
I stablished the id and username this way on the onExtensionResponse:
Code: Select all
_global.myName = resObj.name
smartfox.myUserName = _global.myName;
smartfox.myUserId = resObj.id;
trace(smartfox.myUserId);
gotoAndStop("chat")
And its working because I trace it.
But if that is not the way to set the user and id, how can I do it?
The error you get is thrown if those properties are not set when the AVCastManager instance is created. So make sure you do not create it before the onExtensionResponse handler is called.
In case you already do this, can you please send via PM a fully working example? I can't compile the fla file you sent previously, due to missing classes.
In case you already do this, can you please send via PM a fully working example? I can't compile the fla file you sent previously, due to missing classes.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
- JarochoCity
- Posts: 180
- Joined: 01 Dec 2005, 01:22
- Location: Mexico
- Contact:
hey
PM sent, thank you!
Who is online
Users browsing this forum: No registered users and 23 guests