I am trying to make an educational script and I must use conditionals to detect how my movieclips are gonna act. I have two buttons and if they are clicked their related variable equals to 1. if not pressed their variables are 0. I put a button to see their state (if 1 or 0) and trace the variables. I am sending Fla to check if I am making any mistakes…
:(:wasted::wasted:
even I click different buttons to change the variables, I always get the same trace…
var released:Number;
var pump_situation:Number;
serbestbirak.addEventListener(MouseEvent.CLICK, serbestbirakma);
function serbestbirakma(event:MouseEvent):void {
if (event.type=="click"){
released=1;
}
else{
released=0;
}
}
pump_outside.addEventListener(MouseEvent.CLICK, disari);
function disari(event:MouseEvent):void {
if(event.type=="click")
{
pump_situation==1;}
}
pump_inside.addEventListener(MouseEvent.CLICK, iceri);
function iceri(event:MouseEvent):void {
if(event.type=="click")
{
pump_situation=0;}
}
tracing.addEventListener(MouseEvent.CLICK, trascing);
function trascing(event:MouseEvent):void
{
if ((pump_situation==1) && (released!=1))
{
trace("pump_situation1, released is not 1 ");
}
if ((pump_situation ==1) && (released==1))
{
trace("pump_situation 1 released 1");
}
if ((pump_situation ==0) && (released==1))
{
trace("pump_situation 0 released 1");
}
if ((pump_situation ==0) && (released!=1))
{
trace("pump_situation 0 released is not 1");
}
else
{
trace("none of them");
}
}