aqui el codigo del cursor(puntero)
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT))
{
this._x += 5;
}
if(Key.isDown(Key.LEFT)){
this._x -= 5;//
}
if(Key.isDown(Key.UP)){
this._y -= 5;
}
if(Key.isDown(Key.DOWN)){
this._y += 5;
}
}
y aqui el codigo del boton de un numero en mi caso 5
onClipEvent(enterFrame)
{
if(this.hitTest(_root.puntero)& Key.getAscii()==50)
{
_root.txtoper.text= 5
}
}
el codigo del boton + que sumaria los valores
onClipEvent(enterFrame)
{
if(this.hitTest(_root.puntero)& Key.getAscii()==50){
_root.valor1 = _root.txtoper.text// TXTOPER es el texto dinamico
_root.txtoper.text= ""
operacion = "+"
}
}
el codigo del otro numero en mi caso 10
onClipEvent(enterFrame)
{
if(this.hitTest(_root.puntero)& Key.getAscii()==50)
{
_root.txtoper.text = 10;
}
}
y finalmente el boton resultado que el que desplegaria en el texto dinamico el valor
onClipEvent(enterFrame)
{
if(this.hitTest(_root.puntero)& Key.getAscii()==50)
{
_root.valor2 = _root.txtoper.text
//if (_root.operacion == "+")
//{
_root.txtoper.text = int(_root.valor1)+int(_root.valor2)//SE REALIZA LA SUMA PERO INFINITAMENTE
//}
}
}
no se en donde puedo estar cometiendo el error he intentado miles de cosas y nada o me da una valor NaN o me los suma infinitamente y pues solo quiero que haga la suma de valores una vez 10+5=15 y listo por favor espero puedan ayudarme.
Gracias de Antemano.