[Golist] Setting up a relative vs. absolute change value syntax
Joel Stransky
joel at stranskydesign.com
Fri Jun 27 12:05:32 PDT 2008
Sup Goers, *nudge* *nudge*
I'm attempting to bypass useRelative for DepthTween to allow the user to
change x, y and z with a combination of absolute and relative values.
I can't think of a better way to automate this than the classic
String(Number). I assume that means I have to do something like this,
mytween:MyTween = new MyTween("10", 20, -200);
...
class MyTween extends LinearGo{
var _target:DisplayObject;
var _x:Object;
var _y:Object;
var _z:Object;
public function MyTween(target:DisplayObject, x:Object, y:Object,
z:Object){
_target = target;
if(x is String){
_changeX = _startX + Number(x);
}else if(x is Number){
_changeX = x - _startX;
}
}
}
But for some reason that doesn't sit well with me. It forces every getter
and setter involved to be typed as Objects as well which is basically not
typing them at all. What do you guys think? Is this the way to Go?
--
--Joel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://goasap.org/pipermail/golist_goasap.org/attachments/20080627/d17599eb/attachment.html
More information about the GoList
mailing list