Coder Profile - Show off your skills, get a coder profile.
 
 
 
code pin board AS String Download Source Code
Author Details Code Information
mikeMarek ( Mike Marek )

Pinned 2 Codes
Posted 5 Coding Articles

Send A Message
View Coders Profile
Language ActionScript 1 & 2
Expires Never
Length 709 Characters (21 Lines)
Password no password
Description

Creates a draggable peice of API string.
  1. Mouse.hide();
  2. var points:Array = [];
  3. var distance:Number = 1;
  4. var numPoints:Number = 250;
  5. _root.createEmptyMovieClip("string", 100);
  6. for (var p = 0; p < numPoints; p++) {
  7.        points.push([_xmouse, _ymouse]);
  8. }
  9. function onEnterFrame() {
  10.        points[0][0] = _xmouse;
  11.        points[0][1] = _ymouse;
  12.        string.clear();
  13.        string.lineStyle(3, 0x000000, 100);
  14.        string.moveTo(points[0][0], points[0][1]);
  15.        for (var a = 1; a < numPoints; a++) {
  16.               angle = Math.atan2(points[a][1] - points[a - 1][1], points[a][0] - points[a - 1][0]);
  17.               points[a][0] = points[a - 1][0] + (Math.cos(angle) * distance);
  18.               points[a][1] = points[a - 1][1] + (Math.sin(angle) * distance);
  19.               string.lineTo(points[a][0], points[a][1]);
  20.        }
  21. }
code pin board Back To Code Pin Board Post New Code
Please login to post comments.
Page 1 of 1
 
 
Latest News About Coder Profile
Coder Profile Poll
If you made money from keeping your profile up to date, say $30 and up, per month. What extra time would you spend on your profile?

No extra time
A few hours at weekends
A whole day each week
Every minute i can get free


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
3.19 Years Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2012, Scott Thompson, All Rights Reserved