Changeset 8181 for lang/actionscript

Show
Ignore:
Timestamp:
03/20/08 13:17:09 (5 years ago)
Author:
gyuque
Message:

doubleslider: animation

Location:
lang/actionscript/doubleslider
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • lang/actionscript/doubleslider/DTest.as

    r8180 r8181  
    1717                        mBar.addEventListener(DoubleSliderEvent.HIT_POSITION, onHitPosition); 
    1818                        mBar.addEventListener(DoubleSliderEvent.HIT_HALF_POSITION, onHitHalfPosition); 
     19                        mBar.addEventListener(DoubleSliderEvent.POSITION_CHANGED, onPositionChanged); 
    1920 
    2021                        var lp:TestLabelProvider = new TestLabelProvider(); 
     
    6970                } 
    7071 
     72                private function onPositionChanged(e:DoubleSliderEvent):void 
     73                { 
     74                        if (mUseExternal) 
     75                        { 
     76                                try 
     77                                { 
     78                                        ExternalInterface.call("onDoubleSliderPositionChanged", e.fixedPosition); 
     79                                } 
     80                                catch(e:Error) 
     81                                { 
     82                                } 
     83                        } 
     84                } 
     85 
    7186                private function api_init():Boolean 
    7287                { 
  • lang/actionscript/doubleslider/SampleTimeline.as

    r8180 r8181  
    3434                                Security.allowDomain("localhost"); 
    3535                                ExternalInterface.addCallback("showAndAnimation", showAndAnimation); 
     36                                ExternalInterface.addCallback("singleFrame", singleFrame); 
    3637                        } 
    3738                        catch(e:Error) { 
  • lang/actionscript/doubleslider/doubleslider/DBar.as

    r8180 r8181  
    145145                } 
    146146 
     147                private function fireChangedEvent(pos:int):void 
     148                { 
     149                        var e:DoubleSliderEvent = new DoubleSliderEvent(DoubleSliderEvent.POSITION_CHANGED); 
     150                        e.fixedPosition = pos; 
     151                        dispatchEvent(e); 
     152                } 
     153 
    147154                public function endAnimation():void 
    148155                { 
     
    160167                        if (thumb == mDownThumb) 
    161168                        { 
     169                                fireChangedEvent(mDownThumb.position); 
    162170                                mUpThumb.position = mDownThumb.position; 
    163171                                endAnimation(); 
     
    168176                                if (mUpThumb.dragging) 
    169177                                { 
     178                                        fireChangedEvent(mUpThumb.position); 
    170179                                        mUpThumb.resetOffset(); 
    171180 
  • lang/actionscript/doubleslider/doubleslider/DoubleSliderEvent.as

    r8177 r8181  
    55        { 
    66                public static const HIT_POSITION:String = "dsevent_hit_position"; 
     7                public static const POSITION_CHANGED:String = "dsevent_position_changed"; 
    78                public static const HIT_HALF_POSITION:String = "dsevent_hit_half_position"; 
    89                function DoubleSliderEvent(type:String) 
  • lang/actionscript/doubleslider/dstest.js

    r8180 r8181  
    33function onDoubleSliderHitPosition() 
    44{ 
     5} 
     6 
     7function onDoubleSliderPositionChanged(pos) 
     8{ 
     9        document.getElementById("timelineswf").singleFrame(pos); 
    510} 
    611