ActionScript 2.0 :: Drawing Api - The Curve Point Be The Same Point As The Mouse?

Nov 3, 2003

From the Robert Penner code given in this tutorial: [URL] i was wondering why controlx and controly has to be so complicated. I've tried changing it to just _root._xmouse but it messes up. I don't get this, shouldn't the curve point be the same point as the mouse?

View 13 Replies


Similar Posts:


Actionscript 3 :: Calculating The Control Point Of Curve Using A Given Point

Jan 12, 2012

I am trying to develop a Quadratic Bezier Curve using the graphics.curveTo() method. Initially when i drag mouse to draw the shape, i use start point and end point of mouse to draw the curve line. I assume control point at any position below or up to the line. An draw the curve using this control point. some what like:-

[Code]...

Now i add a tip on this curve segment. I have x and y position of tip. I want to change the curve segment by dragging tip. but now i don't have the exact control point according to tip position. If i use tip coordinate as control point it reduce the height of curve and now tip does not lie on the curve segment. What i have to do is calculate the exact control point on the basis of tip coordinate. But i failed to get this point.

View 1 Replies

ActionScript 2.0 :: Plotting On A Curve - Return The X And Y Of A Point Along That Curve?

May 10, 2007

I have a curveTo an anchor point and a control point.Then I have a function that will return the x and y of a point along that curve if I give it a number as a percentage of the curve (0 to 1).It looks like this, and works perfectly..

