減速スライド
減速スライド
基本形
var base:Number; var rate:Number = 5; this.s01_btn.onRollOver = function() { base = main_mc.ph01_mc._x; } this.s02_btn.onRollOver = function() { base = main_mc.ph02_mc._x; } this.s03_btn.onRollOver = function() { base = main_mc.ph03_mc._x; } this.s04_btn.onRollOver = function() { base = main_mc.ph04_mc._x; } this.s05_btn.onRollOver = function() { base = main_mc.ph05_mc._x; } this.main_mc.onEnterFrame = function() { main_mc._x -= (main_mc._x + base)/rate; }
作り方
(1)Photoshopで写真を準備する
- サイズを整える
- サムネール画像も作る
(2)個別にシンボル「ムービークリップ」に変換します
- 基準点からの距離を測るため、左上が「原点」
- サムネールは、「ボタン」「ムービークリップ」どちらでも可
(3)新規シンボル「メイン」を作成します
- 原点から順につないで並べます
(4)それぞれを配置します
- 必要があれば「マスク処理」をします
var base:Number; var startEdge:Number = 10; var rate:Number = 7; this.s01_btn.onRollOver = function() { base = main_mc.ph01_mc._x; } this.s02_btn.onRollOver = function() { base = main_mc.ph02_mc._x; } this.s03_btn.onRollOver = function() { base = main_mc.ph03_mc._x; } this.s04_btn.onRollOver = function() { base = main_mc.ph04_mc._x; } this.s05_btn.onRollOver = function() { base = main_mc.ph05_mc._x; } this.main_mc.onEnterFrame = function() { main_mc._x -= (main_mc._x + base-startEdge)/rate; }
《縦にスライド》
var base:Number; var rate:Number = 3; this.s01_btn.onRollOver = function() { base = main_mc.ph01_mc._y; } this.s02_btn.onRollOver = function() { base = main_mc.ph02_mc._y; } this.s03_btn.onRollOver = function() { base = main_mc.ph03_mc._y; } this.s04_btn.onRollOver = function() { base = main_mc.ph04_mc._y; } this.main_mc.onEnterFrame = function() { main_mc._y -= (main_mc._y + base)/rate; }