AS3 Drawing API Line Drawing and DropShadow


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

Just some code that shows you how to set up the Drawing API and draw a line and also use the dropshadow filter.


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);
  5. lineDrawing.graphics.moveTo(0,0); ///This is where we start drawing
  6. lineDrawing.graphics.lineTo(350, 600);
  7. lineDrawing.graphics.lineTo(600, 400);
  8.  
  9. var dropShadow:DropShadowFilter = new DropShadowFilter();
  10. dropShadow.color = 0x000000;
  11. dropShadow.blurX = 10;
  12. dropShadow.blurY = 10;
  13. dropShadow.angle = 0;
  14. dropShadow.alpha = 0.5;
  15. dropShadow.distance = 10;
  16.  
  17.  
  18. var filtersArray:Array = new Array(dropShadow);
  19. lineDrawing.filters = filtersArray;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.