Prev | Current Page 644 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

now().getTime() - start;
if (step < duration)
{
for(i in 0...properties.length)
{
// cubic function to obtain an ease-out effect
var x = step/duration - 1;
var v = deltas[i]*(x*x*x+1)+originals[i];
// adjust the value when in proximity of its target value;
// avoids strange adjustaments at the end of the transition
if(v < targetvalues[i] + tollerance & & v > targetvalues[i] - tollerance)
v = targetvalues[i];
Reflect.setField(mc, properties[i], v);
}
} else
mc.removeEventListener(Event.ENTER_FRAME, frameHandler);
};
mc.addEventListener(Event.ENTER_FRAME, frameHandler);
}
}
To compile the preceding example, use the following command at the prompt/console:
> haxe -swf sample.swf -swf-version 9 -main Main --flash-strict -swfheader
640:480:60:000000
The Drawing API
The Flash drawing API enables you to generate vector graphics dynamically on top of visual objects
( flash.MovieClip in Flash 6 to 8, and flash.display.Sprite in Flash 9). The API provides a way to
draw lines and fill geometries with many different styles.


Pages:
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656