Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a graph in a window 2

Status
Not open for further replies.

rolan18

Programmer
May 11, 2006
26
CA
Has anyone made a window inside of a flash program that can make a grid and graph a line inside of it?

In my main program I am showing the motion of a ball through the air. I would like to graph this in a pop-up window during run-time, and I'm not sure how to go about this.

Thanks
 
shouldnt be too hard

quick algorithm

1.get the ball x,y coordinates - maybe onEnterFrame
2.pass this to the other movie
3.other movie performs a scaling function if windows are different sizes
4.second windows use lineTo to sketch the graph


i started a graphing program at one time (MX)

you can get a copy of it here (somewhere)if you think it will be any use

 
Well, that's not quite what I'm looking for, but thanks. I need to be able to make a grid in the window and I'm not sure how to give it the x, y co-ordinates for the window. apparently I'm not able to use the ._height or ._width functions so I'm wondering how to make a grid on the window. The grid option for the stage doesn't seem to extend to the window either.

What I'm trying to do right now is to draw lines from top to bottom using loops, but I can't seem to find a function that gives the window's current size, because the window size is going to be resizable.

Hopefully this is a bit more pointed an explanation.
thanks
 
to check for window resized

myListener = new Object();
myListener.onResize = function(){
trace(Stage.width);
trace(Stage.height);
}
Stage.addListener(myListener);
 
I'm not sure that's going to work, but that's probably because I'm not explaining things very well.

let's see,

Okay, there's the stage, and its full of stuff, so I want to make a pop-up window make a graph of the numbers, which in itself isn't that hard. What I really want to know is if there is a way that I can draw on the window using the lineTo function, because I haven't been having any success with doing so.

Are you able to draw a real-time graph on a pop-up window, and if so, what might be some useful commands.

Thanks a lot for your help so far!!!

 
Thx guys,
The link you gave me was Forbidden, but if you could zip it and put it up on here that would be wonderful. :) Thx for the tip about localconnection, now I have a direction to research in, whereas before it was just a stab in the dark.

Many, many thanks!
 
I guess there's just one more question, is there a way to link these two .fla files together without using html. I'm trying to create an applet that will run on a computer, independent of the internet, if possible. So essentially, how could I link the two files together only using flash code.

thx
 
if this is for an exe file i would just use the window component to keep it as simple as possible

then all code is in the one swf
 
Well, at first I was trying to use the window component, but for some reason I am unable to draw on it. Actually, I couldn't really do anything with the window component, so I just tried to post on here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top