17 November, 2010

AMF3 expected int but got double

Surprise :-)

Max AMF3 value for integer = 268435456.

In AMF3 integers are serialized using a variable length unsigned 29-bit integer. The ActionScript integer types - a signed 'int' type and an unsigned 'uint' type - are also represented using 29-bits. If the value of an unsigned integer (uint) is greater or equal to 22^9 or if the value of a signed integer (int) is greater than or equal to 22^8 then it will be represented as a double and thus serialized in using the AMF3 double type.

10 November, 2010

Flex: load external CSS


  1. Create and compile css file (mxmlc -static-rsls=true -output=out/style.swf src/style.css)

  2. Load this style file from the application (styleManager.loadStyleDeclarations('style.swf');)

28 March, 2010

Flex compiler locale

In order to switch flex compiler messages to US locale put this string "-Duser.language=en -Duser.region=US" into the $FLEX_HOME/bin/jvm.config file.

...
java.args=-Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en -Duser.region=US
...

25 January, 2010

Enable disabled menu in browser

Execute this from the address line:
javascript: (function(){document.oncontextmenu=function(){return true;}})()
or
javascript: (function(){function test(){return true;}; document.oncontextmenu=test;document.onselectstart=test;document.oncontextmenu=test;})()