Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML5 issue with getter/setter #73

Open
alamboley opened this issue May 27, 2016 · 2 comments
Open

HTML5 issue with getter/setter #73

alamboley opened this issue May 27, 2016 · 2 comments

Comments

@alamboley
Copy link

Hey, I noticed with the HTML5 target, I was not able to use @isVar. I've to create a variable and also the default getter prevents Tween to work. I've to create getter/setter this way:

var _alpha:Float = 1;
public var alpha(get, set):Float;

function get_alpha():Float {

    return _alpha;
}

function set_alpha(value:Float) {

    return _alpha = value;
}
@MintPaw
Copy link

MintPaw commented Mar 5, 2017

I'm having this issue as well with this.

	public var x(default, set):Float = 0;
	public var y(default, set):Float = 0;
	public var scaleX(default, set):Float = 1;
	public var scaleY(default, set):Float = 1;
	public var rotation(default, set):Float = 0;
	public function set_x(value:Float):Float { trace("Setting x to: "+value); transDirty = true; return x = value; }
	public function set_y(value:Float):Float { transDirty = true; return y = value; }
	public function set_scaleX(value:Float):Float { transDirty = true; return scaleX = value; }
	public function set_scaleY(value:Float):Float { transDirty = true; return scaleY = value; }
	public function set_rotation(value:Float):Float { transDirty = true; return rotation = value; }

I'm not seeing the tween getting the traces in set_x while targeting js, but am in flash, I have -dce no and putting @:keep before the vars, functions, or both doesn't seem to do anything. onComplete and onUpdate seem to fire in time as normal.

@DarthVan
Copy link

Hi, i have same problem with -dce full, and fixed it like that:
Actuate.tween(mySprite, 2.2, {x:1000}); mySprite.x;
Now getter dont die and tween works fine 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants