ActionScript 1/2 :: Calculate By Math The X Position Of Point 1?

Oct 28, 2010

I´d like to know if there´s a way to calculate by math the x position of point 1. There´s some coordinates at the image here attached. The "mc" movie clip is the main triangle.

View 5 Replies


Similar Posts:


Actionscript 3 :: Trigonometry - Radius Out To The Outer Concentric Circle And Calculate The Position Of That Outer Point?

May 29, 2011

I've got two concentric circles with their centers at (centerX,centerY). The inner circle has a radius of 100 and the outer circle has a radius of 400. If take a point on the circumference of the inner circle, I can draw a line from the center to that point. Let's call that point x1,y1). I now want to continue that radius out to the outer concentric circle and calculate the position of that outer point (x2,y2).

I'm adding a 3px 'dot' just to show where x1, y1 is on the screen. (Subquestion: I can't see it...not sure why.)This is what I'm trying:

var x1:Number = 100;
var y1:Number = 50;
var x2:Number;[code].............

View 1 Replies

Calculate Centre Point Of Rectangle In Flex?

Feb 23, 2012

I have two rectangles: var rect1:Rectangle = new Rectangle(66,147,89,67);

var rect2:Rectangle = new Rectangle(155,147,89,67);

How to calculate the centre point of these rectangles based on their x and y positions. I want the centre point to be calculated with relative to stage

View 2 Replies

ActionScript 3.0 :: Calculate Mouse's Distance To A Certain Point?

Dec 4, 2009

What I am trying to do with AS3 in Flash cs4 is calculate the cursor's distance to given point (let say 400,300) and use that distance to constantly (20 fps) change my curtain's alpha value. (which is basically a box turned into a movie clip) [code]...

View 5 Replies

Flex :: Math - Rotate Point From A Given Center?

Jan 30, 2012

I'm trying to rotate a point in my Canvas from a given point (center). In my MouseDown handler, I save the point where user click (oldPos), and in my MouseMove handler, I'm doing this:

