| var picName:Array = new Array("ソルボンヌ","ゼブダズル","ディアボロ","ファンジオ","ヘリットザーム","ロビナ","ニンフ","ウイルケアル","レッドアラート","ボコタ","ブリアンコン","リトーウェン");
var picNum:Number = picName.length;
var flag:Number = Math.floor(picNum/2)+1;
var r:Number;
var rollover:Boolean;
var pageRelease:Boolean;
for (i=1; i<=picNum; i++) {
sheetFlow(i);
}
function sheetFlow(n) {
var page = attachMovie("page", "page"+n, n);
page._x = 300+(n-5)*15;
page._y = 30;
page.targetScaleX = (n-flag)*8;
page.p_mc = page.attachMovie("p"+n, "p"+n, n);
with (page.p_mc) {
_xscale = 40;
_yscale = 30;
_x = 30;
_y = 150;
_alpha = 60;
}
page.gotoAndStop(5);
rollover = true;
page.onRollOver = function() {
pageRelease = false;
flag = n;
rollover = true;
};
page.onRollOut = function() {
rollover = false;
if (!pageRelease) {
this.p_mc._alpha = 60;
}
};
page.onRelease = function() {
pageRelease = true;
};
page.onEnterFrame = function() {
r = flag;
if (rollover) {
if (n == r) {
this.gotoAndStop(1);
this.tf._visible = true;
this.p_mc._alpha = 100;
this.p_mc._y = 150;
this.close_btn._visible = false;
this.targetScaleX = 30;
this.targetScaleY = 80;
this.targetX = 300+(n-5)*20-250*30/100/2;
this.targetY = 82.5;
this.ptargetScaleY = 30;
page.tf.text = picName[n-1];
} else {
this.gotoAndStop(5);
this._visible = true;
this.tf._visible = false;
this.p_mc._y = 150;
this.targetScaleX = (n-r)*8;
this.targetScaleY = 100;
this.targetX = 300+(n-5)*20+(250*30/100/2/2)*(n-r)/Math.abs(n-r);
this.targetY = 30;
}
}
if (pageRelease) {
if (n == r) {
this.p_mc._y = 65;
this.targetScaleX = 200;
this.targetScaleY = 100;
this.targetX = 60;
this.targetY = 30;
this.ptargetScaleY = 65;
this.swapDepths(100);
attachMovie("close_btn","close_btn",101);
close_btn._x = 600;
close_btn._y = 540;
close_btn.onPress = function() {
pageRelease = false;
flag = n;
rollover = true;
close_btn.removeMovieClip();
};
} else {
this.p_mc._y = 150;
this._visible = false;
this.targetScaleX = (n-r)*8;
this.targetScaleY = 100;
this.targetX = 300+(n-5)*20+(250*30/100/2/2)*(n-r)/Math.abs(n-r);
this.targetY = 30;
this.ptargetScaleY = 30;
}
}
this._xscale += (this.targetScaleX-this._xscale)/3;
this._yscale += (this.targetScaleY-this._yscale)/3;
this._x += (this.targetX-this._x)/3;
this._y += (this.targetY-this._y)/3;
this.p_mc._yscale += (this.ptargetScaleY*1.2-this.p_mc._yscale)/3;
this.pOrder = n-r;
depths = (this.pOrder<=0) ? this.pOrder : -100-this.pOrder;
this.swapDepths(depths);
};
} |
写真の題名
写真枚数
サムネイルが正面向きに表示されるページ
flagの置き換え変数
ロールオーバーされた時の合図
リリースされた時の合図
ページ(写真)の枚数だけ順に
sheetFlow関数を実施
page1,page2,,,のインスタンス化
横方向のスケールで+とーで逆向きになる
各ページにp1,p2,,,をattachする
写真のページ上の位置、大きさ、透明度
台形表示
初期はロールオーバーモードに
ページがロールオーバーされたら
n番目のページであることを合図する
パージがロールアウトされたら
リリースモードでなければ
透明度を60%に
ページがリリースされたら
flag値を r に置き換える
ロールオーバーされたら
ロールオーバーされたページ
矩形に
テキスト表示オン
close_btnを非表示に
幅を広めにとる
高さを若干縮める
広げた分だけ中心座標を補正する
ページ上の写真のy座標
写真題名表示
その他のページ
台形表示に
表示オン
テキスト表示オフ
ロールオーバーされたページが広がるため、その分その他のページを左右にずらす
ページがリリースされたら
リリースされたページ
ページ横幅を倍に拡大
写真の大きさを65%に拡大
一番上層に表示
close_btnをインスタンス化
ボタンの表示位置(好みで配置)
close_btnがプレスされたら
ボタンを削除
その他のページ
非表示に
本来の表示位置、大きさに
上記各条件において定義した、スケール、座標に減速しながら移動し配置する
ロールオーバーさているページが最上層に来て、左右のページが順に奥に来るように深度を設定
|