Code:
function drawOnCurve( interval:Number, x0,y0,x1,y1,x2,y2)
{
interval = Math.max( Math.min( 1, interval ), 0 );[code]....

x0,y0 are the start point, x1,y1 the control point and x2,y2 the final anchor point.But... I want to give it a _y value instead of a percentage (interval) and it return where on the curve that would intersect.

View 2 Replies

Flash :: Drawing A Line From Point To Point In ActionScript3.0?

Oct 27, 2011

Lets say I have two objects, and I want to use action script to draw a line connecting them, which will update automatically as they are moved/ dragged.Can anyone show me how to do that, and also how to control line's parameters like colour, weight etc?

View 1 Replies

ActionScript 2.0 :: Draw Curve Through 3 Points (not Control Point)

Feb 3, 2005

I'm attempting to make a curve drawing tool a bit easier to use.Rather than drawing a basic curve and then clicking on the control point to change it, I would like the user to be able to click on the curve itself to change it, much as you do in the FlashIDE.So, given start and end points, and a point on the curve, how do you determine the control point for use with the MX API?(I googled this, but found mostly info on cubic rather than quadratic curves)

View 3 Replies

ActionScript 2.0 :: Draw Curve Through 3 Points (not The Control Point)?

Feb 3, 2005

I'm attempting to make a curve drawing tool a bit easier to use. Rather than drawing a basic curve and then clicking on the control point to change it, I would like the user to be able to click on the curve itself to change it, much as you do in the FlashIDE.

So, given start and end points, and a point on the curve, how do you determine the control point for use with the MX API?

View 4 Replies

Professional :: Text To Scroll From The Point Changing Perspective Along With Curve?

Aug 10, 2010

I want the text to scroll from this point changing perspective along with curve. I know how to do it in AI, PS but without doing like 100 pictures of it slowly moving and putting them in flash like an old style cartoon I have no idea how to do this... Basically when someone rolls over the button I want This to come from nothing and scroll up onto the arc and stay till they roll off... I know how to do the simple button... it's designing a movie clip that does this on an arc that i cannot figure out

View 5 Replies

Flash 10 :: Drawing In One-point Perspective?

Jul 30, 2011

Okay, there are a few things I want to know how to draw in one-point perspective: a toilet, a shower, a bath; basically I want to know how to draw everything in a bathroom.

View 0 Replies

ActionScript 2.0 :: Drawing API - Clear Line Only A A Certain Point?

Dec 26, 2006

is it possible to somehow use a the clear() function on a line that has been dynamically drawn only at a certain point? i need a line to be drawn and then gradually erased with time. currently i'm drawing a green line and then a few seconds later, a start up a function that creates a white line above it. it works great if this line is above a white background, but if it's above some other element, you see a white line.

View 7 Replies

ActionScript 2.0 :: Drawing Curved Line From Point A To B

Dec 2, 2007

Any way to get a curved line to draw from a known point a to a known point b. Point b will always be changing and will be in any position around point a. I can work with an existing line from a movieclip and change it somehow, but right now I can't find any way to accomplish it.

View 2 Replies

ActionScript 3.0 :: Drawing Object On Intersections Point Of 2 Lines

Apr 21, 2009

I'm doing this project, about 2 lines intersecting each other(the 2 lines are not always on the same position). I try to find the intersections point using collision detection method but how do I place an object on the intersections point?
if(line1.hitTestObject(line2)) //
So this is how we find the intersection point but we do not know how to draw / place an object on the intersection point.

View 6 Replies

ActionScript 3.0 :: User Drawing A Line By Dragging A Point

Aug 19, 2010

I've been unable to find info on this because it's tricky to find the correct keywords. I want to allow the user to draw a line so that the application can measure the distance between two points chosen by the user. I could let the user click on one point and then the other but it would be much better if, after clicking the first point, a line would follow the mouse cursor like in most graphic applications. How would you do that? Is there a convenient method for that? Maybe use the MOUSE_MOVE event after the MOUSE_CLICK and continuously draw a line?

View 3 Replies

ActionScript 3.0 :: Pushing Point Locations Into An Array - Point(x,y) Conversion Faillure?

Dec 9, 2011

Im pushing Point locations into an array to Shift em out later. like this:

tempmoves.push([new Point(roundx,roundy)]);
..
ob.movestoplayer = tempmoves;[code]....

What am i doing wrong?

View 8 Replies

ActionScript 2.0 :: Movieclip To Move Along The X-axis To A Certain Point And Then Back To The Starting Point Again?

Apr 12, 2007

It's been a long time since I've done any work with actionscript, and alas I've forgotten nearly everything. I've tried to look for a tutorial that would explain basic animation with actionscript, but the one that I found on Kirupa was no longer there.

Basically I'd like to do this:On the stage I have a movieclip and I'd like the movieclip to move along the x-axis to a certain point and then back to the starting point again. The moving speed of the movieclip should also be adjustable.

View 8 Replies

ActionScript 3.0 :: Distance From Point To Point And Referencing Other Instances Of The Same Class

Feb 8, 2009

I'm creating a game in flash for a university project, and learning actionscript and programming as I go. I'm very much still at a beginner level - at the moment al I have is some actionscript for drawing rectangles and moving them about the screen. This is what I'm having trouble with at the moment: I have a class called 'Creature', and I want instances of it to interact with each other. I want them to do something when they come within a certain distance of another instance. And I want them to be able to pick a random other instance to get the location of, in order to do something with that information.

What I think I need is: A function for telling the distance between two (x,y) points.
A way of referencing the nearest other instance of the class. And a way of randomly selecting from all of the instances of the class.

View 4 Replies

Flash :: Perspective Projection Formula - Convert 3d Point To 2d Point?

Mar 27, 2011

How to convert 3d point to 2d point? I've found next formula in Internet(camera is situated in origin)

[Code]....

But these formulae give me strange result when z are less than zero(z<0) I need build line from A(100,100,100) to B (100,100;-100) As you can see these equations give really strange result when I try to convert B point in 2D dimension

View 1 Replies

Actionscript 3 :: Moving A Point With Rotation Doesn't Change The Point XY?

Jul 15, 2011

i have the follow issue :

I have a point which is setted at the border on a component, with changed transform point to the center of a component in order to match the component rotation.

the important part is when i try to get the point XY after rotation - they remains the same as before rotation.

how to get XY, after rotation ( changeing point.rotation property to specific degrees of rotaion )

View 2 Replies

ActionScript 2.0 :: A Line From One Point Past Another Point And Whether It Hits An Object?

Aug 19, 2009

I am using AS2 with Flash 8 Professional So, my problem is that I currently have a man in the middle of the screen, who shoots a line towards the mouse when I click. However, when I use hitTest to see if the line collides with another object, Flash recognizes the line as a large box if it is diagonal, so the hitTest isn't very accurate. The line only satys there for one frame, so I can't have the usual moving-bullet-style. I am either looking for a way to create an imaginary line with AS from the starting point to the mouse and beyond, and tell whether or not this line intersects with an object... or some other way that I haven't thought of to fix my problem. Keep in mind that the line rotates from a center point towards anywhere around it for 360 degrees.

View 1 Replies

ActionScript 3.0 :: Find Egistration Point Compared To Its Top Left Point

Aug 20, 2009

if i have a movieclip or a sprite could i find (via code) where is its registration point compared to its top left point (no rotation included) ?

View 4 Replies

ActionScript 2.0 :: Smooth Preload Bar - Appears To Jump From Point To Point

Apr 27, 2004

my preloader bar isn't growing smoothly. it appears to jump from point to point -- and i want to make it smooth. you can see the example here at: [URL] would anyone mind taking a quick look at the file i've attached,

View 6 Replies

ActionScript 2.0 :: Find An Angle From An Anchor Point And A Moving Point?

Feb 19, 2005

I know some basic trig. but how do i find an angle from an anchor point and a moving point?

adjecent = _root.anchor._x-_root._xmouse;
opposite = _root.anchor._y-_root._ymouse;
hypotenuse = ((adjacent ^ 2)+(opposite ^ 2)) ^ 0.5;

View 2 Replies

ActionScript 2.0 :: Move A Point (or Circle) Slowly And The Point Let Behind A Line?

May 3, 2006

How can I move a point (or circle) slowly and the point let behind a line.When the point turn back the line will be erase.

View 8 Replies

ActionScript 3.0 :: Create An Image Scroller That Just Scrolls Images From Point A To Point B On Load Horizontally In An Infinite Loop?

Mar 28, 2011

Hi I am trying to create an image scroller that just scrolls images from point a to point b on load horizontally in an infinite loop. I just used a code snippet to move it horizontally but don't how to get it to stop and at point b and loop again from a.

ActionScript Code:
game1.addEventListener(Event.ENTER_FRAME, fl_AnimateHorizontally_3);
function fl_AnimateHorizontally_3(event:Event)
{
game1.x += 20;
}

View 0 Replies

ActionScript 2.0 :: Make An Object Move From Point A To Point B In An Arc?

Mar 27, 2008

how to use these in order to make an object move from point A to point B in an arc.Think of that classic game where you have to input the angle and power and try to hit your opponent.

View 1 Replies

ActionScript 3.0 :: Finding A Point Relative To A Center Point?

Nov 9, 2010

I'm trying to figure out how to find a point relative to the center of an object, modified by its rotation. For example, in the attached swf, I've been messing around trying to draw trails to a bitmap, coming out of the thrusters. I didn't have a problem at first, but as the ship rotated, the lines that were being drawn wouldn't remain relative.

http:[url]....

I'm sure this is because I have no idea what I'm doing, and I've just been sort of idioting my way through it. That aside, is there an easy way to find the point I'm looking for? For instance, say I want a point at Y -14 of my ship, but I want that to remain relative to the ship as it rotates.

View 14 Replies

ActionScript 2.0 :: Draw A Line From Point A To Point B And Then Code It?

Dec 30, 2003

how 2 sript: to draw a line ( 4 example ) frm point A to point B and then code it such that the viewer can see the line being drawn ?

View 9 Replies

ActionScript 3.0 :: Smooth Movement From Point A To Point B?

Sep 2, 2010

i have this code i found that smoothly moves a box left or right on the screen based on using the left or right arrow keys. i want to use this smooth code but adjust it so on enterframe, the box would move from point a (say 0,120) to point b (0,240) and stop there.no keys used, just working based on entering the frame.how to modify the code below?

Actionscript Code:
import flash.display.*;import flash.events.*;import flash.ui.Keyboard;var velocity:Number = 0;var acceleration:Number = 0.2;var friction:Number = 0.90;var isRightKeyDown:Boolean =

[code].....

View 4 Replies

IDE :: Move An Object From One Point To Another Point On Graph?

Jan 9, 2006

Basically what I like to ask is how to move a object from one point to another point based on the point tat you have clicked on a graph. For example, If I click on this coordinate (2,3) on graph, the object (movie clip) will move to that point.

View 3 Replies

ActionScript 3.0 :: Get Items From Certain Point 2 Certain Point?

Jun 19, 2011

how to get items from an array between 2 points. ie ActionScript Code:array:Array = [mc,mc1,mc2,mc3,mc4,mc5,mc6,mc7,mc8,mc9,mc10] how would i say items 3-7 with out deleteing them or removing them from the array. just to expalin what im doing. i have created a grid and pushed then into a array. i have created a add function which add a movie clip to a certain point in the array specified by the user. but im trying to create a populate cell-cell so user can populate more the 1 at a time. here is the code im useing to add 1 tile to the grid

[Code]...

View 5 Replies

ActionScript 2.0 :: Controlling Cursor Movement - If Move The Cursor To A Point A It Automatically Moves By Itself To A Point B

May 8, 2004

if i move the cursor to a point A, it automatically moves by itself to a point B. then if i move the cursor from B to a point C, it bounces away to a point D. i stumbled upon this site while googling around. i'm not a techie, but yeah, i can handle word processors.

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved