Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash


Advertisements:










ActionScript 3.0 :: Check An Objects X,y Coordinates Based On Where It Is On The Stage?


Is there a way to check an objects x,y coordinates based on where it is on the stage, vs. where it is in the movie clip that is on the stage?

need this to compare with the mouse for instance.


View 2 Replies (Posted: 08-12-2011, 11:05 PM)

Sponsored Links:

Related Forum Messages For Flash category:
Actionscript 3 :: Showing An Objects Coordinates On Stage?
I need to show a an objects coordinates on stage as it moves across the screen.

Posted: Oct 22 11 at 14:59

View 2 Replies!   View Related
ActionScript 3.0 :: Showing An Objects Coordinates On Stage?
I need to show a an objects coordinates on stage as it moves across the screen.

Posted: 10-22-2011, 02:17 PM

View 2 Replies!   View Related
ActionScript :: Flash - Continuously Dragging Objects Within Bounds From Off-Stage Mouse Coordinates?
is it possible for flash to detect off-stage mouse coordinates in order to continuously drag an object within its bounds while the mouse is moving outside of the stage? for example: i have a draggable red square on my stage. the stage is the bounds of the drag. if i drag the red square to the bottom of the stage and continue to drag outside of and around the stage, i'd like the red square to continue moving within it's bounds, following the mouse coordinates. currently, dragging halts as soon as i leave the stage and the red square only begins to move with the mouse coordinates if i reenter the stage bounds.

Posted: Jul 2 10 at 7:24

View 2 Replies!   View Related
Professional :: DropTarget Check Against All Objects On The Stage
Not sure the best way to do this. I have a class we will call DropActivity, here is the code

[Code]...

when the stopDraggingMe() method is called from another object (code shown below) I need to see all the objects on the stage to see what objects on the stage my currently selected movie clip is over and assign it to the dropCheck.checkAgainst method (that will be checked against an array to see if it can in fact be dropped, if so set the canBeDropped value to true and therefor run the .stopDrag() ). I have read using root is not a good coding practice in AS 3.

[Code]...

Posted: Oct 1, 2010 12:21 PM

View 3 Replies!   View Related
ActionScript 3.0 :: Loop Objects On Stage Input Text Check Box?
i have several check boxes and input texts on stage and would like to null out their values with a reset button but seem to be having issues, can anyone take a look

[Code]....

TypeError: Error #1010: A term is undefined and has no properties.
at Main/resetHandler()

Posted: 10-09-2010, 05:26 PM

View 9 Replies!   View Related
ActionScript 3.0 :: Plot Graphics Based On Map Coordinates?
Basically he have a lot of ships, that he need to plot on a map. The map is just a picture of europe, but the information for each ship is given in coordinates (longitude and latitude), and he want to know if there is a way to plot each ship (represented by a small red dot) on the picture map of europe using the coordinates already given.

Otherwise he would have to go into google earth and locate each position, and then add it, which would be pretty time consuming after a couple hundred ships.

If there are no easy way to do this, would there then be another way to convert the longitude/latitude coordinates into a x/y coordinate system for the picture of the map? (if we know what area the picture covers on the map)

Posted: 12-15-2010, 01:19 PM

View 12 Replies!   View Related
ActionScript 2.0 :: Change An Object's _rotation Based On The Xy Coordinates?
how do i change an object's _rotation based on the xy coordinates of another object (so it is facing it)?

Posted: June 4th, 2006

View 3 Replies!   View Related
ActionScript 2.0 :: Changing Behavior Based On Y, X Coordinates Over A Movie Clip With OnMouseMove
I was thinking that it will be an easy task but something is not right. Here is what I am trying to do. I want to be able to run a function if the mouse is moved over certain areas of the movie clip on stage. Based on which area of the movie clip the mouse is moved I'd like to be able to trigger different behaviour. Below is the code which I was thinking shoud do it:

Code:
var posY:Number;
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {

[Code].....

For some reason, the trace statement is ran always when the mouse moves regardless if it is over the movie clip or not. It also only shows the first trace statement. It is never chaged even if the mouse is in the different areas of the movie clip.

Posted: 09-22-2009, 08:23 PM

View 5 Replies!   View Related
ActionScript 2.0 :: Changing Behavior Based On Y, X Coordinates Over A Movie Clip With OnMouseMove?
I was thinking that it will be an easy task but something is not right. Here is what I am trying to do. I want to be able to run a function if the mouse is moved over certain areas of the movie clip on stage. Based on which area of the movie clip the mouse is moved I'd like to be able to trigger different behaviour. Below is the code which I was thinking shoud do it:

ActionScript Code:
var posY:Number;
var mouseListener:Object = new Object();

[code]......

Posted: 09-23-2009, 12:15 AM

View 0 Replies!   View Related
ActionScript 2.0 :: Save/Load Flash Based On X Y Coordinates Of Movie Clips?
I am developing a tool for analysis where you drag specific events onto a special wheel to analyze events based on time of day etc. I had a few users testing it and they asked for a save and load feature. I have done as much as I can at this point and am just growing confused. Can one of you experts take a look at my .fla and see what can be done...I think I am close but just can't figure it out. Also, if you can provide comments on cleaning up my code would be nice too.

Posted: 03-12-2010, 01:22 AM

View 4 Replies!   View Related
ActionScript 3.0 :: Capturing X,y Coordinates For Two Objects?
I have two columns of objects on stage, one on the left side column (A) and one on the right side (column B). Each column has 3 objects in it. For this quiz I want the user to be able to draw a line from each object in column A to the corresponding object in column B.To do this I need to capture the xy coordinates of the first object that the user clicks on and then capture the coordinates of the 2nd object the user clicks on so that I can draw a line between the two of them. Drawing the line is no problem but how do I capture the coordinates of the first object selected and then the 2nd object selected? This is as far as I've got with the code.

var clip:Shape = new Shape()
var startX=0
var startY=0

[code]....

Posted: 03-29-2010, 11:27 AM

View 1 Replies!   View Related
ActionScript 3.0 :: Moving Objects Using X,y Coordinates?
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.

Posted: 06-23-2009, 04:07 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Get Objects Absolute Coordinates?
My stage contains an object that contains a child. The child sees it's x and y position in relation to it's parent, so when the object moves, the coordinates remain the same.

How do i get a child's coordinates relative to the stage?

Posted: 10-02-2010, 05:48 PM

View 3 Replies!   View Related
ActionScript 3.0 :: Finding Coordinates With 2 Objects
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]...

