OZONE Asylum
Forums
Multimedia/Animation
Drawing with Actionscript
This page's ID:
11489
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Okay, here's a starter for you. It's not an exact solution but I'll bet you can modify it to work for your needs. This function is by Jared Tarbell, from one of his projects in the FriendsofEd book "Flash 3D Cheats". I'll show the code and then give some notes: [code]TextNode.prototype.drawLineToOrigin = function() { // draw a line to the origin this.clear(); this.lineStyle(0, 0x000000, 15); this.lineTo(this.x-this._x, this.y-this._y); };[/code] You may or may not be working in an object oriented manner so here are the key points. First, this function has to be called as part of an onEnterFrame event so it can continuously be monitoring for any change of position. Second - you need a mechanism to store where the clip STARTED. In this function that value is "this.x" (the point of origin) as opposed to "this._x" which is where the clip IS NOW. (Hope that makes some sense) Third - the line style defined above is a hairline width light gray (or more correctly it's a black line at 15% opacity.) You can modify this to be anything you want. Note that with every tick of the Flash clock it first clears the line that had been there and then draws a new one. Without the "clear" the stage would quickly fill up! If the LineTo method doesn't find instructions on where to start drawing the line from it assumes the origin point of the clip which in your case makes sense. You just want to tell it where to draw the line TO. This function draws a line from where the clip is now to where the clip started. Hope you can modify this function to suit your own needs. Please take some time to enjoy what Jared had done with binary network simulations at [url=http://www.levitated.net/daily/index.html]http://www.levitated.net/daily/index.html[/url] And maybe spend some time with his articles on NodeGardens [url=http://levitated.net/bones/nodeGarden/index.html]http://levitated.net/bones/nodeGarden/index.html[/url] Also - Keith Peters (who has an extraordinary mastery of the Flash drawing API) has a tutorial on nodes at his site bit-101.com [url=http://www.bit-101.com/tutorials/]http://www.bit-101.com/tutorials/[/url] Hope there's something of use in all this.
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »