Register to earn points!
Login
Register
3D
ActionScript
Applications
Banners
Bitmap
Buttons
Effects
Fractals
Galleries
Games
Intros
Logos
Menus
Other
Particles
Physics
Players
Preloaders
Text
Homepage
|
News
|
Subscribe
|
Member list
|
Links
|
Submit File
Profile
smily
90
Points
Views: 16 File ratings: 0 File comments: 4
Send a message
smily's submited files
smily's favourite files
No favourite files yet
smily's latest comments
Aires Photo Gallery V3
nice.
Pythagorean Distance Between Two Points
AS3:
var ll:Sprite=new Sprite();
ll.graphics.lineStyle(2, 0x0, 100);
ll.graphics.moveTo(p1.x,p1.y);
ll.graphics.lineTo(p2.x,p2.y);
ll.graphics.moveTo(p2.x,p2.y);
ll.graphics.lineTo(p1.x,p2.y);
ll.graphics.moveTo(p1.x,p2.y);
ll.graphics.lineTo(p1.x,p1.y);
addChild(ll);
p1.addEventListener(MouseEvent.MOUSE_DOWN,sta_Move);
p1.addEventListener(MouseEvent.MOUSE_UP,sta_stop);
function sta_Move(e:MouseEvent):void
{
p1.addEventListener(MouseEvent.MOUSE_MOVE,sta_line);
p1.startDrag();
}
function sta_stop(e:MouseEvent):void
{
p1.stopDrag();
}
function sta_line(e:MouseEvent):void
{
ll.graphics.clear();
ll.graphics.lineStyle(2, 0x0, 100);
ll.graphics.moveTo(p1.x,p1.y);
ll.graphics.lineTo(p2.x,p2.y);
ll.graphics.moveTo(p2.x,p2.y);
ll.graphics.lineTo(p1.x,p2.y);
ll.graphics.moveTo(p1.x,p2.y);
ll.graphics.lineTo(p1.x,p1.y);
}
Click 2 Move (dot path)
it works
User info
Location:
No information
Bio:
No information
Website:
No information
Joined:
October 24 2010