--- E_viewer.sc 2008/02/22 15:06:50 8 +++ E_viewer.sc 2008/02/22 16:42:24 9 @@ -8,10 +8,13 @@ .font comic filename="fonts/comic.swf" + .box menu_background width=130 height=60 color=navy fill=gray line=0 + .box page_progress_bar width=110 height=10 color=gray fill=white line=2 + .box page_current_page width=10 height=10 color=black fill=gray line=2 + .box button_idle width=20 height=60 color=blue fill=salmon line=5 .box button_hover width=20 height=60 color=red fill=salmon line=6 .box button_pressed width=20 height=60 color=gray fill=salmon line=5 - .box menu_background width=130 height=50 color=navy fill=gray line=0 .box border_left width=10 height=300 color=gray fill=gray line=3 .edittext info text="info" color=black size=100% width=60 height=60 align=center border=none noselect variable=infoText @@ -132,6 +135,15 @@ .put viewport # .put menu_left +.sprite page_bar +.frame 1 + .put page_progress_bar x=0 y=0 + .put page_current_page x=0 y=0 + .stop +.frame 100 + .change page_current_page x=100 +.end + .sprite C_menu .put menu_background x=5 y=5 alpha=90% @@ -139,6 +151,7 @@ .put prev pin=center x=70 y=30 scale=40% alpha=50% rotate=180 .put next pin=center x=110 y=30 scale=40% alpha=50% rotate=0 + .put page_bar x=15 y=50 .end # change this animation for show/hide effect of menu @@ -192,7 +205,19 @@ }; function updateInfo() { - _root.menu.infoText = String(_root.viewport._currentframe) + " / " + String(_root.viewport._totalframes); + var page = _root.viewport._currentframe; + var total = _root.viewport._totalframes; + + var pos = Math.floor( + ( page - 1 ) / ( total - 1 ) * 100 + ); + + if ( pos == 0 ) pos = 1; + + _root.menu.infoText = String(page) + " / " + String(total) + + "\r" + String(pos) + ; + _root.menu.C_menu.page_bar.gotoAndStop( pos ); }; updateInfo();