Skip to main content
CodeDeveloperOM
Inspiring
August 10, 2021
Question

Although it is simple and it is clear??

  • August 10, 2021
  • 1 reply
  • 233 views

fl_total();
function fl_total() {
if (total == 1) {
this.start_2.alpha = 1;
this.start_2.mouseEnabled = true;
this.start_1.alpha = 0.5;
this.start_1.mouseEnabled = false;
} else if (total == 2) {
this.start_3.alpha = 1;
this.start_3.mouseEnabled = true;
this.start_1.alpha = 0.5;
this.start_1.mouseEnabled = false;
this.start_2.alpha = 0.5;
this.start_2.mouseEnabled = false;
} else {
this.start_1.alpha = 1;
this.start_1.mouseEnabled = true;
this.start_2.alpha = 0.5;
this.start_2.mouseEnabled = false;
this.start_3.alpha = 0.5;
this.start_3.mouseEnabled = false;
}
}

 

 

 

 

Even if you cancel this
Everything shows an error and does not execute
Although it is simple and it is clear??
I don't know where is the problem?

 

 

This topic has been closed for replies.

1 reply

Joseph Labrecque
Community Expert
Community Expert
August 10, 2021

Are you sure that you have an instance, available on that frame, with the exact instance name of "start_2"?

CodeDeveloperOM
Inspiring
August 10, 2021

 

 

 

 

 

 

 

 

 

@Joseph Labrecque 

CodeDeveloperOM
Inspiring
August 10, 2021

I use more than one frame
And in one of the frames (the final button  total++)

 


this.nextlevel.addEventListener("mousedown", fl_nextlevel2.bind(this));
function fl_nextlevel2() {
total++;
console.log(total);
createjs.Sound.stop();
this.gotoAndStop(0);
}

 

Go back to main until button 2 or 3 activates