ActionScript 3.0 :: Flash - Find Coordinates Of Another Movieclip On Stage?

May 4, 2011

I just started coding classes and I am having some pretty good success thus far coding individual objects. BUT I realized that I don't know how to find coordinates of another object that is on the stage!Say I am coding in the class "Zombieguy".With the other movieclips linkage "Armyguy" I try toracetrace(Armyguy.y);ORtrace(Armyguy.Y);Both come up with "access of possibly undefined property y through reference with static type Class".I'm sure this is probably pretty simple, but can someone inform me of how to do this small step that is holding me back?

View 12 Replies


Similar Posts:


ActionScript 3.0 :: How Does Flash Determine The Coordinates Of Movieclip In Relation To The Stage

Mar 28, 2009

Okay this is always something that's puzzled me. If I create a movieclip, place that clip on the stage, then inside that movieclip, create another movieclip, how does flash determine the coordinates of that second movieclip in relation to the stage. The reason I am asking this, is that I have a large movieclip which contains a number of other smaller movieclips. When a user clicks on one of the smaller movie clips, I need the larger movieclip to move so that the clicked movieclip is now centered on the stage.

I figure that this would be easier to know if I knew how to calculate the distance which the second, smaller movieclip is from the center of the main stage in x and y coordinate values. Am I making any sense? If not I'll try to explain again.

View 14 Replies

Flash - How To Find Absolute X / Y And Z Coordinates In AS3

Feb 11, 2011

I have been working on Flash AS3 project. I am designing a 3D system. Consider a MovieClip A which is at (0,0,0). A contains B which is at (10,10,10). If I rotate A by 10 degrees then the position of B with respect to A remains the same but position of B with respect to the system changes. To find Global X and Y of B, we have the function localToGlobal but it does not tell anything about the Z property. How to find that?

View 2 Replies

ActionScript 3.0 :: Find The Class Of An Extended MovieClip When Probing The Stage?

Feb 23, 2012

All my custom classes that extend MovieClip simply trace as "MovieClip" when using stage.getChildIndex(i); I'm trying to search the stage to see what objects have been placed and then add them to the correct array. E.g. if I place 5 "Enemies" on the screen, I want to then add them to an array by searching the stage for the "Enemies" class, without naming each one and adding it manually in the code.

Edit:

Code:
for(var i:int = 0; i < stage.numChildren-1; i++)
{
trace(getQualifiedClassName(stage.getChildAt(i)));

[Code]....

View 6 Replies

ActionScript 3.0 :: Find Out XY Coordinates With Classes?

Jul 4, 2011

i'm trying to create AS3 match game - match card to some square in the game.i created class for cards, and i'v tried to capture the card's original position so in case of dragging it to the wrong place, it will return to it's original place.from some reason it always returns to the 0,0 coordinates.

View 1 Replies

ActionScript 3.0 :: Find The Object At Particular Coordinates?

Oct 7, 2011

I want to find out what object is at 200x300? is there a particular command for this?

View 2 Replies

Actionscript 3 :: Find Out The X And Y Coordinates Of Each The Tabs

Sep 3, 2009

In a tab navigator, I need to find out the x and y coordinates of each the tabs. Is there a way to do that? I am using HBox as Tab in the TabNavigator.

View 1 Replies

Flash :: Get Coordinates In Parent But Not In Stage?

May 12, 2010

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.

View 2 Replies

ActionScript 3.0 :: Find Out Object Underneath Particular Coordinates?

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

ActionScript 2.0 :: Find Coordinates Of Text Cursor?

Nov 23, 2005

Is there any way of tracking the coordinates of a cursor in an input text box?

View 8 Replies

ActionScript 2.0 :: Find All The Coordinates Inside A Circle?

Oct 31, 2004

Okay without putting a million boxes around the circle, which i found laggs out my game alot. How can i use some sort of code to find all the coordinates inside a circle.

View 2 Replies

ActionScript :: Flash - Continuously Dragging Objects Within Bounds From Off-Stage Mouse Coordinates?

Jul 2, 2010

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.

View 2 Replies

Flash :: Movieclip Saves Bitmap At Wrong Coordinates?

Oct 8, 2011

I have a MovieClip inside a stage that is mostly(not accurately) centered to the middle of the stage.

When I try to save the MovieClip into a bitmap in order to upload it to facebook, I either get a cropped image or a white image(blank). Here is the code for generating the bitmap:

var source:BitmapData = new BitmapData(board.width, board.height);
source.draw(board);
var bitmap:Bitmap = new Bitmap(source);

The result I am getting is the yellow area in the following image:

[Code]...

View 2 Replies

Flash 10 :: Find Where An Item In Library Is Used On Stage?

Oct 22, 2010

Is there a way to find the location a clip in the library is used?

View 0 Replies

ActionScript 2.0 :: Make A Movieclip (or Button) Appear On Coordinates Randomly When Loading Flash?

Nov 25, 2010

i can't seem to figure out this:

I have 3 coordinates on a stage.
Coordinate1 (x50;y50);
Coordinate2 (x150;y150);
Coordinate3 (x250;y250);

How to make a movieclip (or button) appear on one of theese coordinates randomly when loading flash?

Coordinates don't change but movieclip (or button) goes to one of theese positions upon flash movie starting.

View 6 Replies

Flash :: Find Position Of An Object Relative To Stage?

May 17, 2011

If I have a rectangle on the stage, how do I find its top left tip (x,y) and the bottom right tip (x,y) in relation to the stage?

View 2 Replies

ActionScript 3.0 :: Flash Cannot Find Button From Main Stage

Jun 23, 2011

I have a button that I cant link. This was the correct code for the movieclip.
Code:
MovieClip(this.parent).tint_mc.gotoAndPlay("on");
Only now I have a button inside a movieclip. And Flash cant find my button from the mainstage. I tried
Code:
Button(this.parent).fac_btn.addEventListener(MouseEvent.CLICK,link);

View 1 Replies

Flash :: Find The Parent Of A Deep-nested Sprite From The Stage?

Jan 21, 2011

I'll give a complete explanation of what I'm trying to do. I have a video player as a separate SWF. In this video player I have a VideoContainer class extending Sprite, which contains the video and a control bar with specific video buttons.

This SWF is loaded in another main SWF, which has a menu that is on top of everything else. When I click "Fullscreen" in the video SWF, everything goes smoothly, except the menu remains on top of the VideoContainer object.

I need a way to change the display order of the loaded SWF, to put it on top of everything else on Fullscreen and change it back when Fullscreen goes off. All this needs to be made inside the video player. Also, the configuration of the children can change (the video player can be loaded in different places in the main SWF), so I can't use a certain unchanging path.

View 2 Replies

ActionScript 2.0 :: Coordinates Of Mc On Stage?

Jul 22, 2005

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.

View 2 Replies

AS3 :: Flash - Find Edge Of Movieclip?

May 21, 2011

movieclips in flash have a Rectalge Zone . if we have a Circle shape and covert to movieclip , have a Rectagle Area.with empty area.

i want terminate this area when az drag any moveclip on my target movieclip. when i use hitTestObject do now work good.

View 1 Replies

ActionScript 2.0 :: Cannot Get Coordinates In Respect To Stage?

Dec 5, 2007

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]....