private function onMouseMove(event:MouseEvent):void
{
// Where the user pointer right now

[code]......

View 1 Replies

ActionScript 3.0 :: ScaleX And Math.random - Randomly Point Either To The Left Or The Right

Feb 25, 2011

I have a column of objects down the center of the stage and I need them to randomly point either to the left or the right. They have been placed using a for loop so I can't point each one individually. I was told I could use Math.random to flip their scaleX position but I can't get it to work.

View 4 Replies

ActionScript 3.0 :: Calculate Position According To Rotation?

Jun 16, 2011

I have child (1) and I am rotating it by some custom num of degrees. After rotation (2) I want to 'align' this child to left_center side of the parent (should look like 3). Without roration I would set x to 0, but after rotation position of registation point changes.

way to calculate new x/y position based on rotation.

View 6 Replies

ActionScript 2.0 :: Calculate The Exact Position And Scale?

May 15, 2006

imagen I have a movieclip (space_mc) w1000Xh1000 px?

inside the space_mc I have 2 movieclips:
- vlak1_mc (w100xh100px, _x:100,_y:100);
- vlak2_mc (w100xh100px, _x:400,_y:400);
ok!?

now i put the space_mc on the stage and scale it to 20% the stage (document properties) are w800xh600

Now i want that the USER clicks on vlak1,2_mc and the space_mc scales to 100% But the clicked vlak(1,2)_mc must have the exact coordinates as in the space_mc?

so if clicked on the vlak1_mc!

the space_mc zooms in to 100% and the _x,_y of the vlak1_mc are x100,y100 on the stage(800x600)?

[URL]

View 1 Replies

ActionScript 2.0 :: Math Function - Set Variable To Random Position

Sep 2, 2011

I cant get this to work. I think its pretty self explanatory what I want to do, set _x to a random position (b1 - b6)

Code:
onClipEvent (load) {
stop();
b1 = 462;
b2 = -462;
b3 = -1388;
b4 = -2314;
b5 = -3240;
b6 = -4166;
} onClipEvent (load) {
RanNum = Math.ceil(Math.random() * 6);
_x = ["b" + RanNum];
}

View 2 Replies

ActionScript 2.0 :: Math - Random Position On The Outskirts Of Circle

Sep 23, 2007

I'm trying to find a random x,y value that always is at the far end of a circle. Like if the circle has a diameter of 300 pixels and the centerpoint is at 50,50, I want a random position on the outskirts of that circle. Just cant seem to do it.

View 4 Replies

ActionScript 2.0 :: Atan2 Outputs The Following Angle Scheme - Assuming The Point Relative To Which The Math Is Done Is In The Center Of The Circle

Sep 16, 2011

So let's begin. I want to build a wheel which you can spin, similar to a roulette wheel. You can do this both ways (CW and CCW, this issue causing the bug, actually). The wheel has some acceleration to it too, and I achieve this by measuring the start and final angle of the drag movement, using Math.atan2(dy, dx). The problem is the following: atan2 outputs the following angle scheme, assuming the point relative to which the math is done is in the center of the circle.

atan2 returns a value measured in radians, so I'm using the classic angle*180/Math.PI formula. I've changed this original scheme into the following, using some simple math to shift the angles a bit, to resemble more accurate circle angles (going up to 360 degrees) The problem that I'm facing at the moment is should the user decide he wants to swipe clockwise, and moves through the right point, where 0 turns into 360 or 180 turns into -180, the whole angle difference thing is capsized. It registers a CCW movement (as if the user swiped his mouse all around the circle). So, I'm looking for some ideas as to how I can work around this small issue.

View 1 Replies

Flex :: Calculate Line Number Relative To Cursor Position In TextArea?

Jun 11, 2009

How can i find line number in events like mouse clicked, key down and key up. And also highlight that line with color. I used TextArea.

View 1 Replies

Actionscript 3 :: Using A Point To Set Position?

Mar 8, 2011

Is there a way to set the x and y at the same time using the Point object?

View 2 Replies

Actionscript 3 :: Calculate The Next Position Of A "enemy" If Know The Positions X, Y, Rotation And Speed?

May 4, 2011

How can I calculate the next position of a "enemy" if know the positions x, y, rotation and speed?

View 1 Replies

ActionScript 2.0 :: Math.random - Slide To A New Random X Position When Mc Is Less Than 5 Pixels Away From Its Target

Mar 3, 2004

What I want is for my mc to slide to a new random x position when it is less than 5 pixels away from its target, it keeps doing this. the problem is for some bloody &*�$(()** reason my random numbers only keep going up!! why is this?? i want to produce random numbers between 1 and 770 - this is my code..

[Code]...

View 5 Replies

Flash :: Change Position Of Registration Point In CS5?

Sep 13, 2010

Is there a way to change the position of the registration point inside a Movie Clip using Flash5 ?I've found stuff online for older Flash versions but not CS5.

View 2 Replies

ActionScript 3.0 :: Find X Position Of A Point On A Line?

Aug 22, 2009

To make this easy, lets say I have a movie clip with a diagonal line in it (top left to bottom right).

I want to start my y position at 0, and place it in a loop and increase y by 5 every time. So we start at the top left of the clip, and move to the bottom of the clip.

Now since we have our y value (0, 5, 10, etc.) would you get the x position of the line? such as (x, y):
5, 10

or

42, 15

View 1 Replies

ActionScript 3 :: Flash - Math.floor Acting Like Math.round?

Mar 7, 2011

Here is the problem:

var p:int = 0;
var n:Number = 0;
n = 32.999999999999999;
p = Math.floor(n);
trace(p); // returns 33
n = 32.11111111111111;
p = Math.floor(n);
trace(p); // returns 32

I would expect both of these to return 32. I have searched, and it seems this is an unreported bug in AS3. Or ... am I doing something wrong?

View 4 Replies

Actionscript 3 :: Find Closest Point To Mouse Position?

May 29, 2011

I've got a grid of sprites.Now I would like to drag an image on a grid-element.Therefore I need to know which x/y of the grid-element is the closest point to the mouse-position.

View 2 Replies

Flash :: Change Position Of A Display Object From One Point To Another?

Feb 15, 2012

A display object container on the stage has some bitmap images of sizes 50x50 arranged in a order one by one. Now if i click on any of the thumbnail image (bitmap) the entire container should move and position itself so that, the bitmap image clicked is placed in the center of the stage.

View 1 Replies

Actionscript 3.0 :: Position MovieClip With Unknown Registration Point?

Jun 15, 2010

Normally, this is a simple task if the registration point is either top left or dead center of the movieclip. Unfortunately, this may not (and likely will not) be the case for the movieclips I am trying to position, so I was wondering if there was a way to center a movieclip in a given area without knowing it's registration point.registration point via the Matrix class or any other method, as it's very important for positioning of the movieclips inside of it.

View 6 Replies

ActionScript 2.0 :: Reset The Registration Point To The Clicked Position?

Nov 11, 2003

i'm trying to zoom in on a picture at the specific spot where the mouse is clicked. ie if the mouse is clicked in the lower left corner, the pic gets bigger from there, not the center of the pic. the only way i can think of to do this is to reset the registration point to the clicked position. is this possible? is there another way to go the job done?

View 12 Replies

ActionScript 2.0 :: Ending _y Position Based On The Starting Point?

Aug 19, 2008

i know the pythagorean theorem for figuring out distance between 2 points.

what i don't know is how to take that equation and determine another aspect based on 2 different bits of data.

figure out the ending _y position based on the starting point, the initial angle and the ending _x position??

View 1 Replies

ActionScript 3.0 :: Control A MC Position Based On Mouse Point?

Jan 20, 2011

I am trying to make an animation where the user can mouse over a small MC at the top of the stage, which controls the movement of another larger MC at the bottom of the stage.I am thinking that 'points' (which I know nothing about) might be the way to go. The other thing is that it needs to be fluid motion. Am I at least on the right track with points and mouse_move or is there a better approach for this?

View 2 Replies

ActionScript 2.0 :: What Is The Diffrence Between Math.floor And Math.round

Sep 26, 2005

Wat is the diffrence between these two?

View 2 Replies

ActionScript 2.0 :: Past A Certain Point It Is Scaled Down In Size And It Locks In To A Specified X And Y Position?

Sep 16, 2009

I have a MC that can be dragged. when it goes past a certain point it is scaled down in size and it locks in to a specified x and y position. The problem is this is causing the onPress function and onRelease function to not work properly. once the mc goes in i cant get it out. this is on the first frame of the timeline

Code:
flatline.onPress = function() {
if (_currentframe == 1) {

[code]....

View 3 Replies

ActionScript 2.0 :: Move Clip To A Position From A Varying Start Point?

Apr 1, 2004

I'm trying to have a movie clip with 4 buttons that moves to the four corners of the stage.Depending on which button is clicked, the movie clip goes to that corner.he trouble I'm running into is determining the variable start points. If the end goal is the lower right corner, it needs to be able to move there from the upper left, the lower left and the upper right. So I need to set the starting position as a variable I assume, but can't get it working.

View 2 Replies

ActionScript 3.0 :: Calculate Age From XML Data; Calculate Dates

Jul 1, 2011

I as this working in AS2 and need to update to AS3...shows that AS3 doesn't like sloppy coding. Here's what I need: I pull data from an XML and that works when I put the data into a dynamic text box. However, I can't seem to get the date of birth into a variable. I have some code that calcs age in years but uses a string literal that I thought I could just replace with a variable from my XML...ain't a workin'. Here's the code I have:

ActionScript Code:
import flash.display.*;
import flash.text.*;
import flash.events.*;

[Code]......

View 0 Replies

ActionScript 2.0 :: [F8] Math.round And Math.ceil?

Feb 16, 2009

I have a code in which I have to use Math.round if a certain value is for example 3.67 (67 is higher than 50) and Math.ceil if a value is for example 3.23 (23 is lower than 50). What can I do to make flash calculate if what after the dot �.� in 3.23 (for example) is higher than 50?

View 2 Replies

Professional :: Make A Circular Dial, Point At The Mouse Position While Staying Locked To It's Location?

Jul 23, 2010

I trained on flashMX back in the day and haven't done anything since so now I've got CS5 it's a bit like being at school again! I have a circular dial sat in the middle of the screen with an arrow placed on it's edge. How do I get the dial to rotate so it always faces the mouse pointer?

View 7 Replies







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