Open GoogleCodeExporter opened 9 years ago
[deleted comment]
[deleted comment]
Missed some stuff -- here's an updated progress getter/setter that takes clips
into
account, and a new getter/setter "clip" that allows you to set a clip w/o
initiating
playback:
public function get progress():Number {
var st:Number;
var et:Number;
if (_clip) {
st=_clip.startTime;
et=_clip.endTime;
} else {
st=startTime;
et=endTime;
}
return (_currentTime-st)/(et-st);
}
public function set progress(inVal:Number):void {
var st:Number;
var et:Number;
if (_clip) {
st=_clip.startTime;
et=_clip.endTime;
} else {
st=startTime;
et=endTime;
}
currentTime=st+(inVal*(et-st));
}
public function set clip(inClip:String):void {
if(inClip && inClip.length && _clipByName[inClip] is AnimationClip3D)
{
_clip = _clipByName[inClip];
}
else
{
_clip = null;
}
}
public function get clip():String {
return _clip.name;
}
Original comment by t...@tom-callahan.com
on 6 Mar 2010 at 2:11
Original issue reported on code.google.com by
t...@tom-callahan.com
on 4 Mar 2010 at 3:45