ActionScript 3.0 :: Moving MovieClip In Perfect Diagonal - Finding Coordinates

Mar 2, 2010

Imagine two movieclips, both on the same Y axis. I want one MC to be able to diagonally move to the other MC X axis, all while making a perfect diagonal line until it reaches 100y. So just like this picture, that MC moves in a perfect diagonal until it matches the other MC.x, and 100y (no matter what, it can't go past 100y but must equal 100y). I probably made it sound more complicated than it is.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Finding Movieclip Coordinates?

May 19, 2009

for some reason whenever i call or define a variable like this:

Code:
onClipEvent(enterFrame){trace(k); k = go._y;}
the trace results in "undefined". dose anyone know why and how to get around this issue? it

[code]....

View 1 Replies

Finding The Mouse X And Y Coordinates?

Apr 18, 2011

I'd like to use the x and y mouse coordinates as variables in a program. I'm very new to Flash and ActionScript and I'm not even sure which classes I need to import or which listeners or handlers I need to use.

View 1 Replies

Finding Object At X And Y Coordinates

Oct 16, 2009

We have a client server architecture where a C++ server talks to Flash clients. I'm developing the server and would like to send through tcp an xy coord to simulate a button press where the receiving flash client would find the topmost visible object at that coord and send a mouse event to it such that we could simulate play without a human present. I'm told this is incredibly difficult, but it seems to me that there must be a way to do this. Am I off the mark? Or is there a mechanism in flash to iterate through all objects regardless of parent child relationships to find a visible button at an x, y coord and signal a press event?

View 2 Replies

ActionScript 2.0 :: Finding X And Y Coordinates Of A MC

Oct 6, 2011

I have made a few posts now, and I'd like to especially Prid for not only answering them, but for giving me guidance on how to learn AS2. I am progressing very nicely, and have made a couple of simple games without any tutorials, but theres one thing I couldn't find. I have this character which can move, up and down, left and right. I also have an enemy trying to shoot at him. However, this enemy needs to know where the character is. I already have the shooting code (Prid), but it was for shooting in the direction of the mouse. What I need now is to replace the bit of code that finds the mouse coordinates with code that finds the coordinates of the player.

The shooting code is on the frame (doubt that is important to say, but still) and the instance AND name of the Character is, well, Character. So basically, I need a code to calculate coordinates of a movie clip that does not have a fixed position. Oh and one more thing, should I post simple stuff like this in the beginner section, because I've seen waaay more complicated stuff there than in the AS2 section.

View 9 Replies

ActionScript 1/2 :: Finding Coordinates Of A Color?

Jul 1, 2010

what i am trying to do is find the coridanates of anywhere there is the color red and save this in 2 variables. one  for the corodanets of the color on the x axis and one of the corordonates on the y axis.

View 7 Replies

ActionScript 2.0 :: Finding (X And Y) Coordinates For HitTest

May 5, 2010

I have a line dynamically drawn in a coordinatesystem. The line is drawn by the user. Now I wonder if there is a way to find out where the line crosses the y-axis. I know about hittest but how can I get exacltly where (x- and y-coordinates) for the hitpoint?

View 0 Replies

ActionScript 3.0 :: Finding Coordinates With 2 Objects

Nov 30, 2009

I get the feeling the title is misleading... What I try to achieve is quite simple (at least it sounds like a simple thing to do). I am trying to find the intersection of 2 objects in relation to each other. One of them is the character for my game, and the other is the obstacle (the floor, a barrel, etc). I need to find the coordinates of the character in relation to the obstacle. Here's a picture to make it a bit clearer:

Here the coordinates (and the cross) represent the origin of my objects, and the two squares are my character (twice to better represent the multiple possibilities). The number after the slash for the square is what I should get as the .x when my character hits the obstacle. I tried using getBounds(), but I really don't know about it and tried stuff based on the little knowledge I have about it (I won't post the code here, first it was horrible, and it also didn't survive the rage I had trying to get this to work...).

[Code]...

View 4 Replies

Actionscript 3 :: Finding Out Coordinates Of Drawn Objects In Flash?

Jan 6, 2010

I'm in the process of making a board game in Flash; as part of process of getting fully to grips with Flash AS3.

I have a JPEG of the original board. This contains ~ 1000 circles that players may move pieces between. Pretty standard board-game stuff. The circles are not in any way regularly spaced.

So far, I've drawn the circles in Flash, by hand, and positioned them where they need to be. This looks great - I can see all my places.

What I want to do now is create these circles programatically. I want to be able to do this so I can adjust how the spaces look (depending on game state). Eventually I'll want to be able to zoom / pan the entire game board as well.

My question is, is there a way of tagging each circle with a unique reference and then looping through and recording locations?

I'm thinking something a bit like the Javascript DOM "getElementsByTagName" or similar.

At the moment I can only see two options:

Convert each circle to a symbol and give it a unique class name so I can access it from code Go through and write down the X/Y of each circle (add to my DB of board locations that I already have) so I can plot them programatically

View 1 Replies

Flash :: Finding Closest Object In Proxmity To Mouse Coordinates

Mar 30, 2010

i've been working on a problem for a while now, which involves targeting the closest movieClip in relation to the x y coords of the mouse, I've attached a nice little acompanying graphic.Each mc added to the stage has it's own sub-class (HotSpots) which uses Pythag to measure distance from mouse. At this stage i can determine the closest value from my Main class but can't figure out how to reference it back to the movieclip... hope this makes sense. Below are the two Classes.My Main Class which attachs the mcs, and monitors mouse movement and traces closest value.[code]

View 3 Replies

ActionScript 3.0 :: Finding Stage Coordinates Of Point Inside Rotated MC

Jun 5, 2011

I have a Movieclip (MC1) with and moving object (OBJ1) inside it and using AS3. I want to do a hit test on it with another object (OBJ2) that is on the stage. Normally I would just do MC1.x + OBJ1.x to get my coords for the hit test. But how do I do it if MC1 has been rotated?

View 2 Replies

Stop Moving At Specific X Coordinates?

Nov 19, 2009

Im going to attatch the fla on here...I am also going to give you the script viewable here...im completely a beginner so i made my self notes
also this is not all my coding im just learning off of it to create my own project... What coding would i use to tell the mc to stop scrolling once it reaches a certain x coordinate? for example x=0 (left side of stage) or x= -484 which is when right side of picture is at right side of stage... and can i setup math for it to automatically determine the correct x coordinate (based off mc width) to stop at?? if there is easier scripting to do the same....fill me in
 
oh and x is off of the stage typically...this is panoramic pics im scrolling

[Code].....

View 2 Replies

ActionScript 3.0 :: Moving Objects Using X,y Coordinates?

Jun 23, 2009

I have a MovieClip on my stage. Inside the MovieClip there are a few buttons (all MovieClips also) and a mask layer to keep anything on the outside invisible.

Problem: My MouseEvent fires and should move objectA into position over objectB. All code in the script tells me it has moved. Tracing the x,y coordinates of objectA also tells me it has moved. The Alpha on objectA is 100% and it is positioned on the topmost layer beneath the mask layer. All this tells me that when the object moves, it should be visible on the stage (the event moves the object into the masked area). Testing disproves everything. The traces all tell me the object is where it is supposed to be but it cannot be seen. I don't understand this and it, amongst other AS3 hiccups, is seriously turning me off Flash as it seems to be a waste of time to try and learn as it seems like 90% of the scripts written will fail 90% of the time.

View 3 Replies

ActionScript 3.0 :: Moving Images By Coordinates?

Sep 3, 2009

I'm working on co-developing a game in flash, which involves, among other things, designating a path along which an image has to travel. Basically, it collects mouse coordinates, and needs to move the image to each set of coordinates in order. My co-developer insists that it needs to be done with trigonometry.Or is there some simpler method to move an image/movie clip/etc. cleanly to a given position on the stage?

View 2 Replies

ActionScript 2.0 :: X And Y Coordinates Inside Of A Moving Mc?

Jul 25, 2011

Excuse the title, had no idea what to call this. I'm creating a simple game with the following components (added picture for clarity):

[URL]

1. Character - The symbol in the center of the stage.

2. Level - The bounds surrounding the stage. Everything in this picture is contained within the level except for the character.

3. Water - The blue square. The water symbol is located within the level symbol.

4. Water droplet - The blue dot floating above the water. This is also located within the level symbol.

Using the arrow keys the player controls the movement of the level. While the character symbol is always located at x=275, y=200 (center stage), the level symbol's coordinates change whenever the arrows are pressed. This gives the player the illusion that they are controlling the character.

When the player makes the character symbol touch the water symbol, I want to move the water droplet to the location of the character. The problem is, I can't for the life of me figure out the coordinates I need as they will always be different depending on where the character touched the water. It's important that the water droplet be inside of the level symbol because after the player drops the water I need it to act as if it's moving with the surroundings.

tl;dr: I essentially need to find the x and y distance from the character symbol to the origin of the level symbol, keeping in mind that the level symbol's location is always changing and that both symbols are located on the stage.

View 2 Replies

ActionScript 2.0 :: Moving Menu To New Coordinates?

Nov 21, 2005

3 buttons, one on top of the other, being 40 pixels far one from the other. Id like to, when any of the buttons clicked, for all of them to move 40 pixels down, changing positions, BUT... the last button has to change places with the first one, going from outside the canvas... Here I attached an animated example of what I whant...

View 4 Replies

ActionScript 2.0 :: Moving Picture To Different Coordinates

Sep 4, 2007

I have this picture which has the dimensions 5599x660 and it's kinda like a moving background, it's moving to the left.Now, when it reaches the end I want it to be replaced by the same pic.Stage size is 950x720.I came up with two possible options:

1. make a duplicate of the pic movieclip and place it on stage right behind the first one and then when the first one is off stage place it right behind the second one and so on...

2. have flash duplicate the pic automatically and place it right behind the original one (I read about that option somewhere I think it's called DuplicateMovieclip)[code]

1. it works, but after the first round - it goes through image 1 (img) then through image 2 (img2) perfectly and then when it's supposed to place image 1 right behind image 2 there's a space of about 100 pixels between them... I don't know why because I gave the right x coordinates in the code...

2. now when u still go on and u go through (the misplaced) image 1 (img) and then u come to the point where it's supposed to place image 2 (img2) right behind image 1 there's also a space between them but only maybe of 5 pixels.How come that with the same pictures with the same code for both of them it's doing something different both times ?

View 1 Replies

ActionScript 2.0 :: Mc Moving According On Mouse X And Y Coordinates?

Jul 1, 2004

trying to make a MC to change s x location according to the mouse position. Les say that the Mc moves to x=100 when the mouse_x is > 300 and y < 200. and moves back when the mouse goes back.

View 9 Replies

ActionScript 3.0 :: Movieclip Hit Area, Set To Dimension, Instead Of Pixel Perfect?

Dec 4, 2010

i have a simple movieclip, based off text, with a few frames, and instead of creating an invisible area to do the hit test, is there any way to set the hit area to equal the movieclip's dimensions?, google seems to not be able to provide results, i don't need pixel perfect hit detection, but rectangle detection

View 2 Replies

ActionScript 3.0 :: Moving Object Coordinates Cannot Be Calculated?

Mar 11, 2011

There is a plane in my movie and it's moving (from starting point (x,y) to end point (x',y') coordinates in timeline). it's a very simple issue.And there is a popup that will be visible when user click on the plane mc.

I wrote the following code :
planepp.visible = false;
plane.addEventListener(MouseEvent.CLICK, planefunc);

[code]......

View 6 Replies

Professional :: SWF Player Not Finding The Flv File When Moving To Webpage?

Mar 10, 2011

Making simple player to allow viewing on website.Adding flv file to create a published player.Works fine after publishing on local system as long as the flv is located in the same directory as the swf player.When copying to a website, it seems the player does not know how to find the video file.

View 1 Replies

ActionScript 2.0 :: Button Press Moving Object To Coordinates?

Oct 9, 2009

I'm attempting to make a game which moves an object to certain x/y coordinates on the push of a button, but I can't figure out what would be needed.

View 1 Replies

ActionScript 2.0 :: Moving Menu - Setting The Mc On The Initial X And Y Coordinates?

Mar 21, 2004

I m having some problems with my menu I m working on.Its weird cus I d already have done the same menu once and worked fine..The selector mark is suposed to "mark" the selection on the menu after a selection is pressed. But I m having problems with the X and y coordinates and scales of the MC and when I click on the option,the MC gets smaller and then bigger to the size I want.Its suposed change scale and position but its not working like it is suposed to work.I m not sure either if I m setting the Mc on the initial x and y coordinates.

View 4 Replies

Get X , Y Coordinates Of A Movieclip?

Feb 23, 2011

I have a movieclip inside another movieclip.[code]...

I can get mc_inside._x and mc_inside._y properties relative to the container movieclip, but how can I get the mc_inside._x and mc_inside._y relative to the _root (the stage)?

View 1 Replies

ActionScript 2.0 :: Finding Movieclip's Identifier Name?

Sep 22, 2009

I could not find this one. So say a movieclip is called Background.I have some code in its timeline's first frame and i want to use trace to print its prototype/identifier name.how can i do it?could not find anything even on googling.May be I'm searching for the wrong keyword.

What I mean to find out is what is shown in the Identifier section of the symbol properties.

View 6 Replies

ActionScript 3.0 :: Finding Name Of Instance A Movieclip Is In?

May 15, 2011

I have 3 instances of the same movieclip (let's call it mc1). In that movieclip is a different one (mc2). In the class for mc2 i need to find out the instance name of which instance of the mc1 it is in.

Is there a way I can I get the name of the instance of mc1 that mc2 is in?

View 9 Replies

MovieClip Control With Buttons - X And Y Coordinates

Apr 8, 2009

I'm putting together a site, that has 3 pages and I'd like the content to move into position when the menu button is clicked. So, 3 buttons etc, 'Home, Portfolio, contact" and one movie clip that contains the info. I'm not really a programmer [URL].

View 1 Replies

ActionScript 3.0 :: XML Coordinates To Position Movieclip?

Nov 7, 2010

I have this XML that I want to use to set the position of movieclips placed dynamically on the stage but I am having a hard time figuring it out.This is what I have in my XML:

ActionScript Code:
<STARS>
<STAR XPOS ="93" YPOS = "44"> </STAR>

[code].....

View 6 Replies

ActionScript 3.0 :: Get The X And Y Coordinates Of An Object In A Movieclip?

May 16, 2011

Basically there's an object in a movieclip. I want to find the location of that object in relation to the movieclip, not of the object's symbol. So when i and look at the x and y of it, it wont show 0, it will show the x and y location in the movieclip it's in.

View 4 Replies

ActionScript 2.0 :: Trigger Movieclip Within Certain _x && _y Coordinates?

Apr 14, 2004

Is it possible? Has there been a thread on this..

View 5 Replies







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