1 |
################################################### # |
#################################################### |
2 |
# Extended viewer |
# Extended viewer |
3 |
# |
# |
4 |
# http://technoargia.free.fr/swftools/ - june 17 - 2006 # |
# http://technoargia.free.fr/swftools/ - june 17 - 2006 |
5 |
################################################### |
################################################### |
6 |
|
|
7 |
.flash filename=E_viewer.swf bbox=100x50 |
.flash filename=E_viewer.swf bbox=100x50 |
8 |
|
|
9 |
|
.font comic filename="fonts/comic.swf" |
10 |
|
|
11 |
|
.box menu_background width=130 height=60 color=navy fill=gray line=0 |
12 |
|
.box page_progress_bar width=110 height=10 color=gray fill=white line=2 |
13 |
|
.box page_current_page width=10 height=10 color=black fill=gray line=2 |
14 |
|
|
15 |
.box button_idle width=20 height=60 color=blue fill=salmon line=5 |
.box button_idle width=20 height=60 color=blue fill=salmon line=5 |
16 |
.box button_hover width=20 height=60 color=red fill=salmon line=6 |
.box button_hover width=20 height=60 color=red fill=salmon line=6 |
17 |
.box button_pressed width=20 height=60 color=gray fill=salmon line=5 |
.box button_pressed width=20 height=60 color=gray fill=salmon line=5 |
18 |
# .box cadre_menu width=50 height=150 color=navy fill=salmon line=2 |
.box border_left width=10 height=300 color=gray fill=gray line=3 |
|
.box border_left width=5 height=800 color=gray fill=white line=3 |
|
19 |
|
|
20 |
.edittext info text="info" color=black size=100% width=60 height=60 align=center border=none noselect variable=infoText |
.edittext info text="info" color=black size=100% width=60 height=60 align=center border=none noselect variable=infoText |
21 |
|
|
72 |
.filled arrow_hover outline=o_arrow fill=#3366ff color=salmon line=4 |
.filled arrow_hover outline=o_arrow fill=#3366ff color=salmon line=4 |
73 |
.filled arrow_pressed outline=o_arrow fill=#4466ff color=red line=3 |
.filled arrow_pressed outline=o_arrow fill=#4466ff color=red line=3 |
74 |
|
|
75 |
.filled cadre_menu outline=o_cadre fill=salmon color=grey line=3 |
# .filled menu_background outline=o_cadre fill=salmon color=grey line=3 |
76 |
|
|
77 |
.button next |
.button next |
78 |
|
|
120 |
|
|
121 |
.button menu_left |
.button menu_left |
122 |
|
|
123 |
.show border_left as=area alpha=0% |
.show border_left as=area alpha=50% |
124 |
.on_move_in : |
.on_move_in : |
125 |
showMenu(); |
showMenu(); |
126 |
.end |
.end |
133 |
.end |
.end |
134 |
|
|
135 |
.put viewport |
.put viewport |
136 |
.put menu_left |
# .put menu_left |
137 |
|
|
138 |
|
.sprite page_bar |
139 |
|
.frame 1 |
140 |
|
.put page_progress_bar x=0 y=0 |
141 |
|
.put page_current_page x=0 y=0 |
142 |
|
.stop |
143 |
|
.frame 100 |
144 |
|
.change page_current_page x=100 |
145 |
|
.end |
146 |
|
|
147 |
.sprite C_menu |
.sprite C_menu |
148 |
|
|
149 |
.put cadre_menu y=5 alpha=90% |
.put menu_background x=5 y=5 alpha=90% |
150 |
.put home pin=center x=25 y=28 scale=40% alpha=50% |
.put home pin=center x=30 y=30 scale=40% alpha=50% |
151 |
.put prev pin=center x=25 y=65 scale=40% alpha=50% rotate=180 |
.put prev pin=center x=70 y=30 scale=40% alpha=50% rotate=180 |
152 |
.put next pin=center x=25 y=95 scale=40% alpha=50% rotate=0 |
.put next pin=center x=110 y=30 scale=40% alpha=50% rotate=0 |
153 |
|
|
154 |
|
.put page_bar x=15 y=50 |
155 |
.end |
.end |
156 |
|
|
157 |
|
# change this animation for show/hide effect of menu |
158 |
.sprite s_menu |
.sprite s_menu |
159 |
.frame 1 |
.frame 1 |
160 |
|
|
161 |
.put C_menu x=-60 |
.put C_menu alpha=0% |
162 |
.put info x=-65 y=110 alpha=50% |
.put info alpha=0% |
163 |
|
|
164 |
.frame 40 |
.frame 5 |
165 |
|
|
166 |
.change C_menu x=5 |
.change C_menu alpha=100% |
167 |
.change info x=0 |
.change info alpha=100% |
168 |
.stop |
.stop |
169 |
|
|
170 |
.frame 80 |
.frame 10 |
171 |
|
|
172 |
.change C_menu x=-60 |
.change C_menu alpha=0% |
173 |
.change info x=-65 |
.change info alpha=0% |
174 |
.stop |
.stop |
175 |
|
|
176 |
.end |
.end |
177 |
|
|
178 |
|
# ActionScript |
179 |
.action: |
.action: |
180 |
|
// ECMA comments from here! |
181 |
|
|
182 |
_root.viewport.stop(); |
_root.viewport.stop(); |
183 |
_root.createEmptyMovieClip("menu",500); |
_root.createEmptyMovieClip("menu",500); |
190 |
monStyle.italic = false; |
monStyle.italic = false; |
191 |
monStyle.border = false; |
monStyle.border = false; |
192 |
monStyle.font = "_sans"; |
monStyle.font = "_sans"; |
193 |
|
// monStyle.font = "comic"; |
194 |
_root.menu.info.setTextFormat(monStyle); |
_root.menu.info.setTextFormat(monStyle); |
195 |
|
_root.menu.info._y = 20; // doesn't work in .put (?) |
|
_root.menu.infoText = "Page\r" + String(_root.viewport._currentframe) + "/" + String(_root.viewport._totalframes); |
|
196 |
|
|
197 |
function showMenu() { |
function showMenu() { |
198 |
_root.menu._y = _root.viewport._ymouse - 60; |
/* |
199 |
if(_root.menu._y < 0) { |
_root.menu._y = _root.viewport._ymouse - 60; |
200 |
_root.menu._y = 0; |
if(_root.menu._y < 0) { |
201 |
}; |
_root.menu._y = 0; |
202 |
_root.menu.Play(); |
}; |
203 |
|
*/ |
204 |
|
_root.menu.Play(); |
205 |
}; |
}; |
206 |
|
|
207 |
function updateInfo() { |
function updateInfo() { |
208 |
_root.menu.infoText = "Page\r" + String(_root.viewport._currentframe) + "/" + String(_root.viewport._totalframes); |
var page = _root.viewport._currentframe; |
209 |
|
var total = _root.viewport._totalframes; |
210 |
|
|
211 |
|
var pos = Math.floor( |
212 |
|
( page - 1 ) / ( total - 1 ) * 100 |
213 |
|
); |
214 |
|
|
215 |
|
if ( pos == 0 ) pos = 1; |
216 |
|
|
217 |
|
_root.menu.infoText = String(page) + " / " + String(total) |
218 |
|
+ "\r" + String(pos) |
219 |
|
; |
220 |
|
_root.menu.C_menu.page_bar.gotoAndStop( pos ); |
221 |
}; |
}; |
222 |
|
|
223 |
|
updateInfo(); |
224 |
|
|
225 |
// Actionscript évènements touches |
// Actionscript évènements touches |
226 |
|
|
227 |
waitouches = new Object(); |
waitouches = new Object(); |
237 |
_root.viewport.prevFrame(); |
_root.viewport.prevFrame(); |
238 |
updateInfo(); |
updateInfo(); |
239 |
break; |
break; |
240 |
case 33: //Page précédente: |
case 33: // PageUp |
241 |
numPage = _root.viewport._currentframe - 5; |
numPage = _root.viewport._currentframe - 5; |
242 |
if(numPage < 1) { |
if(numPage < 1) { |
243 |
_root.viewport.gotoAndStop(1); |
_root.viewport.gotoAndStop(1); |
244 |
} else { |
} else { |
245 |
_root.viewport.gotoAndStop(numPage); |
_root.viewport.gotoAndStop(numPage); |
246 |
}; |
}; |
247 |
updateInfo(); |
updateInfo(); |
248 |
break; |
break; |
249 |
case 34: //Page suivante: |
case 34: // PageDown |
250 |
numPage = _root.viewport._currentframe + 5; |
numPage = _root.viewport._currentframe + 5; |
251 |
if(numPage > _root.viewport._totalframes) { |
if(numPage > _root.viewport._totalframes) { |
252 |
_root.viewport.gotoAndStop(_root.viewport._totalframes); |
_root.viewport.gotoAndStop(_root.viewport._totalframes); |
253 |
} else { |
} else { |
254 |
_root.viewport.gotoAndStop(numPage); |
_root.viewport.gotoAndStop(numPage); |
255 |
}; |
}; |
256 |
updateInfo(); |
updateInfo(); |
257 |
break; |
break; |
266 |
|
|
267 |
break; |
break; |
268 |
case 37: //Key.left: |
case 37: //Key.left: |
269 |
ShowMenu(); |
// ShowMenu(); |
270 |
|
_root.viewport.prevFrame(); |
271 |
|
updateInfo(); |
272 |
break; |
break; |
273 |
case 39: //Key.Right: |
case 39: //Key.Right: |
274 |
|
// ShowMenu(); |
275 |
|
_root.viewport.nextFrame(); |
276 |
|
updateInfo(); |
277 |
|
break; |
278 |
|
case 27: //Key.Escape: |
279 |
ShowMenu(); |
ShowMenu(); |
280 |
|
updateInfo(); |
281 |
break; |
break; |
282 |
|
|
283 |
} |
} |