• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 633
  • Last Modified:

Flash check box button

I've built a working check box button with this code:

on (press){
 if(this._currentframe == 1){
   gotoAndStop(2)
 }else{
   gotoAndStop(1)
 }
}

I'm trying to make it preform the actions in the following code, but I don't know how to combine the two.


on (release) {
 
	if (buildingStatus == "on") {
		buildingStatus = "off";
		mapall2.ubuildings._alpha = 0;
		//mapall2.ubuildings
	} else {
		buildingStatus = "on";
		//mapall2.ubuildings.alpha = 0;
		mapall2.ubuildings._alpha = 100;
	}
	// mapall2.ubuildings._visible = !mapall2.ubuildings._visible;
}

Open in new window

0
Bm71
Asked:
Bm71
  • 9
  • 7
2 Solutions
 
Eaddy BarnesITCommented:
having some more trouble?
0
 
Bm71Author Commented:
I decided the project would work even better with check box buttons. Review my question and let me know what you think.

Thanks
0
 
Eaddy BarnesITCommented:
are you using the check box in place of the buttons or you want the check box to function?
 correctly?
 
 
 GE
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Bm71Author Commented:
I'm wanting to use the checkbox buttons in place of the old buttons you helped with.
0
 
Eaddy BarnesITCommented:
good Luck
GE

on (click) {
 
	if (buildingStatus == "on") {
		buildingStatus = "off";
		_root.mapall2.ubuildings._alpha = 0;
		//mapall2.ubuildings
		trace(buildingStatus);
	} else {
		buildingStatus = "on";
		//mapall2.ubuildings.alpha = 0;
		_root.mapall2.ubuildings._alpha = 100;
		trace(buildingStatus);
	}
	// mapall2.ubuildings._visible = !mapall2.ubuildings._visible;
}

Open in new window

0
 
Eaddy BarnesITCommented:
are you having trouble with it?

GE
0
 
pepsichrisCommented:
It's just a scope issue - post the full code/FLA here and we'll sort it out for you...
0
 
Bm71Author Commented:
I got this to partially work. I had to change the "on (click)" at the beginning to "on (press)".  This activates the hidden info, but it still doesn't enable the check box to stay on. My checkbox buttons has two frames on it the first unchecked and the second checked. the original code I place on the button...

on (press){
 if(this._currentframe == 1){
   gotoAndStop(2)
 }else{
   gotoAndStop(1)
 }
}

enabled it to work. By that I mean toggling between a checked and unchecked state. Is there some way to incorporate this original with your code with the code you sent over?  
 
0
 
Eaddy BarnesITCommented:
could you send me your present main file. so i can view the data.
and see what you mean directly?

feel free to drop a comment or 2 so i can find your code faster :)

Thx

GE
0
 
Bm71Author Commented:
I sent it over.
0
 
Eaddy BarnesITCommented:
file sent back.
please review and let me know

GE
0
 
Bm71Author Commented:
I'm having trouble unstuffing the file. Can you send it as you did before. Zipped or now compression?

Bm71
0
 
Eaddy BarnesITCommented:
fla sent over
GE
0
 
Bm71Author Commented:
Thanks,
The checkbox button now works. Something I notice however is that the blue buildings are now longer clickable to bring bring up additional info. This function still works with the orginal button, but not the new checkbox button. How can this have any thing to do with the new checkbox?

Bm71
0
 
Eaddy BarnesITCommented:
use this on the new check button

on (release) {
 
	if (_root.buildingStatus == "on") {
		_root.buildingStatus = "off";
		_root.mapall2.ubuildings._alpha = 0;
		this.gotoAndStop(1);
 
	} else {
		_root.buildingStatus = "on";
		//mapall2.ubuildings.alpha = 0;
		_root.mapall2.ubuildings._alpha = 100;
		this.gotoAndStop(2);
	}
	// mapall2.ubuildings._visible = !mapall2.ubuildings._visible;
}

Open in new window

0
 
Bm71Author Commented:
Excellent! It's working.

Thanks
0
 
Eaddy BarnesITCommented:
your welcome

good Luck with the rest of your project

GE
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 9
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now