-
Notifications
You must be signed in to change notification settings - Fork 1
/
exploringFlash3D.as
37 lines (30 loc) · 1000 Bytes
/
exploringFlash3D.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
package
{
import flash.display.Sprite;
import flash.events.Event;
public class exploringFlash3D extends Sprite
{
var spinner:Sprite;
public function exploringFlash3D()
{
// Stick a spining sprite on screen.
spinner = new Sprite();
addChild(spinner);
spinner.graphics.beginFill(0xFF00FF);
spinner.graphics.drawRect(-60, -60, 120, 120);
spinner.graphics.endFill();
spinner.graphics.lineStyle(0, 0x00FF00);
spinner.graphics.moveTo( -40, -40);
spinner.graphics.lineTo( 40, 40);
spinner.x = 100;
spinner.y = 100;
addEventListener(Event.ENTER_FRAME, onFrame);
}
public function onFrame(e:*):void
{
spinner.rotationX += 1;
spinner.rotationY += 1;
spinner.rotationZ += 1;
}
}
}