 |
Featured jobs
Featured template
View more templates
 |
 |


Check Euqality Of Bools
 |
 |
// AllBool function to detect equality between
// X given Bools and a preset constant (Bool)
// By Jesse Stratford, jesse@actionscript.org
function allBool (name, count, expected) {
for (var k = 1; k<=count; k++) {
if (this[name+k] != expected) {
return false;
}
}
return true;
}
foo1 = true;
foo2 = true;
foo3 = true;
// All true vars, check for truth, returns true
trace (allBool("foo", 3, true));
bar1 = true;
bar2 = true;
bar3 = false;
// One false var, check for truth, returns false
trace (allBool("bar", 3, true));
// Attempt to check 4 vars when only 3 exist
// even though all three are true, return false
trace (allBool("foo", 4, true));
Posted by: Jesse Stratford | website
http://www.ActionScript.org
|
 |
 |
 |
enable and disable all buttons
 |
 |
MovieClip.prototype.disableAllButtons = function(act) {
for (var counter in this) {
if (this[counter].__proto__ == Button.prototype) {
this[counter].enabled = act;
} else if
(this[counter].__proto__ == MovieClip.prototype && this[counter]._parent == this)
{
this[counter].disableAllButtons(act);
}
}
};
ASSetPropFlags(MovieClip.prototype, "disableAllButtons", 7);
用法:
disableAllButtons(false); disableAllButtons(true); myMC.disableAllButtons(false);
Posted by: heskeyo | website
http://www.ooxford.hk.st
|
 |
 |
 |
|  |
Search Entire Site
Advertisements
Latest New Articles
- Set up a simple IIS Server for Flash
by Peter McBride - Day 1 at FITC Toronto 2008
by Anthony Pace - Simple reflection effect with AS2
by Jean Andr Mas - ActionScript.org Meets Josh Tynjala (aka dr_zeus)
by ActionScript.org Staff - Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware
by Sabrina F
|
 |