venerdì, novembre 30, 2007

ActionScript 3: Scale and Alpha Ranges

This was driving me crazy until I stumbled upon this tip from Senocular.

One thing to be wary of, especially when trying to port older code to ActionScript 3, is that the ranges for many popular properties have changed. A few properties that, before, may have had ranges of 0 to 100 are now 0 to 1. Here is a couple of properties that changed; be on a lookout for others:

Code:

ActionScript 2.0  | ActionScript 3.0

_xscale: 0 - 100  | scaleX: 0 - 1

_yscale: 0 - 100  | scaleY: 0 - 1

_alpha:  0 - 100  | alpha:  0 - 1