tweenx
tweenx copied to clipboard
Tweenx.setField for composed Sprites in flash
would it be a performance issue if we use
Reflect.setProperty( o, key, value );
instead of
untyped o[ key ] = value;
for flash target ?
because i use something like this
class View {
#if (flash || openfl)
/**
native flash sprite representing this view in the display list
*/
public var sprite(default, null):Sprite;
#elseif js
/**
native html element representing this view in the DOM
*/
public var element(default, null):Element;
#end
function get_x():Float {#if js return Std.parseInt(element.style.left);#else return sprite.x;#end }
function set_x(value:Float):Float
{
#if element.style.left=value+"px"; return Std.parseInt(element.style.left);#else
return x = sprite.x=value;
#end
}
}
...
TweenX.to (myView,{x:200}.time(1);
arrayAccess doesn't work in that case
thanks