Random color picker


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



Copy this code and paste it in your HTML
  1. var box:Shape = new Shape();
  2. var random_color:Number = Math.random() * 0xffffff;
  3. box.graphics.beginFill(random_color, 1);
  4. box.graphics.drawRect(0, 0, 100, 100);
  5. box.graphics.endFill();
  6. this.addChild(box);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.