/[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 12 - (show annotations)
Fri Feb 22 19:04:44 2008 UTC (16 years, 1 month ago) by dpavlin
File size: 6033 byte(s)
- remove obsolete round background (which has wrong orientation :-)
- make pressed icons red to better indicate that reader is doing something
  (somewhat helps on really complicated pdf documents)
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=white line=2
13 .box page_current_page width=10 height=10 color=black fill=white line=0
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 width=110 height=20 align=center border=none noselect variable=infoText font=comic size=12pt
21
22 .outline o_arrow:
23
24 M 60.208843,38.698967
25 L 97.86712,38.698967
26 C 97.86712,38.698967 96.176907,25.416467 101.5254,22.698967
27 C 106.94202,19.946851 132.17198,46.056049 131.84195,55.551743
28 C 131.50046,65.377079 105.79971,91.679067 101.5254,88.404518
29 C 97.332023,85.191969 97.86712,72.404518 97.86712,72.404518
30 L 60.208843,72.404518
31 C 57.438843,72.404518 55.208843,70.174518 55.208843,67.404518
32 L 55.208843,43.698967
33 C 55.208843,40.928967 57.438843,38.698967 60.208843,38.698967 z
34
35 .end
36
37 .outline o_home:
38
39 M -53.886767,76.403498
40 L -53.886767,34.745221
41 C -53.886767,34.745221 -63.829917,35.216428 -63.886767,31.086941
42 C -63.943617,26.792438 -48.173573,15.507804 -48.173573,15.507804
43 L -48.460379,-0.8375205
44 L -39.603782,-0.8609028
45 L -39.441205,10.503755
46 C -39.441205,10.503755 -33.561078,0.91501123 -25.033991,0.770391
47 C -16.671921,0.62577077 10.039242,25.68734 11.818784,31.086941
48 C 13.581482,36.435434 1.818784,34.745221 1.818784,34.745221
49 L 1.818784,76.403498
50 C 1.818784,79.173498 -0.411216,81.4035 -3.181216,81.4035
51 L -48.886767,81.4035
52 C -51.656767,81.4035 -53.886767,79.173498 -53.886767,76.403498 z
53
54 .end
55
56 .filled home_idle outline=o_home fill=#336699 color=navy line=4
57 .filled home_hover outline=o_home fill=#3366ff color=salmon line=4
58 .filled home_pressed outline=o_home fill=#8866ff color=red line=3
59
60 .filled arrow_idle outline=o_arrow fill=#336699 color=navy line=4
61 .filled arrow_hover outline=o_arrow fill=#3366ff color=salmon line=4
62 .filled arrow_pressed outline=o_arrow fill=#8866ff color=red line=3
63
64 .button next
65
66 .show arrow_idle as=idle
67 .show arrow_idle as=area
68 .show arrow_hover as=hover
69 .show arrow_pressed as=pressed
70 # ActionScript
71 .on_release:
72 _root.viewport.nextFrame();
73 _root.updateInfo();
74 .end
75
76 .end
77
78 .button prev
79
80 .show arrow_idle as=idle
81 .show arrow_idle as=area
82 .show arrow_hover as=hover
83 .show arrow_pressed as=pressed
84 # ActionScript
85 .on_release:
86 _root.viewport.prevFrame();
87 _root.updateInfo();
88 .end
89
90 .end
91
92 .button home
93
94 .show home_idle as=idle
95 .show home_idle as=area
96 .show home_hover as=hover
97 .show home_pressed as=pressed
98 # ActionScript
99 .on_release:
100 _root.viewport.gotoAndStop(1);
101 _root.updateInfo();
102
103 /* you can change to your home frame number */
104 .end
105
106 .end
107
108 .button menu_left
109
110 .show border_left as=area alpha=50%
111 .on_move_in :
112 showMenu();
113 .end
114
115 .end
116
117 .sprite viewport
118
119 # slave movie go here
120 .end
121
122 .put viewport
123 # .put menu_left
124
125 .sprite page_bar
126 .frame 1
127 .put page_progress_bar x=0 y=0
128 .put page_current_page x=0 y=0
129 .stop
130 .frame 100
131 .change page_current_page x=100
132 .end
133
134 .sprite C_menu
135
136 .put menu_background x=5 y=5 alpha=90%
137 .put home pin=center x=30 y=30 scale=40% alpha=50%
138 .put prev pin=center x=70 y=30 scale=40% alpha=50% rotate=180
139 .put next pin=center x=110 y=30 scale=40% alpha=50% rotate=0
140
141 .put page_bar x=15 y=50
142 .put info x=15 y=45
143 .end
144
145 # change this animation for show/hide effect of menu
146 .sprite s_menu
147 .frame 1
148
149 .put C_menu alpha=0%
150
151 .frame 5
152
153 .change C_menu alpha=100%
154 .stop
155
156 .frame 10
157
158 .change C_menu alpha=0%
159 .stop
160
161 .end
162
163 # ActionScript
164 .action:
165 // ECMA comments from here!
166
167 _root.viewport.stop();
168 _root.createEmptyMovieClip("menu",500);
169 _root.attachMovie("s_menu","menu",500);
170
171 info._alpha = 50;
172 info.embedFonts = 0;
173
174 function showMenu() {
175 /*
176 _root.menu._y = _root.viewport._ymouse - 60;
177 if(_root.menu._y < 0) {
178 _root.menu._y = 0;
179 };
180 */
181 _root.menu.Play();
182 };
183
184 function updateInfo() {
185 var page = _root.viewport._currentframe;
186 var total = _root.viewport._totalframes;
187
188 var pos = Math.floor(
189 ( page - 1 ) / ( total - 1 ) * 100
190 );
191
192 if ( pos == 0 ) pos = 1;
193
194 _root.menu.C_menu.infoText = String(page) + " / " + String(total)
195 // + "\r" + String(pos)
196 ;
197 _root.menu.C_menu.page_bar.gotoAndStop( pos );
198 };
199
200 updateInfo();
201
202 // Actionscript évènements touches
203
204 waitouches = new Object();
205 waitouches.onKeyDown = function () {
206 keydownrun=true;
207 _root.kd=Key.getCode();
208 switch(Key.getCode()) {
209 case 40: //Key.DOWN:
210 _root.viewport.nextFrame();
211 updateInfo();
212 break;
213 case 38: //Key.UP:
214 _root.viewport.prevFrame();
215 updateInfo();
216 break;
217 case 33: // PageUp
218 numPage = _root.viewport._currentframe - 5;
219 if(numPage < 1) {
220 _root.viewport.gotoAndStop(1);
221 } else {
222 _root.viewport.gotoAndStop(numPage);
223 };
224 updateInfo();
225 break;
226 case 34: // PageDown
227 numPage = _root.viewport._currentframe + 5;
228 if(numPage > _root.viewport._totalframes) {
229 _root.viewport.gotoAndStop(_root.viewport._totalframes);
230 } else {
231 _root.viewport.gotoAndStop(numPage);
232 };
233 updateInfo();
234 break;
235 case 35: //Key.End:
236 _root.viewport.gotoAndStop(_root.viewport._totalframes);
237 updateInfo();
238
239 break;
240 case 36: //Key.Home:
241 _root.viewport.gotoAndStop(1);
242 updateInfo();
243
244 break;
245 case 37: //Key.left:
246 // ShowMenu();
247 _root.viewport.prevFrame();
248 updateInfo();
249 break;
250 case 39: //Key.Right:
251 // ShowMenu();
252 _root.viewport.nextFrame();
253 updateInfo();
254 break;
255 case 27: //Key.Escape:
256 ShowMenu();
257 updateInfo();
258 break;
259
260 }
261 updateAfterEvent();
262 };
263
264 Key.addListener(waitouches);
265
266 .end
267
268 .end

  ViewVC Help
Powered by ViewVC 1.1.26