디자인공부/플래시
슬라이드
Devil-Choi
2010. 2. 17. 03:57
프레임에 액션스크립트 실행후 아래와 같이 작성한다
_root.bt1.onPress = function(){
_root.mc.onEnterFrame = function(){
this._x=this._x + 0.3*(0-this._x)
//현재x좌표=현재x좌표+속도*(타겟위치-현재x좌표)
//300=300+0.3*(0-300) - 슬라이드공식
}
}
_root.bt2.onPress = function(){
_root.mc.onEnterFrame = function(){
this._x=this._x + 0.3*(-300-this._x)
}
}