View 1 Replies

ActionScript 3.0 :: Change Stage Coordinates Of A Project?

Sep 29, 2011

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

View 4 Replies

Actionscript 3 :: Showing An Objects Coordinates On Stage?

Oct 22, 2011

I need to show a an objects coordinates on stage as it moves across the screen.

View 2 Replies

ActionScript 3.0 :: Determining Stage Coordinates After Scrolling?

Oct 7, 2010

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.

View 1 Replies

ActionScript 3.0 :: Showing An Objects Coordinates On Stage?

Oct 22, 2011

I need to show a an objects coordinates on stage as it moves across the screen.

View 2 Replies

ActionScript 1/2 :: Passing Coordinates Relative To Stage Into A Nested MC?

Jul 8, 2009

I am building a project where I have 15 'islands' inside one big 'ocean' movie clip. I created navigation buttons so you can explore the Ocean movie clip and look around the islands. my problem comes when i want to 'zoom into an island'
  
So basically on the stage i have a movie clip called- Ocean_mc, and inside it are 15 movie clips, one of them (for this example) is a movie clip called GreenIsland_mc.
 
when a user clicks the GreenIsland_mc it needs to expand and place itself centre stage, then when clicked again in needs to colaps back to where it came from. The problem is that when GreenIsland_mc expands it needs to expand to coordinates relative to the stage, but when I shrink it back again it need to find the original coordinates relative to its place inside the Ocean_mc movie clip.

[Code]...

View 1 Replies

ActionScript 3.0 :: Use Stage Coordinates As Registration Point For Transform?

Jul 16, 2010

I am trying to scale a movieclip with AS3, but always using the center of the stage as the registration point. The movieclip is larger than the stage to begin with, and uses a slider component to slide back and forth. I'd like to be able to scale the movieclip using a button, but it currently uses it's own registration point (upper left corner) as the source.

Is there a way to force the scale to use the center of the stage?

View 3 Replies

ActionScript 3.0 :: Store An MC's X,y Coordinates Relative To The Stage As A Variable?

Dec 26, 2010

exactly as the title says, or is there a way to call up its original x,y coordinates like box_MC.originalX or something?

View 5 Replies

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

Aug 12, 2011

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

ActionScript 3.0 :: Intercept The Coordinates Of A Nested MC Respect To The Stage?

Oct 14, 2011

I've a button on the stage called "closedbt" that i have to move near an image. This image is nested into a MC named "gallery", then it's coordinates are different from the rest of the stage.

View 4 Replies







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