flash on 2009-10-26
♥0 |
Line 55 |
Modified 2009-10-27 12:03:02 |
MIT License
archived:2017-03-20 03:11:38
ActionScript3 source code
/**
* Copyright gupon ( http://wonderfl.net/user/gupon )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/hRGJ
*/
package {
import flash.display.Sprite;
import flash.events.Event;
[SWF(frameRate="30")]
public class FlashTest extends Sprite {
private var sphere:Sphere;
private var l_index:Label;
public function FlashTest() {
sphere = new Sphere();
addChild(sphere);
l_index = new Label();
addChild(l_index);
sphere.x = sphere.y = 200;
addEventListener( Event.ENTER_FRAME, rotateSphere);
}
private function rotateSphere(event:Event=null):void{
sphere.rotationY += 5;
var i:int = 0;
while(i < sphere.numChildren ){
sphere.getChildAt(i)
i++;
}
}
}
}
import flash.display.Sprite;
class Sphere extends Sprite{
private var m:Number = 10;
private var n:Number = 10;
private var s:Number = 10;
public function Sphere(){
for(var i:int; i<s; i++){
var pane:Sprite = new Sprite();
pane.z = i * 20 - s*10;
addChild(pane);
pane.graphics.beginFill(0xFF0000*Math.random());
pane.graphics.drawRect(0,0,100,100);
pane.graphics.endFill();
pane.x = pane.y = -50;
}
}
}
import flash.text.TextField;
import flash.text.TextFormat;
class Label extends TextField{
public function Label(){
width = 200;
height = 100;
var format:TextFormat = new TextFormat(null,15);
defaultTextFormat = format;
}
public function set _text(text:*):void{
this.text = String(text);
}
}