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
Similar Posts:
Jan 13, 2011
I'm trying to update a clients site and the original developer left almost no instructions.The code is all updated through XML.Here is a sample of the code
enter code here<FOLDER NAME="COMMERCIAL">
<GALLERY NAME="LOCANDA VERDE: New York">
<IMG HEIGHT="500" CAPTION="Some photo" WIDTH="393" SRC="locanda1.jpg" DX="60" DY="40"
[code].....
View 1 Replies
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
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
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
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
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
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
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
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
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
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
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
Mar 28, 2011
if AS supports anything similar to hashes in perl (okay, it's been a long time since I've done any coding).If I want to get the x and y coordinates of an object I do it like this:
ActionScript Code:
thumbnails[0].getXY()[0]; // Get X
thumbnails[0].getXY()[1]; // Get Y
and I'd rather it look more like this:
ActionScript Code:
thumbnails[0].getXY(){"x"}; // Get X
thumbnails[0].getXY(){"y"}; // Get Y
View 3 Replies
Feb 23, 2012
I am trying to do a apply a tween for the width property on a MovieClip Object but every time it changes the width and the position too, and I don't want that. I want to change the width going to one side without changing the x and y of the object.
I tried both of thes and they gave the same result.
var c:Tween = new Tween(left, "scaleX", Strong.easeOut, 1, 1.5,20,true);
var c:Tween = new Tween(left, "width", Strong.easeOut, 20, 200,20,true);
I think it is applying the transformation according to a center of the movie clip. but I don't know how it can be changed.
View 2 Replies
Apr 13, 2011
Im working on a small project and it involves a guy which you move with the arrow keys. The arrow keys add to his x, y velocities and his position is updated accordingly. How can i get this man to grab onto an object and spin around it (like when you grab pole and letting your momentum swing you around) . I can make him grab the object but I dont know how to modify his x,y speeds to simulate the arc.
View 4 Replies
Oct 7, 2011
I want to find out what object is at 200x300? is there a particular command for this?
View 2 Replies
Dec 7, 2011
I have a Flash project that I would like to export the coordinates of an object from. Ideally, I would like the position of the object for each frame in the animation.
View 1 Replies
Feb 17, 2003
I have an object that moves when the arrows are pressed but how do i display the coordinates of the object, x and y? I tried
this.x=this.x
this.y=this.y
and then two dynamic boxes called x and y but it doesn't work!
View 5 Replies
Jun 27, 2005
What is a good function to simply move an object to X and Y coordinates?I can find is actionscript that does movement plus other animations, like rotate and scale.I just want to let the user drag an object, but when they release it, that object moves back to certain X and Y coordiantes.
View 1 Replies
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
Oct 13, 2010
my title explains what im need but im using flash cs4 and heres what i have so far:
var centerX:Number;
var centerY:Number;
var centerZ:Number;
[Code].....
ok so RBall is my first moving object and my orbiting object will be called orbit
View 9 Replies
Oct 27, 2009
What is the simplest way to determine absolute object coordinates in AS3?
View 1 Replies
Jan 27, 2010
How do I get the 2D screen coordinates of a 3D object when using Papervision 2.0 (Great White)? I've read that following properties should return the screen coords but these always return 0.
[Code]...
View 2 Replies
May 12, 2010
I have a string of about 5 movieclips that are tweened so that when you click left or right they slide in that direction. When you click on the movieclips themselves I want them to:
on mouse down - move to (y-5)
on mouse-up - move back (y+5)
this all works fine, however after I have clicked on one of the movieclips to make it jump, when I click left or right to slide them all over again they don't slide with the rest of the clips anymore?
View 1 Replies
Oct 7, 2011
I have the coordinates, i just need to know what is there. Is there a simple command that will return this to me?
View 1 Replies
Oct 24, 2011
I need to have a textbox displaying the x coordinates of an object during its motion tween. I know how to do it for individual frames but don't know how to add an eventListener to do it over the span of the tween.
View 9 Replies
May 8, 2009
how I can pass a variable calculated in a function, to the stage.
View 9 Replies
May 27, 2010
i'm trying to trace the x and y coordinates from within a sprite. i've added a rectangle to the stage:
var rect:Rectangle = new Rectangle(10, 10, 200, 200);
addChild(rect);
rect.x = rect.y = 100;
adding a Mouse_Move event to the rect, i can trace mouseX and mouseY to receive the coordinates of the stage while moving over the rect, but how do i get the local x and y coordinates? so if i mouse over the very top left of the rect sprite, the mouseX and mouseY return 10 as the global coordinates, but how do i make it return 0 and the local coordinates of the sprite?
i assumed localX and localY was what i was looking for, but this doesn't work:
function mouseOverTraceCoords(evt:MouseEvent):void
{
trace(mouseX, mouseY, evt.localX, evt.localY);
}
View 3 Replies
Jul 29, 2011
When tracing the mouseX / mouseY or localX / localY coordinates of a display object, why does x start at 1 while y starts at 0? For example, I've drawn a simple 400 x 400 pixel sprite onto the stage with a MouseEvent.MOUSE_MOVE event listener that calls a handler function to trace the local coordinates of the mouse. The first, top-left pixel returns {x:1, y:0} and the last, bottom-right pixel returns {x:400, y:399}. Shouldn't both the x and y start and end with the same value? I'm not sure which makes more sense for a the first mouse coordinate (either 0 or 1) but it certainly doesn't make sense that they are different?
[SWF(width = "1000", height = "600", backgroundColor = "0xCCCCCC")]
import flash.display.Sprite;
import flash.events.MouseEvent;
var darkBlueRect:Sprite = createSprite();
darkBlueRect.x = 23;
[Code] .....
View 1 Replies