Posted: November 30th, 2009

View 4 Replies!   View Related
Actionscript 3 :: Finding Out Coordinates Of Drawn Objects In Flash?
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

Posted: Jan 6 10 at 9:38

View 1 Replies!   View Related
Actionscript 3 :: Objects Coordinates Relating To A Frame On A Timeline
I am looking to create an animation (perhaps frame by frame) that corresponds with the coordinates of an object. Specifically, I want to have a draggable object's coordinates (locked to the x-axis) indicate where the playhead of a specific movie clip should be. In other words, let's say that I have a 100px wide stage and I want each px location of an object on that stage to correspond to a particular frame of a movieclip. In concept, I feel that it should be as easy as loading an objects coordinates into a variable, then passing that variable on with a simple math equation, adjusting it for movieclip length... but right about then my brain gets fried. Finding out how to lock a draggable object to the x-axis has been pretty easy, but from there I'm stumped. I'm not particularly well versed in AS3 but I do like to think I understand the concepts.

Posted: Mar 16 at 3:07

View 1 Replies!   View Related
Flex :: How To Get Size / Coordinates Of Content Area Of Container Objects
How do I get the size of the content area of Container objects? One non generic solution is checking for styles I suppose but I am looking for some code that works generic for all standard flex Container objects. The controls are Flex 3

Posted: Jul 21 10 at 6:01

View 1 Replies!   View Related
Actionscript :: Resize, Move, Export Coordinates Of Objects In Flash?
How would I place objects in flash, moving and resizing them, etc. and then export coordinates/rotation to a text file or something like that?

Posted: Jan 19 11 at 23:19

View 1 Replies!   View Related
ActionScript 2.0 :: Check Map Based On Postal Code?
Way to pull in a map (say mapquest or google maps), into a flash app based on a user postal code.

Posted: February 19th, 2008

View 1 Replies!   View Related
ActionScript 2.0 :: Coordinates Of Mc On Stage?
I have a whole stack of tile instances arranged in a grid on the stage. Each mc has a button in it. All I want is when the user clicks the 'mc', to return the coordinates of that mc relative to the main stage. I've tried _root, _parent ... everything.

Does each tile have to be named? Of course I have been able to find the coordinate if I name them all but I'm dealing with about 600 of them. Also, they are arranged in a weird way that I can't use AS to generate it at runtime. Check out the attachment and you will see what I mean.

Posted: July 22nd, 2005

View 2 Replies!   View Related
Flash :: Get Coordinates In Parent But Not In Stage?
I know about Flash's localToGlobal and globalToLocal methods to transform coordinates from the local system to the global system, but is there a way to achieve the intermediate? To transform coordinates from an arbitrary system to any other arbitrary system?

I have a clickable object inside a Sprite, and the Sprite is a child of the stage. I want to retrieve the clicked point in the Sprite.

Posted: May 12 10 at 8:39

View 2 Replies!   View Related
ActionScript 2.0 :: Cannot Get Coordinates In Respect To Stage?
Okay picture an mc embedded in an unknow amount of parent mcs. With the code put on the mc, I tried this:

Code:
trace( _root.stageX(this) );
where it is defined on the main timeline as:

[code]....

Posted: December 5th, 2007

View 1 Replies!   View Related
ActionScript 3.0 :: Change Stage Coordinates Of A Project?
Is it possible to change the coordinates of a project so that is it more like a graph?

Eg. The center of the page is 0,0 and the bottom is -200 and the top is 200

Posted: Sep 29, 2011 2:56 AM

View 4 Replies!   View Related
ActionScript 3.0 :: Determining Stage Coordinates After Scrolling?
I have a graphical component and I am trying to obtain it's coordinates relative to the stage by using the localToGlobal or contentToGlobal methods.

My problem is when scrolling a Container, these methods do not return the correct values, but return the old unshifted coordinates of the graphical component. Later, after everything seems stable, when trying to use the methods they return correct value so this means at the time where I use them after scrolling not all information necessary in computing have been commited.

For the case of the Container class I have investigated and although it passes through the scrollChildren method, the computation is wrong.For the case of the Tree component when scrolling with the wheel, the methods return correct value, but when pressing the arrow button of the scroll-bar the methods return incorrect value.

Until now I have tried to listen the scroll and the update complete events when they are dispatched but without any success. So my problem is that after scrolling I would need to know a moment(event to be listened or something else) that I can call the methods and the output to be ok.I would like the final solution to be uniform.

Posted: 10-07-2010, 08:22 AM

View 1 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved