1 Replies - 1181 Views - Last Post: 02 November 2016 - 10:36 AM

#1 Moonlightgirl2   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-November 16

Making a button visible after 3 other buttons have been Clicked.

Posted 02 November 2016 - 07:46 AM

SoI have gotten to the point where my other buttons are working like I want them too but then I wanted to try and get the reset button to show up after the user has clicked the other buttons.
Here is the code I need help with:
function checkButtons():void
{
	var buttons:Array = new Array(DummyS_btn, Dummyb_btn, Dummyh_btn);
	
	var Clicked:Boolean = true;
	for (var i:int = 0; i < buttons.length; i++);
	{
		if (buttons(i).currentFrame != 90)
		{
			Clicked = false;
		}
	}
	if (Clicked)
	{
		Dummyr_btn.visible = true;
	}
	else
	{
		Dummyr_btn.visible = false;
	}
}



I have looked through books and other sites and have gotten to this point but I still have compiler errors about undefined "buttons" and I don't even know if this will work?

Can someone give me some advice about if this will work and if not what would work?

This post has been edited by Atli: 02 November 2016 - 08:05 AM
Reason for edit:: Fixed the [code]...[/code] tags.


Is This A Good Question/Topic? 0
  • +

Replies To: Making a button visible after 3 other buttons have been Clicked.

#2 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2413
  • View blog
  • Posts: 7,384
  • Joined: 15-January 14

Re: Making a button visible after 3 other buttons have been Clicked.

Posted 02 November 2016 - 10:36 AM

That looks like it will work. You've defined the buttons array right on the top, I don't know why it would complain that it's undefined unless you're trying to use it in a different scope.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1