Hello again I continue with this and been seeing a few tutorials to learn more and now understand what was happening to me.
The variable think without condition then press on the instance obcion_01 onSetFocus gave condition true to selec01
and if done onSetFocus on obcion_02 him gives the condition false selec01.
Now the problem is how I would add a new obccion because the = does not exist in true or false.
And tried giving selec01 a condition of numbers, the soculion finally was under the condition of the response of a trace and BINGO!!!
Normal example of true and 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");
- }
And that I needed:
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);
- }
Only public it so that they also are learning make an effort of a few hours and when you understand a little bit operation start to mix and finally the conseguiras.
Graciasss!!!