troubleshooting Question

Toggle switch not working

Avatar of Trying_to_Learn
Trying_to_LearnFlag for Canada asked on
Adobe FlashApache Flex
3 Comments1 Solution991 ViewsLast Modified:
I have a toggle switch that I am using to disable/enable some buttons on a screen.

The disable part works fine, but after that I can't turn the switch off, which doesn't let me enable the buttons again...

Here is my code:
protected function switch_lock_changeHandler(event:Event):void
			{
				
				if (switch_lock.selected = true) 
				{
					cb.enabled = false
					cb1.enabled = false
					cb2.enabled = false
					cb3.enabled = false
					cb4.enabled = false
					cb5.enabled = false
					cb6.enabled = false
					cb7.enabled = false
					cb8.enabled = false
					cb9.enabled = false

				}
				else if (switch_lock.selected = false) 
				{
				cb.enabled = true
				cb1.enabled = true
				cb2.enabled = true
				cb3.enabled = true
				cb4.enabled = true
				cb5.enabled = true
				cb6.enabled = true
				cb7.enabled = true
				cb8.enabled = true
				cb9.enabled = true
					
				}	 
			}			
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros