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
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved