-
Notifications
You must be signed in to change notification settings - Fork 0
/
Trailer.as
332 lines (289 loc) · 8.44 KB
/
Trailer.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
package classes {
import flash.display.MovieClip;
import flash.events.Event;
import flash.utils.*;
public class Trailer extends MovieClip {
public var executionPipeline:Array;
public var currQuote:MovieClip;
public var partsStarted:Array = new Array();
// public var bigText1:String = "WHERE AM I?"
public var wordInterval:int;
public var currWordCount:int = 0;
public var currWordArray:Array = new Array();
public const NUMBER_OF_PARTS:int = 20;
public const FADE_RATE:Number = 0.01;
public const FADE_RATE_FAST:Number = 0.05;
public const SPEECH_TIME:int = 500;
public const PART_BUFFER:int = 2000;
public function Trailer() {
for(var i:int = 0; i < NUMBER_OF_PARTS; i++){
partsStarted[i] = false;
}
invis(q1);
invis(q2);
invis(TC)
invis(availableNow)
reset();
//setTimeout(part11, PART_BUFFER); // part2
setTimeout(part13, 0);
addEventListener(Event.ENTER_FRAME, onFrame, false, 0, true);
}
private function onFrame(e:flash.events.Event):void{
trace(getTimer()/1000);
}
public function reset():void {
bigText.text = "";
smallText.text = "";
chopText.text = "";
}
public function part0():void {
partsStarted[0] = true;
currQuote = q1;
genericFadeInCurrQuote();
}
public function part1():void {
partsStarted[1] = true;
currQuote = q2;
genericFadeInCurrQuote();
}
public function part2():void {
partsStarted[2] = true;
// currWordArray = bigText1.split(" ");
// currWordCount = 0;
// wordInterval = setInterval(showNewWord, 400);
setTimeout(function(){
bigText.text = "Where am I?";
genericFadeInBigText();
}, SPEECH_TIME);
setTimeout(part4, PART_BUFFER);
}
// public function part3(){
// partsStarted[3] = true;
// blackBackground.visible = false;
// bigText.text = "";
// // justZye.visible = true;
// setTimeout(part4, 2500);
// }
public function part4():void{
partsStarted[4] = true;
setTimeout(function(){
smallText.text = "You're in the internet.";
genericFadeInsmallText();
}, SPEECH_TIME);
setTimeout(part6, PART_BUFFER);
}
// public function part5(){
// partsStarted[5] = true;
// smallText.text = "";
// blackBackground.visible = false;
// // theInternet.visible = true;
// setTimeout(part6, PART_BUFFER);
// }
public function part6():void{
partsStarted[6] = true;
reset();
setTimeout(function(){
bigText.text = "How do I get out of here?";
genericFadeInBigText();
}, SPEECH_TIME);
setTimeout(part8, PART_BUFFER);
}
// public function part7(){
// partsStarted[7] = true;
// blackBackground.visible = false;
// bigText.text = "";
// justZye.visible = true;
// justZye.gotoAndPlay('run');
// setTimeout(part8, 2500);
// }
public function part8():void{
partsStarted[8] = true;
setTimeout(function(){
smallText.text = "Harness the energy of this place.";
genericFadeInsmallText();
}, SPEECH_TIME);
setTimeout(part9, PART_BUFFER*1.5);
}
public function part9():void{
partsStarted[9] = true;
reset();
setTimeout(function(){
bigText.text = "...What energy?";
genericFadeInBigText();
}, SPEECH_TIME);
setTimeout(part10, PART_BUFFER);
}
public function part10():void{
partsStarted[10] = true;
setTimeout(function(){
smallText.text = "HATE.";
genericFadeInsmallText();
}, SPEECH_TIME*3);
}
public function part11():void{
partsStarted[11] = true;
setTimeout(function(){
chopText.text = "Use the tools of the internet.";
genericFadeInChopText();
}, 0);
}
public function part12():void{
partsStarted[12] = true;
setTimeout(function(){
chopText.text = "In a game about internet hate...";
genericFadeInChopText();
}, 0);
}
public function part13():void{
partsStarted[13] = true;
setTimeout(function(){
genericFadeInTC();
}, 0);
}
public function part14():void{
partsStarted[14] = true;
setTimeout(function(){
genericFadeInAvailableNow();
}, 0);
}
// public function showNewWord():void{
// if(currWordCount < currWordArray.length){
// bigText.appendText(currWordArray[currWordCount]);
// if(currWordCount < currWordArray.length - 1){
// bigText.appendText(' ');
// }
// currWordCount++;
// }else{
// if(!partsStarted[3]){
// setTimeout(part3, 1500);
// }else{
// setTimeout(part4, 1500);
// }
// }
// }
public function invis(mc:MovieClip):void{
mc.alpha = 0;
mc.visible = false;
}
public function genericFadeInAvailableNow():void{
availableNow.visible = true;
availableNow.alpha = 0;
addEventListener(Event.ENTER_FRAME, genericFadeInAvailableNowOnFrame);
}
public function genericFadeInAvailableNowOnFrame(e:Event):void{
if(availableNow.alpha < 1){
availableNow.alpha += FADE_RATE_FAST;
}else{
availableNow.alpha = 1;
removeEventListener(Event.ENTER_FRAME, genericFadeInAvailableNowOnFrame);
//setTimeout(genericFadeOutBigText, 500);
}
}
public function genericFadeInTC():void{
TC.visible = true;
TC.alpha = 0;
addEventListener(Event.ENTER_FRAME, genericFadeInTCOnFrame);
}
public function genericFadeInTCOnFrame(e:Event):void{
if(TC.alpha < 1){
TC.alpha += FADE_RATE_FAST;
}else{
TC.alpha = 1;
removeEventListener(Event.ENTER_FRAME, genericFadeInTCOnFrame);
//setTimeout(genericFadeOutBigText, 500);
}
}
public function genericFadeInBigText():void{
bigText.visible = true;
bigText.alpha = 0;
addEventListener(Event.ENTER_FRAME, genericFadeInOnFrameBigText);
}
public function genericFadeInOnFrameBigText(e:Event):void{
if(bigText.alpha < 1){
bigText.alpha += FADE_RATE_FAST;
}else{
bigText.alpha = 1;
removeEventListener(Event.ENTER_FRAME, genericFadeInOnFrameBigText);
//setTimeout(genericFadeOutBigText, 500);
}
}
public function genericFadeOutBigText():void{
addEventListener(Event.ENTER_FRAME, genericFadeOutOnFrameBigText);
}
public function genericFadeOutOnFrameBigText(e:Event):void{
if(bigText.alpha > 0){
bigText.alpha -= FADE_RATE_FAST;
}else{
bigText.alpha = 0;
removeEventListener(Event.ENTER_FRAME, genericFadeOutOnFrameBigText);
}
}
public function genericFadeInsmallText():void{
smallText.visible = true;
smallText.alpha = 0;
addEventListener(Event.ENTER_FRAME, genericFadeInOnFrameSmallText);
}
public function genericFadeInOnFrameSmallText(e:Event):void{
if(smallText.alpha < 1){
smallText.alpha += FADE_RATE_FAST;
}else{
smallText.alpha = 1;
removeEventListener(Event.ENTER_FRAME, genericFadeInOnFrameSmallText);
//setTimeout(genericFadeOutSmallText, 500);
}
}
public function genericFadeOutSmallText():void{
addEventListener(Event.ENTER_FRAME, genericFadeOutOnFrameSmallText);
}
public function genericFadeOutOnFrameSmallText(e:Event):void{
if(smallText.alpha > 0){
smallText.alpha -= FADE_RATE_FAST;
}else{
smallText.alpha = 0;
removeEventListener(Event.ENTER_FRAME, genericFadeOutOnFrameSmallText);
}
}
public function genericFadeInChopText():void{
chopText.visible = true;
chopText.alpha = 0;
addEventListener(Event.ENTER_FRAME, genericFadeInOnFrameChopText);
}
public function genericFadeInOnFrameChopText(e:Event):void{
if(chopText.alpha < 1){
chopText.alpha += FADE_RATE_FAST;
}else{
chopText.alpha = 1;
removeEventListener(Event.ENTER_FRAME, genericFadeInOnFrameChopText);
}
}
public function genericFadeInCurrQuote():void{
currQuote.visible = true;
addEventListener(Event.ENTER_FRAME, genericFadeInOnFrameCurrQuote);
}
public function genericFadeInOnFrameCurrQuote(e:Event):void{
if(currQuote.alpha < 1){
currQuote.alpha += FADE_RATE;
}else{
currQuote.alpha = 1;
removeEventListener(Event.ENTER_FRAME, genericFadeInOnFrameCurrQuote);
setTimeout(genericFadeOutCurrQuote, PART_BUFFER/2);
}
}
public function genericFadeOutCurrQuote():void{
addEventListener(Event.ENTER_FRAME, genericFadeOutOnFrameCurrQuote);
}
public function genericFadeOutOnFrameCurrQuote(e:Event):void{
if(currQuote.alpha > 0){
currQuote.alpha -= FADE_RATE;
}else{
currQuote.alpha = 0;
removeEventListener(Event.ENTER_FRAME, genericFadeOutOnFrameCurrQuote);
if(!partsStarted[1]){
setTimeout(part1, PART_BUFFER/2);
}else{
setTimeout(part2, 750);
}
}
}
}
}