-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFlashEff2.as
3251 lines (2988 loc) · 103 KB
/
FlashEff2.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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package
{
import com.jumpeye.Events.FLASHEFFEvents;
import com.jumpeye.core.JUIComponent;
import com.jumpeye.flashEff2.core.interfaces.IFlashEffButtonEffect;
import com.jumpeye.flashEff2.core.interfaces.IFlashEffCommand;
import com.jumpeye.flashEff2.core.interfaces.IFlashEffFilter;
import com.jumpeye.flashEff2.core.interfaces.IFlashEffSymbol;
import com.jumpeye.flashEff2.core.interfaces.IFlashEffSymbolText;
import com.jumpeye.flashEff2.core.interfaces.IFlashEffText;
import com.jumpeye.flashEff2.text.FeTable;
import com.jumpeye.flashEff2.text.defaultFade.FeTDefaultFade;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.geom.Transform;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.utils.Timer;
import flash.utils.clearInterval;
import flash.utils.describeType;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;
import flash.utils.setInterval;
public dynamic class FlashEff2 extends JUIComponent
{
public static const SWAP_TYPE_SHOW:String = "show";
public static const SWAP_TYPE_HIDE:String = "hide";
public static const SWAP_TYPE_HIDE_AND_SHOW:String = "hideAndShow";
protected static var REMOVED_FROM_FLASHEFF:Boolean = false;
protected static var eventTypeAsoc:Array = [];
protected static var groupList:Array;
private static var targetPaths:Array;
{
eventTypeAsoc["rollOver"] = "ROLL_OVER";
eventTypeAsoc["rollOut"] = "ROLL_OUT";
eventTypeAsoc["press"] = "MOUSE_DOWN";
eventTypeAsoc["release"] = "MOUSE_UP";
eventTypeAsoc["doubleClick"] = "DOUBLE_CLICK";
eventTypeAsoc["showTransitionStart"] = "";
eventTypeAsoc["showTransitionEnd"] = "";
eventTypeAsoc["hideTransitionStart"] = "";
eventTypeAsoc["hideTransitionEnd"] = "";
}
protected var tepA:IFlashEffCommand;
protected var tepF:IFlashEffFilter;
protected var tepS:FeTDefaultFade;
protected var showPattern:IFlashEffSymbolText;
protected var hidePattern:IFlashEffSymbolText;
protected var swapPattern:IFlashEffSymbolText;
protected var lastTransitionPattern:IFlashEffSymbolText;
protected var partialPattern:IFlashEffSymbol;
protected var _buttonEffect:IFlashEffButtonEffect;
protected var swapFlashEff2:FlashEff2;
protected var _isTransitioning:Boolean = false;
protected var isButtonEffectApplyed:Boolean = false;
protected var drawCalled:Boolean = false;
protected var isDragOut:Boolean = false;
protected var setNewTarget:Boolean = false;
protected var forceHide:Boolean = false;
protected var _textOwnerClip:Sprite;
protected var _partialTextOwnerClip:Sprite;
protected var firstInDepth:Sprite;
protected var hitAreaClip:Sprite;
protected var tTS:Sprite;
protected var buttonTarget:Sprite;
protected var bDBTO:Sprite;
protected var bDBT:Sprite;
protected var aDBT:Sprite;
protected var aDBTO:Sprite;
protected var nextTarget:DisplayObject;
protected var partialInterval:Number;
protected var maxEndEvents:Number = 0;
protected var eventsDispatched:Number = 0;
protected var transitionType:String = "show";
protected var _buttonEffectName:String;
protected var _cTT:String = "";
protected var showTimer:Timer;
protected var hideTimer:Timer;
protected var filterAsoc:Array;
protected var _xml:XML;
private var forceAutoPlay = null;
protected var tempTarget;
protected var _initialTargetTransform:Transform;
protected var _toggle:Boolean = false;
protected var _groupName:String = "feGroup";
protected var _selected:Boolean = false;
private var _filterList:Array;
private var _rollOverCommands:Array;
private var _rollOutCommands:Array;
private var _pressCommands:Array;
private var _releaseCommands:Array;
private var _doubleClickCommands:Array;
private var _showTransitionStartCommands:Array;
private var _showTransitionEndCommands:Array;
private var _hideTransitionStartCommands:Array;
private var _hideTransitionEndCommands:Array;
private var _absChars:Array;
private var _absWords:Array;
private var _absLines:Array;
private var _absCustom:Array;
private var _absMatrix:Array;
private var _target:DisplayObject;
private var _swapTarget:DisplayObject;
private var _targetOwner:MovieClip;
private var _firstLevelOwner:Sprite;
private var _highestOwner:Sprite;
private var _buttonOwner:Sprite;
private var _textField:TextField;
private var __showDelay:Number = 0;
private var __hideDelay:Number = 2;
private var __swapDelay:Number = 0;
private var __targetInstanceName:String = "";
private var __swapTargetInstanceName:String = "";
private var __swapType:String = "hideAndShow";
private var __xmlPath:String = "";
private var __partialPattern:String = "com.jumpeye.flashEff2.text.defaultFade.FeTDefaultFade";
private var __xmlString:String = "";
private var _hideTransitionName:String;
private var _showTransitionName:String;
private var _swapTransitionName:String;
private var _ideDataHolder:String = "";
private var _textTable:FeTable;
private var _partialTable:FeTable;
private var _isTargetVisibleAtEnd:Boolean = false;
private var _isMouseTriggered:Boolean = true;
private var _drawAfterFilters:Boolean = true;
private var _useHandCursor:Boolean = false;
private var _useSwapInsteadHide:Boolean = false;
private var _clearAfterHide:Boolean = true;
private var __showAutoPlay:Boolean = true;
private var __hideAutoPlay:Boolean = true;
private var __targetVisibility:Boolean = true;
private var __swapTargetVisibility:Boolean = false;
public function FlashEff2()
{
super();
this.init();
}
protected function init() : void
{
this._targetOwner = new MovieClip();
this._firstLevelOwner = new Sprite();
this._highestOwner = new Sprite();
this.bDBTO = new Sprite();
this.bDBT = new Sprite();
this.aDBT = new Sprite();
this.aDBTO = new Sprite();
this.aDBT.addChild(this.firstLevelOwner);
this.aDBTO.addChild(this.aDBT);
this.highestOwner.addChild(this.aDBTO);
this.addChild(this.highestOwner);
this.bDBT.addChild(this.targetOwner);
this.bDBTO.addChild(this.bDBT);
this.firstLevelOwner.addChild(this.bDBTO);
this.buttonTarget = this.aDBT;
this.firstInDepth = this.bDBTO;
this.hitAreaClip = new Sprite();
this.addChild(this.hitAreaClip);
this.highestOwner.hitArea = this.hitAreaClip;
this.hitAreaClip.mouseEnabled = false;
this.hitAreaClip.visible = false;
this.hitAreaClip.graphics.beginFill(0);
this.hitAreaClip.graphics.drawRect(0,0,1,1);
this.hitAreaClip.graphics.endFill();
this.hitAreaClip.height = 0;
this.hitAreaClip.width = 0;
this._textOwnerClip = new Sprite();
this._partialTextOwnerClip = new Sprite();
this.targetOwner.addChild(this._textOwnerClip);
this.targetOwner.addChild(this._partialTextOwnerClip);
this._textTable = new FeTable();
this._partialTable = new FeTable();
this._textOwnerClip.addChild(DisplayObject(this.textTable));
this._partialTextOwnerClip.addChild(DisplayObject(this.partialTable));
this.tTS = new Sprite();
this._buttonOwner = new Sprite();
this.aDBTO.addChild(this.buttonOwner);
this.resetArrays();
this._filterList = [];
this._rollOverCommands = [];
this._rollOutCommands = [];
this._pressCommands = [];
this._releaseCommands = [];
this._doubleClickCommands = [];
this._showTransitionStartCommands = [];
this._showTransitionEndCommands = [];
this._hideTransitionStartCommands = [];
this._hideTransitionEndCommands = [];
this.filterAsoc = [];
if(FlashEff2.targetPaths == null)
{
FlashEff2.targetPaths = [];
}
if(groupList == null)
{
groupList = [];
}
this.showTimer = new Timer(this.showDelay * 1000,1);
this.hideTimer = new Timer(this.hideDelay * 1000,1);
this.partialPatternName = this.__partialPattern;
this.addEventListener(Event.REMOVED_FROM_STAGE,this.removedFromStage);
this.autoUpdateMeasuredSize = true;
}
override protected function draw() : void
{
var _loc1_:Boolean = false;
var _loc2_:* = undefined;
var _loc3_:Timer = null;
var _loc4_:* = undefined;
var _loc5_:FlashEff2 = null;
var _loc6_:Point = null;
if(this.isInvalid("all"))
{
super.draw();
if(this.target != null)
{
_loc1_ = false;
if(this.showPattern != null && this.showAutoPlay == true)
{
this.transitionType = "show";
_loc1_ = true;
}
else if(this.hidePattern != null)
{
if(this.hideAutoPlay == true)
{
_loc1_ = true;
this.transitionType = "hide";
}
}
if(this.target.parent != this.targetOwner)
{
if(_loc1_ == true || this.filterList.length > 0 || this.getCommandsNumber() > 0)
{
this.target = this.target;
}
}
this.target.visible = this.targetVisibility;
if(_loc1_)
{
_loc3_ = this[this.transitionType + "Timer"];
if(this[this.transitionType + "Delay"] > 0)
{
_loc3_.reset();
_loc3_.start();
_loc3_.addEventListener(TimerEvent.TIMER,this[this.transitionType + "Caller"]);
if(this.transitionType == "show")
{
if(this.target != null)
{
this.target.visible = false;
}
}
}
else
{
this.transitionEffect(this.transitionType);
}
}
if(this.selected == true)
{
for(_loc4_ in FlashEff2.groupList)
{
if((_loc5_ = FlashEff2.groupList[_loc4_] as FlashEff2) != this)
{
if(_loc5_.selected == true)
{
if(_loc5_.groupName == this.groupName)
{
_loc5_.selected = false;
}
}
}
}
}
if(this.buttonEffect != null)
{
_loc6_ = new Point(this.mouseX,this.mouseY);
_loc6_ = this.localToGlobal(_loc6_);
if(this.highestOwner.hitTestPoint(_loc6_.x,_loc6_.y,true))
{
this.buttonRollOver();
}
else
{
this.buttonRollOut();
}
}
for(_loc2_ in this.filterList)
{
IFlashEffFilter(this.filterList[_loc2_]).remove();
IFlashEffFilter(this.filterList[_loc2_]).apply();
}
}
else if(this.tempTarget != null)
{
trace("FLASHEFF2 WARNING: Please add the target to the display list in order to apply an effect.");
}
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.INIT));
}
}
public function setProperties(param1:*) : void
{
var child:XML = null;
var command:IFlashEffCommand = null;
var filter:IFlashEffFilter = null;
var me:FlashEff2 = null;
var urlLdr:URLLoader = null;
var xmlArg:* = param1;
if(xmlArg is XML)
{
this.invalidate();
this._xml = xmlArg as XML;
this.removeEffect(true);
this.removeAllCommands();
this.removeAllFilters();
this.removeButtonEffect();
if(xmlArg.params.children().length() > 0)
{
this.setProp(xmlArg.params,this);
}
for each(child in xmlArg.patterns.children())
{
switch(String(child.type))
{
case "command":
command = this.addCommandByName(String(child.name),String(child.event));
this.setProp(child.params,command);
break;
case "showCommand":
command = this.addCommandByName(String(child.name),String(child.event));
this.setProp(child.params,command);
break;
case "hideCommand":
command = this.addCommandByName(String(child.name),String(child.event));
this.setProp(child.params,command);
break;
case "filter":
filter = this.addFilterByName(String(child.name));
this.setProp(child.params,filter);
break;
case "buttonEffect":
this.buttonEffectName = String(child.name);
this.setProp(child.params,this.buttonEffect);
break;
case "hide":
this.hideTransitionName = String(child.name);
this.setProp(child.params,this.hidePattern);
break;
case "show":
this.showTransitionName = String(child.name);
this.setProp(child.params,this.showPattern);
break;
case "swap":
this.swapTransitionName = String(child.name);
this.setProp(child.params,this.swapPattern);
break;
}
}
this.drawCalled = false;
this.setDrawTime();
}
else
{
me = this;
urlLdr = new URLLoader();
urlLdr.dataFormat = "text";
urlLdr.addEventListener(Event.COMPLETE,function(param1:Event):void
{
var _loc2_:FLASHEFFEvents = new FLASHEFFEvents(FLASHEFFEvents.COMPLETE);
_loc2_.data = urlLdr.data;
me.dispatchEvent(_loc2_);
var _loc3_:XML = XML(urlLdr.data);
if(String(_loc3_.params.xmlPath.value) == xmlArg)
{
_loc3_.params.xmlPath.value = "";
}
me.setProperties(_loc3_);
});
urlLdr.addEventListener("ioError",function(param1:Event):*
{
trace("FLASHEFF2 ERROR: There was an IO_ERROR problem loading the xml. Please check the xmlPath.");
me.dispatchEvent(param1);
});
urlLdr.load(new URLRequest(xmlArg));
}
}
override public function dispatchEvent(param1:Event) : Boolean
{
var _loc3_:FLASHEFFEvents = null;
var _loc4_:Boolean = false;
var _loc5_:Point = null;
var _loc6_:DisplayObject = null;
var _loc7_:Timer = null;
var _loc8_:DisplayObject = null;
var _loc9_:Boolean = false;
var _loc10_:Boolean = false;
var _loc11_:Boolean = false;
var _loc12_:* = undefined;
var _loc2_:Boolean = true;
if(param1.type == FLASHEFFEvents.TRANSITION_END || param1.type == "defaultPatternFinish")
{
(param1 as FLASHEFFEvents).currentTransitionType = this.currentTransitionType;
++this.eventsDispatched;
if(this.eventsDispatched == this.maxEndEvents)
{
this.runCommands(this["_" + this.currentTransitionType + "TransitionEndCommands"]);
if(this.isTargetVisibleAtEnd == true)
{
if(this.transitionType == "show")
{
this.target.visible = true;
}
this._textOwnerClip.visible = false;
this._partialTextOwnerClip.visible = false;
}
_loc2_ = true;
this._isTransitioning = false;
if(this.transitionType == "show")
{
if(this.isButtonEffectApplyed == true)
{
_loc5_ = new Point(this.mouseX,this.mouseY);
_loc5_ = this.localToGlobal(_loc5_);
if(this.highestOwner.hitTestPoint(_loc5_.x,_loc5_.y,true))
{
this.rollOverButtonHandler(null,true);
}
}
}
_loc3_ = new FLASHEFFEvents(FLASHEFFEvents.TRANSITION_END);
_loc3_.currentTransitionType = this.currentTransitionType;
_loc4_ = false;
if(this.transitionType == "show")
{
if(this.hidePattern != null)
{
if(this.hideAutoPlay == true && this.forceAutoPlay != false || this.forceAutoPlay == true)
{
this.hideTimer.reset();
this.hideTimer.start();
this.forceAutoPlay = null;
this.hideTimer.addEventListener(TimerEvent.TIMER,this.hideCaller);
}
}
}
else
{
if(this.setNewTarget == true)
{
this.hideTimer.stop();
this.showTimer.stop();
_loc6_ = this.target;
this.target = this.nextTarget;
if(_loc6_ != null)
{
_loc6_.visible = false;
}
this.setNewTarget = false;
this.nextTarget = null;
_loc4_ = super.dispatchEvent(_loc3_);
_loc7_ = new Timer(this.showDelay,1);
if(this.showDelay > 0)
{
_loc7_.start();
_loc7_.addEventListener(TimerEvent.TIMER,this.showCallerWeak);
}
else
{
this.show(false);
}
return _loc4_;
}
if(this._cTT == "swap")
{
_loc8_ = this.target;
this.removeSwapFlashEff2();
this.target = this.swapTarget;
this.target.visible = true;
this.swapTarget = null;
_loc8_.visible = this.targetVisibility;
_loc9_ = this.hideAutoPlay;
_loc10_ = this.showAutoPlay;
_loc11_ = this.targetVisibility;
this.__hideAutoPlay = false;
this.__showAutoPlay = false;
this.targetVisibility = true;
this.invalidate();
this.drawNow();
this.__hideAutoPlay = _loc9_;
this.__showAutoPlay = _loc10_;
this.targetVisibility = _loc11_;
this.target.visible = true;
}
else if(this._cTT == "hide")
{
if(this._clearAfterHide == true)
{
this.removeEffect(true);
this.removeButtonEvents();
for(_loc12_ in this.filterList)
{
IFlashEffFilter(this.filterList[_loc12_]).remove();
}
}
}
}
return Boolean(super.dispatchEvent(_loc3_));
}
_loc2_ = false;
}
else if(param1.type == FLASHEFFEvents.TRANSITION_START)
{
this.runCommands(this["_" + this.currentTransitionType + "TransitionStartCommands"]);
(param1 as FLASHEFFEvents).currentTransitionType = this.currentTransitionType;
}
if(_loc2_ == true)
{
return super.dispatchEvent(param1);
}
return true;
}
public function transitionEffect(param1:String = "show") : void
{
var i:* = undefined;
var transt:String = param1;
if(this.isInvalid("all"))
{
for(i in this.filterList)
{
IFlashEffFilter(this.filterList[i]).remove();
IFlashEffFilter(this.filterList[i]).apply();
}
}
this.validate();
this.removeEffect(true);
this.maxEndEvents = 1;
this._cTT = transt;
if(this.target != null)
{
if(this.targetOwner.getChildByName(this.target.name) != this.target)
{
this.target = this.target;
}
try
{
this.eventsDispatched = 0;
this.lastTransitionPattern = this[transt + "Pattern"];
if(transt == "hide")
{
if(this.useSwapInsteadHide == true)
{
if(this.forceHide == false)
{
if(this.swapTarget != null)
{
this._cTT = "swap";
switch(this.swapType)
{
case FlashEff2.SWAP_TYPE_HIDE:
this.addSwapFlashEff2(0);
break;
case FlashEff2.SWAP_TYPE_SHOW:
this.addSwapFlashEff2(this.numChildren);
break;
default:
this.addSwapFlashEff2(0);
}
this.swapFlashEff2.target = this.swapTarget;
this.swapFlashEff2.showDelay = Number(this.swapDelay) || Number(0.0001);
if(this.swapType != FlashEff2.SWAP_TYPE_HIDE)
{
if(this.swapPattern != null)
{
this.swapFlashEff2.showTransition = this.swapPattern;
}
else
{
this.swapFlashEff2.showTransition = this.clonePattern(this.showPattern) as IFlashEffSymbolText;
}
if(this.swapType == FlashEff2.SWAP_TYPE_SHOW)
{
this.target.visible = true;
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.TRANSITION_START));
return;
}
this.maxEndEvents = 2;
}
else
{
this.swapTarget.visible = true;
}
}
else
{
trace("FLASHEFF2 ERROR: The swapTarget property is null, a hide transition will be applied.");
}
}
}
}
if(this.lastTransitionPattern != null)
{
if(this.target.parent != this.targetOwner)
{
this.target = this.target;
}
this.target.visible = true;
this.lastTransitionPattern.component = this;
try
{
this.lastTransitionPattern["target"] = this.target;
}
catch(e:TypeError)
{
trace("FLASHEFF2 ERROR: You have placed a text pattern over a symbol. Please use a symbol pattern instead!");
return;
}
this._isTransitioning = true;
this.lastTransitionPattern[transt]();
}
else
{
trace("FLASHEFF2 WARNING: The " + transt + "Transition pattern is null. The transition will not be applied.");
}
}
catch(e:ReferenceError)
{
throw "FLASHEFF2 ERROR: " + e;
}
}
else if(this.tempTarget != null)
{
trace("FLASHEFF2 WARNING: Please add the target and the component to the display list before applying an effect.");
}
else
{
trace("FLASHEFF2 WARNING: Please set the target or _targetInstanceName property before applying an effect.");
}
this.forceHide = false;
}
public function removeEffect(param1:Boolean = false, param2:IFlashEffSymbolText = null) : void
{
if(param2 == null)
{
param2 = this.lastTransitionPattern;
}
if(param2 != null)
{
param2.remove();
}
if(this.partialPattern != null)
{
this.partialPattern.remove();
}
if(this.textTable != null)
{
this.textTable.removeChilds();
}
if(this.partialTable != null)
{
this.partialTable.removeChilds();
}
if(param1 == false)
{
if(this._isTransitioning == true)
{
this.eventsDispatched = 0;
this.maxEndEvents = 1;
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.TRANSITION_END));
}
}
if(this.target != null)
{
this.target.visible = this._isTargetVisibleAtEnd;
}
this.maxEndEvents = 0;
}
public function removeAll() : void
{
this.removeEffect(true,this.showPattern);
this.removeEffect(true,this.hidePattern);
this.removeSwapFlashEff2();
this.removeAllCommands();
this.removeAllFilters();
this.removeButtonEffect();
this.buttonEffect = null;
this._buttonEffectName = "";
this.removeShowTransition();
this.removeHideTransition();
this.showTimer.stop();
this.hideTimer.stop();
this.showTimer.removeEventListener(TimerEvent.TIMER,this.showCaller);
this.hideTimer.removeEventListener(TimerEvent.TIMER,this.hideCaller);
if(this.target != null)
{
this.removeFromGroupList(this.target);
this.target.visible = true;
this.resetChildDisplayList(this.target);
this.hitAreaClip.width = this.hitAreaClip.height = 0;
}
}
public function show(param1:* = null) : void
{
this.forceAutoPlay = param1;
this.showTimer.stop();
this.hideTimer.stop();
this.transitionType = "show";
this.transitionEffect(this.transitionType);
}
public function hide() : void
{
this.showTimer.stop();
this.hideTimer.stop();
this.transitionType = "hide";
this.transitionEffect(this.transitionType);
}
public function swap(param1:DisplayObject = null, param2:String = "") : void
{
if(param1 != null)
{
this.swapTarget = param1;
}
if(param2 != "")
{
this.swapType = param2;
}
this.useSwapInsteadHide = true;
this.hide();
}
public function drawTextTable(param1:String, param2:String, param3:Number, param4:Array, param5:Number, param6:Number, param7:Array = null) : Boolean
{
var _loc9_:Array = null;
var _loc10_:Array = null;
var _loc11_:Array = null;
var _loc14_:* = undefined;
var _loc15_:* = undefined;
var _loc16_:uint = 0;
var _loc19_:uint = 0;
var _loc28_:Number = NaN;
var _loc29_:Object = null;
var _loc30_:* = undefined;
var _loc31_:Number = NaN;
var _loc32_:Number = NaN;
var _loc33_:Number = NaN;
var _loc34_:Number = NaN;
this.textTable.removeChilds();
this.partialTable.removeChilds();
this.resetArrays();
var _loc8_:Object = this.textTable;
var _loc12_:Boolean = false;
var _loc13_:Boolean = false;
var _loc17_:uint = 1;
var _loc18_:uint = 1;
var _loc20_:uint = 0;
var _loc21_:String = param1;
var _loc22_:String = param1;
_loc17_ = (_loc10_ = this.linesSplit()).length;
var _loc23_:Array = [];
var _loc24_:Array = [];
if(param2 == "lines")
{
this.filterArray(_loc10_,param2,param3,param4);
}
_loc14_ = 0;
while(_loc14_ < _loc17_)
{
if(_loc22_ == "custom")
{
_loc9_ = _loc10_[_loc14_].childs = this.customSplit(_loc10_[_loc14_].text,_loc10_[_loc14_].id,param7[_loc10_[_loc14_].lineId]);
_loc21_ = param1 = "words";
}
else
{
_loc9_ = _loc10_[_loc14_].childs = this.wordsSplit(_loc10_[_loc14_].text,_loc10_[_loc14_].id);
}
_loc10_[_loc14_].owner = this.textTable;
_loc18_ = _loc9_.length;
_loc15_ = 0;
while(_loc15_ < _loc18_)
{
_loc23_.push(_loc9_[_loc15_]);
_loc9_[_loc15_].passed = _loc10_[_loc14_].passed;
_loc9_[_loc15_].owner = this.textTable;
_loc19_ = (_loc11_ = _loc9_[_loc15_].childs = this.charSplit(_loc9_[_loc15_].text,_loc9_[_loc15_].id)).length;
_loc16_ = 0;
while(_loc16_ < _loc19_)
{
_loc11_[_loc16_].passed = _loc9_[_loc15_].passed;
_loc24_.push(_loc11_[_loc16_]);
_loc16_++;
}
_loc15_++;
}
_loc14_++;
}
if(param3 < 100 || param2 == "selectedStrings")
{
if(param2 == "words")
{
this.filterArray(_loc23_,param2,param3,param4);
}
else if(param2 == "letters" || param2 == "selectedStrings")
{
this.filterArray(_loc24_,param2,param3,param4);
}
_loc28_ = param5 * 10;
if(this.transitionType == "hide")
{
_loc28_ = 0;
this._partialTextOwnerClip.alpha = 1;
}
else
{
this._partialTextOwnerClip.alpha = 0;
}
clearInterval(this.partialInterval);
this.partialInterval = setInterval(this.startPartialEffect,_loc28_ * (this.lastTransitionPattern.tweenDuration || 0));
++this.maxEndEvents;
}
switch(param1.toLocaleLowerCase())
{
case "lines":
_loc17_ = _loc10_.length;
_loc8_ = this.textTable;
_loc15_ = 0;
while(_loc15_ < _loc17_)
{
_loc29_ = _loc8_;
if(_loc10_[_loc15_].passed == false)
{
_loc29_ = this.partialTable;
}
_loc30_ = _loc29_.pushChild({
"type":"FeGroup",
"x":_loc10_[_loc15_].bounds.x,
"y":_loc10_[_loc15_].bounds.y,
"text":_loc10_[_loc15_].text,
"bounds":_loc10_[_loc15_].bounds,
"id":_loc10_[_loc15_].id
});
_loc10_[_loc15_].owner = _loc30_;
this._absLines.push(_loc30_);
_loc15_++;
}
param1 = "words";
case "words":
_loc17_ = _loc10_.length;
_loc14_ = 0;
while(_loc14_ < _loc17_)
{
_loc31_ = _loc10_[_loc14_].owner.x;
_loc32_ = _loc10_[_loc14_].owner.y;
_loc8_ = _loc10_[_loc14_].owner;
_loc18_ = (_loc9_ = _loc10_[_loc14_].childs).length;
_loc15_ = 0;
while(_loc15_ < _loc18_)
{
_loc29_ = _loc8_;
_loc33_ = _loc31_;
_loc34_ = _loc32_;
if(_loc9_[_loc15_].passed == false && (_loc21_ == "words" || param2 == "words"))
{
_loc29_ = this.partialTable;
_loc33_ = 0;
_loc34_ = 0;
}
else if(_loc9_[_loc15_].passed == false)
{
_loc33_ = 0;
_loc34_ = 0;
}
_loc30_ = _loc29_.pushChild({
"type":"FeGroup",
"x":_loc9_[_loc15_].bounds.x - _loc33_,
"y":_loc9_[_loc15_].bounds.y - _loc34_,
"text":_loc9_[_loc15_].text,
"bounds":_loc9_[_loc15_].bounds,
"id":_loc9_[_loc15_].id
});
_loc9_[_loc15_].owner = _loc30_;