AS3 – Abstract Classes

abstract classes are not supported by actionscript 3. see http://joshblog.net/2007/08/19/enforcing-abstract-classes-at-runtime-in-actionscript-3/ the above reference also provides a kind of hackish workaround to create abstract classes in as3. Edit also see http://www.kirupa.com/forum/showpost.php?s=a765fcf791afe46c5cf4c26509925cf7&p=1892533&postcount=70 Edit 2 (In response to comment) Unfortunately, you’re stuck with the runtime error. One alternative would be to have a protected constructor…. except as3 doesn’t … Read more

What algorithms could I use for audio volume level? [closed]

human perception in general is logarithmic, also when it comes to things as luminosity, etc. … this enables us to register small changes to small “input signals” of our environement, or to put it another way: to always percieve a change of a perceivable physical quantity in relation to its value … thus, you should … Read more

konami code in flex

A state machine is fun to write, but in this case I’d go with a signature pattern. Depending on where you want to put the handler (on the stage of the component), here’s some code that should work, though you can probably tighten it (and of course customize it to your specific need): // up-up-down-down-left-right-left-right-B-A … Read more

Static Actionscript code analysis possibilities

Update Nov 2018: It would appear that Structure101 (new download page) no longer has an ActionScript variant. Original answer, links outdated: Download Structure101g and select the Actionscript flavor after installing the software. I’ve confirmed that it is able to map out class level and even function call dependencies in Flex/AS3 projects, and generate a visual … Read more

Writing a syntax highlighter

Syntax highlighters can work in two very general ways. The first implements a full lexer and parser for the language(s) being highlighted, exactly identifying each token’s type (keyword, class name, instance name, variable type, preprocessor directive…). This provides all the information needed to exactly highlight the code according to some specification (keywords in red, class … Read more

Can 0.99999999999 be rounded to 1.0 when multiplying?

If you multiply the greatest value below 1.0 with someInt (> 0), the result will never be someInt. This can be exhaustively tested for integers like this: Double greatestLessThanOne = Double.longBitsToDouble(4607182418800017407L); // Assert that greatestLessThanOne is indeed the largest double less than 1. //assert 1.0 == greatestLessThanOne + Math.ulp(greatestLessThanOne); for (int i = 1; i … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)