-
Game Player - Developer
Flash chart help
I client asked me for a chart in flash, I have some ideas, but I want to know if anyone here has made something similar
I just have some values that the user will put, so I take those values and create dots in the chart, so that part is easy I also can do more details but how can I make a union between dots with a line, I want a line touching every dot to make the chart work
Any ideas?
(again a questions that seems has to be outside games, but I like this section, lol )
"I love to make them as I love to play them"
-
Senior Member
Maybe you could draw a picture. Dont think I understand you atm, as drawing line between dots is not really difficult.
-
ʞ33ƃ
-
Elvis...who tha f**k is Elvis?
hey scheletro, aren't we just talking :
Code:
mc.moveTo(firstPointX, firstPointY)
mc.lineTo(secondPointX, secondPointY)
mc.lineTo(thirdPointX, thirdPointY)
etc...
(in AS 3 it's mc.graphics.lineTo and moveTo)
-
Game Player - Developer
Maybe you could draw a picture. Dont think I understand you atm, as drawing line between dots is not really difficult.
I can imagine that, although Ive made more than 80 games Im bad programmer so I always try to get answer from my limited knowledge, youll see why below
Thanks for that, yeap, that was the only thing I found searching on the forums, but the thing is Im no leading variables from a DB, the user is going to put values, so I needed something simple
hey scheletro, aren't we just talking :
Code:
mc.moveTo(firstPointX, firstPointY) mc.lineTo(secondPointX, secondPointY) mc.lineTo(thirdPointX, thirdPointY) etc...
(in AS 3 it's mc.graphics.lineTo and moveTo)
Thanks but Im still using AS2, but Ill remember this
Well, I saw this comments today that I already have a demo running, what I did is to use an script that found in one of my games
[CODE]bug_mc.onEnterFrame = function() {
var dx = _root.chart.punto2._x-this._x;
var dy = _root.chart.punto2._y-this._y;
var angle = Math.atan2(dy, dx);
this._rotation = angle*180/Math.PI;
};
"I love to make them as I love to play them"
-
Game Player - Developer
(this thing doesnt let me put long posts, so I need to write a new one)
Yeap, that script is to follow a target, but that was the best solution for my problem at that time, so I made the line to position in the _y of one point and follow the next
I know a good programmer has a simple solution, if you have one is welcome
I also planning to upload the source to help somebody with the same problem at least till one good solution is mentioned
Here is the demo
I hope to see solutions and comments on that demo
"I love to make them as I love to play them"
-
Elvis...who tha f**k is Elvis?
scheletro, for that, you just need the code I posted! No need for trig on that one! But since it works for you, and it looks good, I guess there's no need to change it
Good job, it really looks nice and clean!
-
Game Player - Developer
Originally Posted by phreax
scheletro, for that, you just need the code I posted! No need for trig on that one! But since it works for you, and it looks good, I guess there's no need to change it
Good job, it really looks nice and clean!
I was thinking that your code was for AS3 and Im using AS2, can I use your code then?
"I love to make them as I love to play them"
-
Senior Member
Originally Posted by scheletro
I was thinking that your code was for AS3 and Im using AS2, can I use your code then?
Yes you can, graphics class and its methods like moveTo, lineTo and beginFill were added in FlashMX(6).
-
Game Player - Developer
"I love to make them as I love to play them"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|