To ask this as simply as possible I will water down what I am trying to do.
pwn_ab.onPress = pwn_bb.onPress=function () {
var piece = new Object(this._name);
if(piece == "pwn_ab"){
this.startDrag(false, 19, 57.4, 19, 207.4);
}
I have two buttons on the stage, pwn_ab and pwn_bb - say I press button pwn_ab, the code works just fine. The problem is, see how I have ("") around pwn_ab in the ifStatement, this means my variable “piece”, is a string - how can I make the variable “piece” not a string so the code below will work? Notice I removed the (“”) from pwn_ab in the ifStatement.
pwn_ab.onPress = pwn_bb.onPress=function () {
var piece = new Object(this._name);
if(piece == pwn_ab){
this.startDrag(false, 19, 57.4, 19, 207.4);
}