Guest User

smiley

a guest
Apr 19th, 2013
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package opdrachten.punten
  2. {
  3.     import flash.display.Sprite;
  4.     import flash.events.Event;
  5.     import wiskunde.Punt;
  6.    
  7.     /**
  8.      * ...
  9.      * @author
  10.      */
  11.     public class Smiley extends Sprite
  12.     {
  13.         public var oog1:Punt = new Punt(200, 200, 50, 0xffffff,true);
  14.         public var oog2:Punt = new Punt(400, 200, 50, 0xffffff,true);
  15.         public var neus1:Punt = new Punt(200, 210, 25, 0x000000,true);
  16.         public var neus2:Punt = new Punt(400, 210, 25, 0x000000,true);
  17.         public var m1:Punt = new Punt(200, 450, 10, 0xffffff,true);
  18.         public var m3:Punt = new Punt(400, 450, 10, 0xffffff,true);
  19.         public var m2:Punt = new Punt(300, 400, 10, 0xffffff,true);
  20.        
  21.        
  22.         public function Smiley()
  23.         {
  24.            
  25.            
  26.             addChild(oog1);
  27.             addChild(oog2);
  28.             addChild(neus1);
  29.             addChild(neus2);
  30.             addChild(m1);
  31.             addChild(m2);
  32.             addChild(m3);
  33.            
  34.             addEventListener(Event.ENTER_FRAME, loop)
  35.            
  36.         }
  37.        
  38.         private function loop(e:Event):void
  39.         {
  40.             this.graphics.clear;
  41.            
  42.             this.graphics.lineStyle(1);
  43.             this.graphics.beginFill(0xffff00);
  44.             this.graphics.drawCircle(300, 300, 250);
  45.             this.graphics.endFill();
  46.            
  47.             this.graphics.lineStyle(10, 0x000000);
  48.             this.graphics.moveTo(m1.x, m1.y);
  49.             this.graphics.curveTo(m2.x, m2.y, m3.x, m3.y);
  50.         }
  51.        
  52.     }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment