forked from yehiashouman/AS4JS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_sprite.html
More file actions
180 lines (155 loc) · 6.69 KB
/
example_sprite.html
File metadata and controls
180 lines (155 loc) · 6.69 KB
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
<html><head>
<link type="text/css" rel="stylesheet" href="css/reset.css" media="screen"></style>
<link type="text/css" rel="stylesheet" href="css/player.css" media="screen"></style>
<script src="thirdparty/stacktrace.js"></script>
<script src="events/EventDispatcher.js"></script>
<script src="global.js"></script>
<script src="system/Capabilities.js"></script>
<script src="external/ExternalInterface.js"></script>
<script src="geom/Point.js"></script>
<script src="geom/ColorTransform.js"></script>
<script src="geom/Rectangle.js"></script>
<script src="geom/Matrix.js"></script>
<script src="ui/Keyboard.js"></script>
<script src="ui/KeyboardType.js"></script>
<script src="ui/KeyLocation.js"></script>
<script src="ui/Mouse.js"></script>
<script src="ui/MouseCursor.js"></script>
<script src="ui/MouseCursorData.js"></script>
<script src="events/Event.js"></script>
<script src="events/ActivityEvent.js"></script>
<script src="events/AsyncErrorEvent.js"></script>
<script src="events/ContextMenuEvent.js"></script>
<script src="events/DataEvent.js"></script>
<script src="events/DRMAuthenticationCompleteEvent.js"></script>
<script src="events/DRMAuthenticationErrorEvent.js"></script>
<script src="events/DRMErrorEvent.js"></script>
<script src="events/DRMStatusEvent.js"></script>
<script src="events/ErrorEvent.js"></script>
<script src="events/EventPhase.js"></script>
<script src="events/FocusEvent.js"></script>
<script src="events/FullScreenEvent.js"></script>
<script src="events/GestureEvent.js"></script>
<script src="events/GesturePhase.js"></script>
<script src="events/HTTPStatusEvent.js"></script>
<script src="events/IMEEvent.js"></script>
<script src="events/IOErrorEvent.js"></script>
<script src="events/KeyboardEvent.js"></script>
<script src="events/MouseEvent.js"></script>
<script src="events/NetStatusEvent.js"></script>
<script src="events/PressAndTapGestureEvent.js"></script>
<script src="events/ProgressEvent.js"></script>
<script src="events/SampleDataEvent.js"></script>
<script src="events/SecurityErrorEvent.js"></script>
<script src="events/ShaderEvent.js"></script>
<script src="events/SoftKeyboardEvent.js"></script>
<script src="events/SoftKeyboardTrigger.js"></script>
<script src="events/StageVideoAvailabilityEvent.js"></script>
<script src="events/StageVideoEvent.js"></script>
<script src="events/StatusEvent.js"></script>
<script src="events/SyncEvent.js"></script>
<script src="events/TextEvent.js"></script>
<script src="events/TimerEvent.js"></script>
<script src="events/TouchEvent.js"></script>
<script src="events/TransformGestureEvent.js"></script>
<script src="events/UncaughtErrorEvent.js"></script>
<script src="events/UncaughtErrorEvents.js"></script>
<script src="events/VideoEvent.js"></script>
<script src="utils/getTimer.js"></script>
<script src="utils/Timer.js"></script>
<script src="net/URLRequestMethod.js"></script>
<script src="net/URLVariables.js"></script>
<script src="net/URLRequest.js"></script>
<script src="net/URLLoader.js"></script>
<script src="media/SoundTransform.js"></script>
<script src="media/SoundChannel.js"></script>
<script src="media/Sound.js"></script>
<script src="display/BitmapDataChannel.js"></script>
<script src="display/CapStyle.js"></script>
<script src="display/GradientType.js"></script>
<script src="display/InterpolationMethod.js"></script>
<script src="display/JointStyle.js"></script>
<script src="display/SpreadMethod.js"></script>
<script src="display/StageAlign.js"></script>
<script src="display/StageDisplayState.js"></script>
<script src="display/StageOrientation.js"></script>
<script src="display/StageQuality.js"></script>
<script src="display/DisplayObject.js"></script>
<script src="display/InteractiveObject.js"></script>
<script src="display/Shape.js"></script>
<script src="display/Sprite.js"></script>
<script src="display/DisplayObjectContainer.js"></script>
<script src="display/Stage.js"></script>
<script src="display/BitmapData.js"></script>
<script src="display/Bitmap.js"></script>
<script src="display/CapStyle.js"></script>
<script src="display/JointStyle.js"></script>
<script src="display/Graphics.js"></script>
<script src="display/Sprite.js"></script>
<script src="display/LoaderInfo.js"></script>
<script src="display/Loader.js"></script>
<script src="filters/BitmapFilterQuality.js"></script>
<script src="filters/BitmapFilterType.js"></script>
<script src="filters/BitmapFilter.js"></script>
<script src="filters/BevelFilter.js"></script>
<script src="filters/BlurFilter.js"></script>
<script src="filters/ColorMatrixFilter.js"></script>
<script src="filters/ConvolutionFilter.js"></script>
<script src="filters/DisplacementMapFilterMode.js"></script>
<script src="filters/DisplacementMapFilter.js"></script>
<script src="filters/DropShadowFilter.js"></script>
<script src="filters/GlowFilter.js"></script>
<script src="filters/GradientBevelFilter.js"></script>
<script src="filters/GradientGlowFilter.js"></script>
<script src="text/TextField.js"></script>
<script src="xml/XMLNodeType.js"></script>
<script src="xml/XMLNode.js"></script>
<script src="xml/XMLDocument.js"></script>
<script lang="javascript">
function init(){
var test=new DisplayObjectContainer("stage");
var text = new TextField();
text.border=false;
text.textColor = 0xFF0000;
text.htmlText = "<font family='Verdana' size='25'>AS4JS (rendering at 15fps)</font>";
text.width = 300;
text.height = 300;
var newPosX = 0;
var newPosY = 0;
test.addChild(text);
var origPos={};
function twinkle(event){
text.x += (mouseX - text.x) /10;
text.y += (mouseY - text.y) /10;
var currStar;
for (var i= 0; i<150; i++) {
currStar =test.getChildByName("star"+i);
currStar.alpha = 0.5+(Math.random() *0.5) ;
// currStar.x = (( (Math.random()*1)) )+origPos[currStar.name].x;
// currStar.y = (( (Math.random()*1)) )+origPos[currStar.name].y;
}
}
for (var i= 0; i<150; i++) {
var star = new Sprite();
star.name = "star"+i;
star.graphics.lineStyle(1,0xffffff,1);
star.graphics.beginFill(0xffffff,1);
star.graphics.drawCircle(20, 20, ((Math.random() * (i/100)) ));
star.graphics.endFill();
star.x = Math.random() * test.stage.stageWidth;
star.origX = star.x;
star.y = Math.random() * test.stage.stageHeight;
star.origY = star.y;
origPos["star"+i]= {};
origPos["star"+i].x= star.x;
origPos["star"+i].y= star.y;
test.addChild(star);
}
test.stage.addEventListener(Event.ENTER_FRAME,twinkle)
};
</script>
</head>
<body onload="init();" bgcolor="0" style="background-color:#000000;">
<div id="stage"></div>
</body>
</html>