[Tweener] A better way to access private variables in Tweener?

J G justgooddesign at gmail.com
Mon Jul 30 15:11:12 PDT 2007


Is there a better way at accessing this information in Tweener? Or a good
reason this information is private?



//////////////////////////////////////////////////////////////////////////////////////////////////////////


class com.jgraup.transitions.Tweener2 extends caurina.transitions.Tweener
{

    public function Tweener2 (){}
    public static function get timeScale ():Number { return _timeScale }
    public static function getTweenPer ( p_scope:Object ):Number
    {
        /*
        *    USAGE:
        *     var per = Tweener2.getTweenPer ( mc );
        *
        *     OR
        *     var per = Tweener2.getTweenPer ( mc, '_x' );
        */

        var i:Number;
        var tTweening;

        for ( i = 0; i<_tweenList.length; i++)
        {
            tTweening = _tweenList[i];

            if ( arguments.length < 2 )
            {

            //
            //    PERCENTAGE OF TIME BASED ON FIRST OBJECT FOUND
            //

                if ( tTweening .scope == p_scope )
                {
                    var per = ( _currentTime - tTweening.timeStart )/ (
tTweening.timeComplete - tTweening.timeStart )
                    return Math.max ( 0, Math.min ( 1, per) );
                }
            }
            else
            {

            //
            //    PERCENTAGE OF TIME BASED ON OBJECT AND PROPERTY
            //
                if ( tTweening .scope == p_scope )
                {
                    for ( var prop in tTweening.properties)
                    {
                        //     match property to argument passed

                        for ( var a in arguments)
                        {
                            if ( arguments[a] == prop )
                            {
                                var per = ( _currentTime -
tTweening.timeStart )/ ( tTweening.timeComplete - tTweening.timeStart )
                                return Math.max ( 0, Math.min ( 1, per) );
                            }
                        }
                    }

                }
            }
        }
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20070730/f1667132/attachment.html 


More information about the Tweener mailing list