Tag Archives: snippets

RegEx – search and replace

The problem is to search bit of text and replace any occurance of the searched string with something new, with RegEx class and built-in replace function of String class it is very easy.

Posted in actionscript, flash | Tagged , , , | Comments Off on RegEx – search and replace

JSFL – copy filters stack from Flash IDE into ActionScript 2 or 3 code

Hi, working with designers one will always get into a problem of replication IDE based filters via code, it’s not a pleasant task nor quick as well, but what about if we could actually make it quick and pleasant? Well, … Continue reading

Posted in actionscript, flash | Tagged , , , | Comments Off on JSFL – copy filters stack from Flash IDE into ActionScript 2 or 3 code

Rectangle class, equals method returns incorrect value

Hi, recently I’ve used Rectangle’s equals() method and found that it incorrectly returns false when both rectangles are the same. Problem occurs when any of the properties of the Rectangle are NaN (not a number).

Posted in actionscript, bugs, flash | Tagged , , , , | 1 Comment

useful use of switch block

Hi, recently I have browsed through wonderfl.net and found unknown to me but useful use-case of switch block. The switch is selection control block and usually is used as follows:

Posted in actionscript, flash | Tagged , , , | Comments Off on useful use of switch block

Rectangle with “sorted” edges

In some situation you would like to reassure that given Rectangle object have “top-down, left-right” order you can do it using following two snippets this creates “normalized” copy of the given rectangle this modifies given rectangle directly

Posted in actionscript, flash | Tagged , , | Comments Off on Rectangle with “sorted” edges