
-----------------------------------
Balmung
Mon Oct 01, 2007 8:18 am

Flash if Bar
-----------------------------------
Ok, I have a bar that changes size when it Moves with this:

// Moves Bar up to Start//
on (keyPress "") {
	bar._y = 396.9;
	bar._x = 320.6;
	bar._width = 111.3;
}

// Moves Bar down to Continue //
on (keyPress "") {
	bar._y = 432.9;
	bar._x = 298.9;
	bar._width = 155.5;
}

which works fine but when i go to do an if statement on another button for it, it doesn't work it only does the first if statement and doesn't test the rest.

on (keyPress "") {
	if (bar_.width=111.3) {
		gotoAndStop(2);
	} else {
		gotoAndStop(1);
	}
}

-----------------------------------
Steven Toews
Sun May 04, 2008 10:44 am

Re: Flash if Bar
-----------------------------------
Well this is one hell of a late reply but just incase people out there have the same question sometime... you should put it in a function that is constantly being repeated, if you want your if statements to be cycled through...

Ok, I have a bar that changes size when it Moves with this:

// Moves Bar up to Start//
on (keyPress "") {
	bar._y = 396.9;
	bar._x = 320.6;
	bar._width = 111.3;
}

// Moves Bar down to Continue //
on (keyPress "") {
	bar._y = 432.9;
	bar._x = 298.9;
	bar._width = 155.5;
}

which works fine but when i go to do an if statement on another button for it, it doesn't work it only does the first if statement and doesn't test the rest.

on (keyPress "") {
	if (bar_.width=111.3) {
		gotoAndStop(2);
	} else {
		gotoAndStop(1);
	}
}


You should try...


bar.onEnterFrame = function() {

// Moves Bar up to Start//
on (keyPress "") {
	bar._y = 396.9;
	bar._x = 320.6;
	bar._width = 111.3;
}

// Moves Bar down to Continue //
on (keyPress "") {
	bar._y = 432.9;
	bar._x = 298.9;
	bar._width = 155.5;
}

on (keyPress "") {
	if (bar._width=111.3) {
		gotoAndStop(2);
	} else {
		gotoAndStop(1);
	}
}
}




