Hola de nuevo sigo con esto, e estado viendo unos tutoriales para enterarme mas y ahora entiendo lo que me pasaba.
La variable la creo sin condicion entonces al pulsar encima de la instancia obcion_01 onSetFocus le daba condicion true a selec01
y si se hace onSetFocus sobre obcion_02 le da la condicion false a selec01.
Ahora el problema es como añado una obccion nuevo ya que el = no existe en true o false.
E probado dandole a selec01 una condicion de numeros, alfinal la soculion fue con la condicion de la respuesta de un trace y BINGO¡¡¡
Ejemplo normal de true y false:
btn7.onRelease = function()
{
if (selec01)
{
trace ("Obcion 1");
obcion_01.text += "7";
}
else
{
trace ("Obcion 2");
obcion_02.text += "7";
}
}
var selec01;
obcion_01.onSetFocus = function()
{
selec01 = true;
trace ("Obcion 1");
}
obcion_02.onSetFocus = function()
{
selec01 = false;
trace ("Obcion 2");
}
obcion_03.onSetFocus = function()
{
trace ("logrado");
}
- btn7.onRelease = function()
- {
- if (selec01)
- {
- trace ("Obcion 1");
- obcion_01.text += "7";
- }
- else
- {
- trace ("Obcion 2");
- obcion_02.text += "7";
- }
-
- }
- var selec01;
-
- obcion_01.onSetFocus = function()
- {
- selec01 = true;
- trace ("Obcion 1");
- }
- obcion_02.onSetFocus = function()
- {
- selec01 = false;
- trace ("Obcion 2");
- }
- obcion_03.onSetFocus = function()
- {
- trace ("logrado");
- }
Y el que necesitaba:
btn7.onRelease = function()
{
if (selec01 == 110)
{
trace ("Obcion 1");
obcion_01.text += "7";
}
else if(selec01 == 220)
{
trace ("Obcion 2");
obcion_02.text += "7";
}
else
{
trace ("Obcion 3");
obcion_03.text += "7";
}
}
var selec01 = 0;
obcion_01.onSetFocus = function()
{
selec01 = 110;
trace ("Obcion 1");
trace (selec01);
}
obcion_02.onSetFocus = function()
{
selec01 = 220;
trace ("Obcion 2");
trace (selec01);
}
obcion_03.onSetFocus = function()
{
selec01 = 330;
trace ("Obcion 3");
trace (selec01);
}
- btn7.onRelease = function()
- {
- if (selec01 == 110)
- {
- trace ("Obcion 1");
- obcion_01.text += "7";
- }
- else if(selec01 == 220)
- {
- trace ("Obcion 2");
- obcion_02.text += "7";
- }
- else
- {
- trace ("Obcion 3");
- obcion_03.text += "7";
- }
- }
- var selec01 = 0;
-
- obcion_01.onSetFocus = function()
- {
- selec01 = 110;
- trace ("Obcion 1");
- trace (selec01);
- }
- obcion_02.onSetFocus = function()
- {
- selec01 = 220;
- trace ("Obcion 2");
- trace (selec01);
- }
- obcion_03.onSetFocus = function()
- {
- selec01 = 330;
- trace ("Obcion 3");
- trace (selec01);
- }
Solo lo publico para que los que tambien esten aprendiendo hagan un esfuerzo de unas cuantas horas y cuando entiendes un poquito el funcionamiento empiezas a mezclar y alfinal lo conseguiras.
Graciasss¡¡¡