Flash - CurveTo Function - Finding X And Y Points Dynamically
Sep 16, 2010
Basically I'm using the curveTo function to draw some lines for flight paths, what I'm not sure how to do is dynamically finding the curve points, so for example if you look at the ryan air site: [URL]
current_line.graphics.curveTo(curveX, curveY, map.mouseX, map.mouseY);
I need to find the curveX and curveY
View 1 Replies
Similar Posts:
Jan 19, 2012
Take the following AS3 that will draw a curved line using curveTo()[CODE]...
View 3 Replies
Mar 17, 2012
This is more of a question of logic than coding.. but here goes. I've got an array of points, and when plotted on a graph in flash it shows something like this:The blue points just highlight the points of each spike. While the red points are points I want to find.My question is, how do I find the red points on each spike?At first I tried sorting through the array for the highest points, but that didn't give me all the red points as some blue points are higher than the red points.Just by looking at the graph I can immediately see the points I need, but it's a bit harder to find those using code..
View 10 Replies
Apr 18, 2009
I need to position objects equally spaced, on the perimeter of a circle. Question is: How can i find the points on the circle based on the number of objects i need to position, and how can i translate these points into another movieclip's coordinates? i thought to make a loop, and for each object (based on it's index in the loop) create a line from the center of the circle with a degree of 360/loop length * object index, and find the point where this line crosses the circle's perimeter.
I dont know though, how to actually implement my idea, i dont know the whole 'finding points' area etc, and I am not at all sure that my idea is the most light and effective solution. This thing i'd like to do (i think) is quite a common task, if you want a circular menu, or whatever, but i havent found anything anywhere around that could shed some light...
View 3 Replies
Jan 18, 2011
This is the happening place to discuss anything and everything related to the Finding the Distance Between Two Points tutorial.
View 5 Replies
Nov 14, 2009
For 2 weeks now, i have been trying to work out this issue and still i have had no luck.. i dont even know what im looking for.
See image attached to explain better than words.
My idea is i need to generate a nice curve between graphical points but in a way that produces smooth curves at runtime.
View 4 Replies
Jul 27, 2009
Using the code below I get an error message 1013: The private attribute may be used only on class property definitions.
View 4 Replies
May 9, 2011
First i want to say its my first post and i've been diging straight up gold from this site and i love it and everyone out there smart enough to give out solutions.So basically am writing a game and i have bezier curve that controls where an actor moves. Am using only 3 points (start, control1, end) and everything is fine.Now i want to create a bezier curve that passes through a certain point (r1) at t = 0.5 . The problem being that i have my start point, my end point and my point (r1) at t=0.5, and i need to find the control point.
View 1 Replies
Mar 14, 2011
I have a flvplayback component onto which I am loading a video. To mimic next frame and previous frame actions I am adding cue points to the loaded for every second of its length. The next frame /previous frame functions implement seekToNextNavCuePoint and seekToPrevNavCuePoint on the video. But its not working the way I expected it to.
Here is the actual class file. You can directly compile it with an fla file containing button instances in the library for play pause stop... Also you would need some sample flv file.
[Code]...
View 3 Replies
Mar 14, 2011
i have a flvplayback component onto which i am loading a video.To mimic next frame and previous frame actions i am adding cue points to the loaded for every second of its length.The next frame /previous frame functions implement seekToNextNavCuePoint andseekToPrevNavCuePoint on the video. But its not working the way i expected it to
View 4 Replies
Jan 12, 2012
have a loop that creates buttons. Each button stays on the screen, but scrolls off, meaning there are at any one time upto 4 buttons on the screen. There are a total of 241 buttons.t is to my understanding that using an array will allow me to access these buttons later, and that is great, but I can not find a way for it to tell me exactly which button was clicked.Am I missing something very simple here?
if (canAdd == true)
{
canAdd = false;
[code].....
View 1 Replies
Apr 26, 2009
What I have is a navigational button. On click, it adds a MovieClip that contains a SWF.This SWF is a third party news reader/blog. My problem is that when I click on another Navigational button, I can't remove the added SWF (whether I use removeChild() or unload()).The container MC that was added to hold the SWF is removed but the newsreader stays. I assume this is because, that while the newsreader itself works great, it has too many unremoved event handlers, connections.
My main problem is that I can't figure out how to call that added swf by it's name and where on the displaylist it resides. Because I really want to use this newsreader, I've come to accept that I can't remove it. What I'm doing instead is trying to set up a conditional that looks to see if this SWF is already on stage, if so, do nothing but make it visible again(don't re-add the SWF).This is what I have so far, but it's not working (or at least not working without error)
Code:
var blogNewsMC:BlogNewsMC = new BlogNewsMC();
function loadBlog(url:String) {
[code].....
View 3 Replies
Mar 14, 2011
i have a flvplayback component onto which i am loading a video.
Quote:
To mimic next frame and previous frame actions i am adding cue points to the loaded for every second of its length. The next frame /previous frame functions implement seekToNextNavCuePoint and seekToPrevNavCuePoint on the video. But
Quote:
The actual seek to the cue points breaks i.e does not happen throught. if its previous it goes to the first cue point. if its forward seek it breaks n goes to the first frame after a few seeks.
View 1 Replies
Sep 18, 2006
I have a world map on which I display some data. I read long and lat coordinates for two countries from an XML file which is updated with different coordinates everytime. I then map the coordinates to X-Y axis using some projection method.
So, I have x-y coordinates for two countries. I wanna draw a curved line between those countries but curveTo method draws the curve in one shot. I want to animate the curve drawing part so it looks like it is being drawn real time.
View 4 Replies
Mar 31, 2009
If I've got a public function in a class that I know is being called from an object outside the class, is there any way to access either a reference to the calling object or at least the calling object's type from within that function without passing the caller through as a parameter?
View 3 Replies
Aug 26, 2011
I was hoping someone could help me working out some advanced data reformatting. What I'm hoping for is a function where I can input a value along with an array of key positions like so:
function remap(percentage:Number, keypoints:Array) { ...
The array would start with the minimum and end with the maximum point, with nested key points along the way. For example, I would input something like remap(0.25, [0:0,80:50,100:100] ) and the function would 'imagine' a spline curve graph from (0,0)-(100,100) with a key point of (80,50), then return the y value that is 25% along that graph.
View 1 Replies
May 6, 2010
How can i do a function that checks periodically if an array is null or not?
View 2 Replies
Aug 11, 2004
Is there an event that IU can assign a function that is called when an swf closes?
View 5 Replies
Oct 13, 2011
Is there any library or open source function that approximate the area under a line that is described by some of its values taken at irregular intervals?
View 1 Replies
Jun 5, 2006
Is there a way to have a function draw a box around an object by finding the objects instance name via a string?
such as:
Code:
function BoxObject(object) {
//code to draw a box around the object
}
and then juts have an object with an instance name, like "my_mc" and then call the function on a keyframe like:
BoxObject("my_mc");
View 10 Replies
Sep 25, 2009
wat's the difference between finding a angle using Math.atan2(y,x) function and by finding using the movie clip's rotation (mc._rotation*Math.PI/180);
View 9 Replies
May 17, 2011
I want to add point to curve when i click on the curve ,make sure the Original point not change ,eg. a Original point is a control point after add it is Still a control point ,so,may be it is need add two point at the same time
View 3 Replies
Aug 19, 2003
Can I use curveTo on a line that already exists?
I want to make a line bend as animation...
View 8 Replies
Jan 9, 2011
I am using Senocular's code to dynamically create part of a circle using curveto.I am wondering how to change the start point, like where the circle outline starts. It is currently starting on the right of the circle, I would like it to start on top. How would I go about doing that?Here is Senocular's code:
Code:
// x: circles center x, y: circles center y
// a1: first angle, a2: angle to draw to, r: radius
[code]....
View 2 Replies
Feb 10, 2009
I have tried to draw a circle using drawing API curveTo function. But the result is not a perfect circle. Flash documents also suggest this method. Check this link >> This is the code I have used to make a circle of radius R and the registration point of circle movie clip is at the center.
[Code]...
View 1 Replies
Nov 23, 2010
I have a curveTo line and want to duplicate movieClips and run them along its path to represent the direction of flow from 1 point to the other.
View 3 Replies
Oct 24, 2011
Anybody got a method of drawing a line from the mouse down point to the mouses current position.
But taking into account the direction the mouse is moving in to make the curve look more natural and directional.
This is what i have currently which is basic and rubbish:
catapultLine.graphics.moveTo(startX, startY);
catapultLine.graphics.curveTo(Main.gameStage.mouse X/3, Main.gameStage.mouseY/3,Main.gameStage.mouseX, Main.gameStage.mouseY);
View 14 Replies
Mar 31, 2009
LineTo() and curveTo() provide basic level drawing. However, the lines these functions produce look like they were drawn by the line or pen tools. Is there any way, through either existing functions or through modifying current ones, that I could made the drawings done through actionscript look like they were drawn using the brush tool?
My first thought was to see if this was in default actionscript and could not find it. My second was to see if someone had already created the class, and while for a time I thought someone had, I lost the link . I guess I could always create the class myself, but I honestly have no starting point (like what algorithm flash uses to create its brushstrokes) and don't want to waste my time if something similar is already in existence.
View 2 Replies
Jun 9, 2006
I've got some code that reveals a mask in that swooshy/wavy style, which starts of nice and smooth at the top of the reveal but as it gets further down the page it speeds up and doesn't look smooth.Here is the code. I've also attached the example of what it is doing.I've been looking at this code blankly for a couple days now and I'm still no furher forward.
Code:
//Global vars
mWidth = 600;
[code].....
View 1 Replies
Oct 3, 2011
I have been tasked with trying to create a drawing tool that draws dotted lines as you drag the mouse across the stage. I can easily capture the points on MouseEvent.MOUSE_MOVE and store them in a vector and then draw the points as dots:
The problem is that I need to calculate evenly distributed points on an ever growing Vector of points so I can only draw the line between say every 5th point (say using modulus). I have been battling away with Bezier curve equations both Quadratic and Cubic but still can't quite figure out how to convert my Vector of points into an evenly distributed Vector of Points without sucking the life from the CPU.
View 1 Replies