I am very frustrated and tired with this code, I have tried looking everywhere nobody seems to be getting the same error as me. I keep getting 12 errors no matter what I do all saying relatively the same thing here there are:
Code: Select all
Scene 1, Layer 'game', Frame 2, Line 8, Column 38 1120: Access of undefined property USERVAR_X.
Scene 1, Layer 'game', Frame 2, Line 8, Column 81 1120: Access of undefined property USERVAR_Y.
Scene 1, Layer 'game', Frame 2, Line 10, Column 49 1120: Access of undefined property panel_chat.
Scene 1, Layer 'game', Frame 2, Line 11, Column 49 1120: Access of undefined property panel_chat.
Scene 1, Layer 'game', Frame 2, Line 12, Column 26 1120: Access of undefined property AVATAR_DIRECTIONS.
Scene 1, Layer 'game', Frame 2, Line 21, Column 23 1180: Call to a possibly undefined method SFSUserVariable.
Scene 1, Layer 'game', Frame 2, Line 21, Column 39 1120: Access of undefined property USERVAR_X.
Scene 1, Layer 'game', Frame 2, Line 22, Column 23 1180: Call to a possibly undefined method SFSUserVariable.
Scene 1, Layer 'game', Frame 2, Line 22, Column 39 1120: Access of undefined property USERVAR_Y.
Scene 1, Layer 'game', Frame 2, Line 23, Column 23 1180: Call to a possibly undefined method SFSUserVariable.
Scene 1, Layer 'game', Frame 2, Line 23, Column 39 1120: Access of undefined property USERVAR_DIR.
Scene 1, Layer 'game', Frame 1, Line 16, Column 54 1120: Access of undefined property onUserVarsUpdate.
Here's my User Variable code:
Code: Select all
import com.smartfoxserver.v2.requests.*
function onRoomJoin(evt:SFSEvent):void
{
// Create current user's avatar by setting its position user variables to a random value
// This is required the first time only, because we are not clearing user position
// when the room is changed
if (!sfs.mySelf.containsVariable(USERVAR_X) && !sfs.mySelf.containsVariable(USERVAR_Y))
{
var px:int = Math.round(Math.random() * panel_chat.avArea.width)
var py:int = Math.round(Math.random() * panel_chat.avArea.height)
var dir:String = AVATAR_DIRECTIONS[2]
setAvatarVariables(px, py, dir)
}
}
function setAvatarVariables(px:int, py:int, dir:String):void
{
var userVars:Array = [];
userVars.push(new SFSUserVariable(USERVAR_X, px));
userVars.push(new SFSUserVariable(USERVAR_Y, py));
userVars.push(new SFSUserVariable(USERVAR_DIR, dir));
sfs.send(new SetUserVariablesRequest(userVars));
}
Oh AND if I import com.smartfoxserver.v2.entities.variables it gives me additional errors.