AS3 Drop down menu (4)
May 22nd, 2009 by terrypaton, under Library.
A customisable dropdown menu, not the greatest setup, flexible, scrolls and seems to work ok!
May 22nd, 2009 by terrypaton, under Library.
A customisable dropdown menu, not the greatest setup, flexible, scrolls and seems to work ok!
May 20th, 2009 by terrypaton, under Library.
Here’s a simple but effective technique to disolve between images using the bitmapData threshold command. I’ve setup a class that’ll make it easy to apply, but this is really just the start and can be extended and developed quite a bit!
May 16th, 2009 by terrypaton, under Library.
Here’s a small class that I setup to draw a ‘landscape’, well a bunch of wiggly lines at least with a little blurring. Pass a bitmapData and it will draw to it. This could be modified top accept colour parameters and a few other things to make it snazzy.
May 13th, 2009 by terrypaton, under Library.
var sTransform:SoundTransform = new SoundTransform(1,0);
sTransform.volume = 0;
SoundMixer.soundTransform = sTransform;
May 9th, 2009 by terrypaton, under Library.
A simple check for a valid email address, makes sure it has an ‘@’ and a ‘.’
public function checkEmail(_email:String):Boolean {
var passCheck:Boolean = false
var atLoc:int = _email.indexOf(“@”)
var dotLoc:int = _email.indexOf(“.”)
if (atLoc > 0 && dotLoc >0) {
passCheck =true
}
return passCheck
}
Well thanks to Jon, I’ve now looked into a method using Regular Expressions which seems to be a whole bunch better. Sadly the Adobe help was crappy and I instead found some working source here
function isValidEmail(email:String):Boolean {
var EMAIL_REGEX : RegExp = /^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
return Boolean(email.match(EMAIL_REGEX)));
}
May 6th, 2009 by terrypaton, under Library.
Very simple, given a string how do you get an instance on the stage named that?
var _string:String = “myMovieClip”
var _mc:MovieClip = this[_string] as MovieClip