AS3 Curved Line Drawing API and Glow


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var lineDrawing:MovieClip = new MovieClip();
  2. this.addChild(lineDrawing);
  3.  
  4. lineDrawing.graphics.lineStyle(1, 0x000000, 1 );
  5. lineDrawing.graphics.beginFill( 0x990000, 1 );
  6. lineDrawing.graphics.moveTo(100,100);
  7. lineDrawing.graphics.lineTo(100,200);
  8. lineDrawing.graphics.lineTo(300,200);
  9. lineDrawing.graphics.lineTo(300,100);
  10. lineDrawing.graphics.curveTo(200,0, 100,100); //the first two numbers are your control point for the curve
  11.  
  12.  
  13. ///Glow Filter
  14. var glow:GlowFilter = new GlowFilter();
  15. glow.color = 0x009900;
  16. glow.alpha = 1;
  17. glow.blurX = 25;
  18. glow.blurY = 25;
  19.  
  20. var dropShadow:DropShadowFilter = new DropShadowFilter();
  21. dropShadow.color = 0x000000;
  22. dropShadow.blurX = 10;
  23. dropShadow.blurY = 10;
  24. dropShadow.angle = 0;
  25. dropShadow.alpha = 0.5;
  26. dropShadow.distance = 25;
  27.  
  28. var filtersArray:Array = new Array(glow, dropShadow);
  29. lineDrawing.filters = filtersArray;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.