today i found my self trying to put an Sprite on the top of the display list
so here is the basic idea for solve that problem
1
2
3
4
5
6
7
8
9
10
11
function alwaysOnTop_handler(e:Event):void {
//make this child always on top!
parent.addChild(this);
}
function added_handler(e:Event):void {
parent.addEventListener(Event.ADDED, alwaysOnTop_handler, false, 0, true);
}
addEventListener(Event.ADDED_TO_STAGE, added_handler, false, 0, true)
cheers!
Posted in AS3, General | Tagged Display List |
Using the Flash CS4 i had a little problem… everytime i tried to use the text tool, either flash crashed after or before even putting the text box on stage.
Thinking it was a flash bug i google search it… i found this.
i read only a few top posts and found that the issue was the [...]
well this is a handy code snippet to validate a string
if you want to avoid some bad words, this is for you:
1
2
3
4
5
6
7
8
9
10
11
12
function isValid(str:String):Boolean {
var regExp:RegExp = /\b(badword|nastyWord)\b/i;
var _isValid:Boolean = !regExp.test(str);
return _isValid;
}
var _inValidMessage = "this is a example for a [...]