/[flash]/E_viewer.sc
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /E_viewer.sc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9 - (show annotations)
Fri Feb 22 16:42:24 2008 UTC (16 years, 2 months ago) by dpavlin
File size: 6758 byte(s)
- added progress bar to show position in current document
1 ####################################################
2 # Extended viewer
3 #
4 # http://technoargia.free.fr/swftools/ - june 17 - 2006
5 ###################################################
6
7 .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
16 .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
18 .box border_left width=10 height=300 color=gray fill=gray line=3
19
20 .edittext info text="info" color=black size=100% width=60 height=60 align=center border=none noselect variable=infoText
21
22 .outline o_cadre:
23
24 M 12.3,-1.2483537
25 L 40.130855,-1.2483537
26 C 46.945055,-1.2483537 52.430855,4.2374464 52.430855,11.051646
27 L 52.430855,123.77055
28 C 52.430855,130.58475 46.945055,136.07055 40.130855,136.07055
29 L 12.3,136.07055 C 5.4858001,136.07055 0,130.58475 0,123.77055
30 L 0,11.051646 C 0,4.2374464 5.4858001,-1.2483537 12.3,-1.2483537 z
31
32 .end
33 .outline o_arrow:
34
35 M 60.208843,38.698967
36 L 97.86712,38.698967
37 C 97.86712,38.698967 96.176907,25.416467 101.5254,22.698967
38 C 106.94202,19.946851 132.17198,46.056049 131.84195,55.551743
39 C 131.50046,65.377079 105.79971,91.679067 101.5254,88.404518
40 C 97.332023,85.191969 97.86712,72.404518 97.86712,72.404518
41 L 60.208843,72.404518
42 C 57.438843,72.404518 55.208843,70.174518 55.208843,67.404518
43 L 55.208843,43.698967
44 C 55.208843,40.928967 57.438843,38.698967 60.208843,38.698967 z
45
46 .end
47
48 .outline o_home:
49
50 M -53.886767,76.403498
51 L -53.886767,34.745221
52 C -53.886767,34.745221 -63.829917,35.216428 -63.886767,31.086941
53 C -63.943617,26.792438 -48.173573,15.507804 -48.173573,15.507804
54 L -48.460379,-0.8375205
55 L -39.603782,-0.8609028
56 L -39.441205,10.503755
57 C -39.441205,10.503755 -33.561078,0.91501123 -25.033991,0.770391
58 C -16.671921,0.62577077 10.039242,25.68734 11.818784,31.086941
59 C 13.581482,36.435434 1.818784,34.745221 1.818784,34.745221
60 L 1.818784,76.403498
61 C 1.818784,79.173498 -0.411216,81.4035 -3.181216,81.4035
62 L -48.886767,81.4035
63 C -51.656767,81.4035 -53.886767,79.173498 -53.886767,76.403498 z
64
65 .end
66
67 .filled home_idle outline=o_home fill=#336699 color=navy line=4
68 .filled home_hover outline=o_home fill=#3366ff color=salmon line=4
69 .filled home_pressed outline=o_home fill=#4466ff color=red line=3
70
71 .filled arrow_idle outline=o_arrow fill=#336699 color=navy line=4
72 .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
74
75 # .filled menu_background outline=o_cadre fill=salmon color=grey line=3
76
77 .button next
78
79 .show arrow_idle as=idle
80 .show arrow_idle as=area
81 .show arrow_hover as=hover
82 .show arrow_pressed as=pressed
83 # ActionScript
84 .on_release:
85 _root.viewport.nextFrame();
86 _root.updateInfo();
87 .end
88
89 .end
90
91 .button prev
92
93 .show arrow_idle as=idle
94 .show arrow_idle as=area
95 .show arrow_hover as=hover
96 .show arrow_pressed as=pressed
97 # ActionScript
98 .on_release:
99 _root.viewport.prevFrame();
100 _root.updateInfo();
101 .end
102
103 .end
104
105 .button home
106
107 .show home_idle as=idle
108 .show home_idle as=area
109 .show home_hover as=hover
110 .show home_pressed as=pressed
111 # ActionScript
112 .on_release:
113 _root.viewport.gotoAndStop(1);
114 _root.updateInfo();
115
116 /* you can change to your home frame number */
117 .end
118
119 .end
120
121 .button menu_left
122
123 .show border_left as=area alpha=50%
124 .on_move_in :
125 showMenu();
126 .end
127
128 .end
129
130 .sprite viewport
131
132 # slave movie go here
133 .end
134
135 .put viewport
136 # .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
148
149 .put menu_background x=5 y=5 alpha=90%
150 .put home pin=center x=30 y=30 scale=40% alpha=50%
151 .put prev pin=center x=70 y=30 scale=40% alpha=50% rotate=180
152 .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
156
157 # change this animation for show/hide effect of menu
158 .sprite s_menu
159 .frame 1
160
161 .put C_menu alpha=0%
162 .put info alpha=0%
163
164 .frame 5
165
166 .change C_menu alpha=100%
167 .change info alpha=100%
168 .stop
169
170 .frame 10
171
172 .change C_menu alpha=0%
173 .change info alpha=0%
174 .stop
175
176 .end
177
178 # ActionScript
179 .action:
180 // ECMA comments from here!
181
182 _root.viewport.stop();
183 _root.createEmptyMovieClip("menu",500);
184 _root.attachMovie("s_menu","menu",500);
185
186 info._alpha = 50;
187 info.embedFonts = 0;
188 var monStyle = new TextFormat();
189 monstyle.bold = false;
190 monStyle.italic = false;
191 monStyle.border = false;
192 monStyle.font = "_sans";
193 // monStyle.font = "comic";
194 _root.menu.info.setTextFormat(monStyle);
195 _root.menu.info._y = 20; // doesn't work in .put (?)
196
197 function showMenu() {
198 /*
199 _root.menu._y = _root.viewport._ymouse - 60;
200 if(_root.menu._y < 0) {
201 _root.menu._y = 0;
202 };
203 */
204 _root.menu.Play();
205 };
206
207 function updateInfo() {
208 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
226
227 waitouches = new Object();
228 waitouches.onKeyDown = function () {
229 keydownrun=true;
230 _root.kd=Key.getCode();
231 switch(Key.getCode()) {
232 case 40: //Key.DOWN:
233 _root.viewport.nextFrame();
234 updateInfo();
235 break;
236 case 38: //Key.UP:
237 _root.viewport.prevFrame();
238 updateInfo();
239 break;
240 case 33: // PageUp
241 numPage = _root.viewport._currentframe - 5;
242 if(numPage < 1) {
243 _root.viewport.gotoAndStop(1);
244 } else {
245 _root.viewport.gotoAndStop(numPage);
246 };
247 updateInfo();
248 break;
249 case 34: // PageDown
250 numPage = _root.viewport._currentframe + 5;
251 if(numPage > _root.viewport._totalframes) {
252 _root.viewport.gotoAndStop(_root.viewport._totalframes);
253 } else {
254 _root.viewport.gotoAndStop(numPage);
255 };
256 updateInfo();
257 break;
258 case 35: //Key.End:
259 _root.viewport.gotoAndStop(_root.viewport._totalframes);
260 updateInfo();
261
262 break;
263 case 36: //Key.Home:
264 _root.viewport.gotoAndStop(1);
265 updateInfo();
266
267 break;
268 case 37: //Key.left:
269 // ShowMenu();
270 _root.viewport.prevFrame();
271 updateInfo();
272 break;
273 case 39: //Key.Right:
274 // ShowMenu();
275 _root.viewport.nextFrame();
276 updateInfo();
277 break;
278 case 27: //Key.Escape:
279 ShowMenu();
280 updateInfo();
281 break;
282
283 }
284 updateAfterEvent();
285 };
286
287 Key.addListener(waitouches);
288
289 .end
290
291 .end

  ViewVC Help
Powered by ViewVC 1.1.26