Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Sbaw091110

1,210 views

Published on

  • Be the first to comment

  • Be the first to like this

Sbaw091110

  1. 1. package { import [SWF ] public class extends Sprite { // public var : ; // private var : ; // public function () { // } // public function ( 1, 2, 3): { // } // public function ( 1, 2, 3): { // } } }
  2. 2. package { import flash.display.*; import flash.text.TextField; [SWF(backgroundColor="#CCCCCC", frameRate="30")] public class hoo extends Sprite { //-------------------------------------- // CLASS CONSTANTS //-------------------------------------- //-------------------------------------- // CONSTRUCTOR //-------------------------------------- //-------------------------------------- // PRIVATE VARIABLES //-------------------------------------- //-------------------------------------- // GETTER/SETTERS //-------------------------------------- //-------------------------------------- // PUBLIC METHODS //-------------------------------------- //-------------------------------------- // EVENT HANDLERS //-------------------------------------- //-------------------------------------- // PRIVATE & PROTECTED INSTANCE METHODS //-------------------------------------- } }
  3. 3. package { import flash.display.*; import flash.text.TextField; [SWF(backgroundColor="#CCCCCC", frameRate="30")] public class hoo extends Sprite { //-------------------------------------- // CLASS CONSTANTS //-------------------------------------- //-------------------------------------- // CONSTRUCTOR //-------------------------------------- //-------------------------------------- // PRIVATE VARIABLES //-------------------------------------- //-------------------------------------- // GETTER/SETTERS //-------------------------------------- //-------------------------------------- // PUBLIC METHODS //-------------------------------------- //-------------------------------------- // EVENT HANDLERS //-------------------------------------- //-------------------------------------- // PRIVATE & PROTECTED INSTANCE METHODS //-------------------------------------- } }
  4. 4. package { import flash.display.*; import flash.text.TextField; [SWF(backgroundColor="#CCCCCC", frameRate="30")] public class hoo extends Sprite { //-------------------------------------- // CLASS CONSTANTS //-------------------------------------- //-------------------------------------- // CONSTRUCTOR //-------------------------------------- //-------------------------------------- // PRIVATE VARIABLES //-------------------------------------- //-------------------------------------- // GETTER/SETTERS //-------------------------------------- //-------------------------------------- // PUBLIC METHODS //-------------------------------------- //-------------------------------------- // EVENT HANDLERS //-------------------------------------- //-------------------------------------- // PRIVATE & PROTECTED INSTANCE METHODS //-------------------------------------- } }
  5. 5. private var : public var :
  6. 6. // ( ) private var _num:Number; // ( ) private var _intNum:int; // private var _uintNum:uint; // private var _name:String; // private var _mc:MovieClip; // private var _sp:Sprite; // private var _text:TextField; // private var _myArray:Array; //
  7. 7. private function ( ): public function ( ):
  8. 8. // private function addNumbers(numA:Number, numB:Number):Number { var answer:Number = numA + numB; return answer; }
  9. 9. internal private protected public
  10. 10. package { import flash.display.Sprite; public class DrawCircle extends Sprite { public function DrawCircle() { } } }
  11. 11. package { import flash.display.*; public class DrawCircle extends Sprite { public function DrawCircle() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; var circle:Sprite = new Sprite; // circle circle.graphics.beginFill(0x3399FF); // // circle.x = stage.stageWidth/2; //X ( ) circle.y = stage.stageHeight/2; //Y ( ) circle.graphics.drawCircle(0,0,100); addChild(circle); // } } }
  12. 12. Stage circleA circleB
  13. 13. package { import flash.display.*; public class DrawCircle3 extends Sprite { public function DrawCircle3() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; // A var circleA:Sprite = new Sprite; circleA.x = stage.stageWidth/2 - 50; circleA.y = stage.stageHeight/2 - 50; circleA.graphics.beginFill(0x3399FF); circleA.graphics.drawCircle(0, 0, 100); addChild(circleA); // B var circleB:Sprite = new Sprite; circleB.x = stage.stageWidth/2 + 50; circleB.y = stage.stageHeight/2 + 50; circleB.graphics.beginFill(0xFF9933); circleB.graphics.drawCircle(0, 0, 100); addChild(circleB); } } }
  14. 14. Stage circleA circleB
  15. 15. package { import flash.display.*; public class DrawCircle4 extends Sprite { public function DrawCircle4() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; //1000 for(var i:int=0; i<1000; i++){ var circle:Sprite = new Sprite; // circle.graphics.beginFill(Math.random()*0xFFFFFF); circle.x = Math.random()*stage.stageWidth; //X circle.y = Math.random()*stage.stageHeight; //Y circle.alpha = 0.3; // 30% circle.graphics.drawCircle(0,0,Math.random()*40); addChild(circle); // } } } }
  16. 16. package { import flash.display.*; public class DrawCircle5 extends Sprite { public function DrawCircle5() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; //5000 for(var i:int=0; i<5000; i++){ var circle:Sprite = new Sprite; circle.x = Math.random()*stage.stageWidth; circle.y = Math.random()*stage.stageHeight; // var xdiff:Number = (stage.stageWidth/2-circle.x); var ydiff:Number = (stage.stageHeight/2-circle.y); var diff:Number = Math.sqrt(xdiff*xdiff + ydiff*ydiff); if(diff < 200){ // circle.graphics.beginFill(0xFF9933); } else { circle.graphics.beginFill(0x3399FF); } circle.alpha = 0.3; // 30% circle.graphics.drawCircle(0,0,Math.random()*10); addChild(circle); // } } } }

×