• flickr
  • linkedin
  • twitter
  • rss

Posts Tagged "AS3"

Turning a clip to a point AS3

Turning a clip to a point AS3

Use Math.atan2. So handy but forgetable. var targetAngle:Number = Math.atan2(mouseY - this.y, mouseX - this.x); var angle:Number = targetAngle *…
PrintJob in AS3

PrintJob in AS3

Basic printing in AS3: var my_pj:PrintJob = new PrintJob(); if (my_pj.start()) { try { my_pj.addPage([params]); } catch(e:Error) { // handle…
Random item from an array

Random item from an array

Just a silly wee snippet - often one might forget the -.5! var randomIndex:Number = Math.round(Math.random() * myArray.length-.5);
3 of 9
123456789