Hi to All
i have a little problem
i have a task.
how code i know the right place of code to be paste
i have a game pong
and i am tryng to insert xmlsocket code but when i insert the code its give error
“the class or interface ‘dataevent’ cannot be loded”
waht is the problem i konw that i did’t insert code the right place but what to doo any one plz
onClipEvent (load){
this.paddleSpeed = 5;
this._x = 210;
this._y = 470;
}
onClipEvent (enterFrame) {
var xmlSocket:XMLSocket = new XMLSocket();
xmlSocket.connect(“127.0.0.1”, 9090);
xmlSocket.addEventListener(DataEvent.DATA, onIncomingData);
function onIncomingData(event:DataEvent):void
{
var incomestring:String = event.data;
var isArray:Array=new Array();
isArray = incomestring.split("|");
//isArray[0];
//isArray[1];
//isArray[2];
//isArray[3];
//isArray[4];
//if(isArray[1] == "4" && isArray[0]=="0")
//trace("Player4 joined:"+event.data);
//else if(isArray[1] == "2" && isArray[0]=="1")
//trace("Player4 moving:"+event.data);
//else if(isArray[1] == "2" && isArray[0]=="2")
//trace("Player4 left:"+event.data);
//else if(isArray[1] == "2" && isArray[0]=="3")
//trace("Player4 confusing:"+event.data);
}
//_root.b1.isSelected = true;
if (Key.isDown(Key.LEFT) && this._x>40) {
this._x -= this.paddleSpeed;
}
if (Key.isDown(Key.RIGHT) && this._x<356 && _root.b1.isSelected == false) {
this._x += this.paddleSpeed;
}else if (Key.isDown(Key.RIGHT) && this._x<337 && _root.b1.isSelected == true){
this._x += this.paddleSpeed;
}
}