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


Similar Posts:


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

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

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

ActionScript 2.0 :: Moving Scene By Moving A Mouse Over Them?

Apr 22, 2007

I want to know how i can moving my scene by moving a mouse over them.

to understand what i want exactly ckeck this link :- [URL]

View 1 Replies

ActionScript 3.0 :: Mouse On / Off - When The Mouse Is Moving On The Stage The Counter Is Constantly Set To 0

Aug 24, 2009

[URL] when you have not clicked on all five dots, and you take the mouse of the stage, the interactive line should be deleted(graphics.clear(); ), and the little animation from the start should come back. my idea is to have a counter that ++ every frame, but when the mouse is moving on the stage the counter is constantly sett to 0. when the counter is, for example, 50 the animation i visible. do anyone have any methods that don't give the 50(for example) frame wait? and i would also like criticism and ideas on the rest.

View 7 Replies

ActionScript 3.0 :: Spurious Mouse Out Events When Moving The Mouse Down Or Right

Dec 4, 2008

why i am getting spurious mouse_out events when moving the mouse down or right but not up or left over a Sprite?

View 3 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

ActionScript 3.0 :: Mouse Coordinates In FF 3.6 On Mac OSX 10.6.3?

Jun 2, 2010

I have encountered really bad problem in one of our Flex projects. For some reason Flash can't get mouse coordinates properly. It returns something like (-107374182.4, -107374182.4) instead of good numbers. This happens when I'm using MOUSE_MOVE event in FF 3.6 on Mac OSX 10.6.3 with Flash Player 10. I have drag-n-drop in this projects, so with such ugly huge coords object goes far out of stage. Can't find solution in web, but there are some relative notes found...

For example, some info regarding 107374182.4 number can be found in internet.It seems 107374182.4 is something like NaN equivalent for some versions of Flash Player.Also I have found some notes regarding wrong mouse handling on Mac.The most interesting words there are: "on OSX it takes at least 1 frame to register the mouse's position". But it seems in my case it affects not only first frame after MOUSE_DOWN fired.Finally, there are movie on YouTube that demonstrates MOUSE_MOVE bug on FF/Mac.

I have tried:

- to get MouseEvent.stageX, MouseEvent.stageY (problem encountered);

- to get DisplayObject.root.mouseX, DisplayObject.root.mouseY (problem still appear, coordinates are bad);

- to use startDrag, stopDrag (it looks bugged too);

- to embed SWF into HTML with different wmode values.

View 0 Replies

ActionScript 2.0 :: Mouse X And Y Coordinates?

May 8, 2007

I need to get the mouse x and y coords for a game I'm making. I know how to do it with fererence to another movie clip, button, textbox, ... but not to the stage.If all else fails, I will attach a movie clip at (0,0) and then get the x and y coords from there, but if there is a simpler way, I would like to do that.

View 1 Replies

ActionScript 2.0 :: [CS3] Rotating Using Mouse Coordinates

Mar 12, 2008

I'm trying to create a simple site that when you move the mouse to the right of the screen a movie clip rotates one way abt 45 degrees and moves the other way when the mouse moves to the left.

I'm trying to get the effect of a horizon line rotating to the mouses movement around the screen.

View 10 Replies

ActionScript 3.0 :: Mouse Coordinates In An If Statement?

Sep 29, 2011

how to put mouse coordinates into an if statement, but as an 'if more than' but also 'if less than'. Something like:

Code:
if (mouseX > 190, but also <210) {
//do something
}

Is it possible to also do a similar thing to also include the Y position, to create a box of some sorts based on mouse position?
Something like:

Code:
if (mouseX > 190, but also < 210, mouseY > 20, but also < 100) {
//do something
}

I think it may have something to with setting each position as a var and pushing them into an array, but I can't get my head around it.

View 4 Replies

IDE :: Longitude And Latitude Using Mouse Coordinates

Oct 24, 2003

I have a new project which requires getting the Longitude and Latitude coordinates on a world map. I have searched everywhere for either the code or a tutorial,

View 4 Replies

ActionScript 2.0 :: How To Move Mouse Over Coordinates

Jul 19, 2004

I am looking to create a menu similar to the one found here:All I need to know is how do you get the bar on this site the white rectangle) to go to a specific x-axis location on mouse over?

View 3 Replies

Put X And Y Coordinates Of Mouse In Two Variables But Only On A Click On Workspace?

Apr 6, 2009

How can I put the X and Y coordinates of the mouse in two variables, but only on a click on the workspace.

View 1 Replies

Professional :: Control Timleline With Mouse X Coordinates

Feb 1, 2010

how to create a movie with a sequence of pictures and controlling the timeline frames with mouse x-coordinates?

View 4 Replies

Professional :: Control Frames With Mouse X Coordinates?

Feb 1, 2010

I want to take a folder with 20 pictures, in some way convert them into a movie. And then apply so that I can navigate the frames one by one in the movieclip by moving the mouse right and left  (move mouse left - navigate backwards frame by frame, move mouse right - navigate forward frame by frame).

View 2 Replies

Flex :: Obtain Item For Mouse X/y Coordinates?

Nov 24, 2009

my mission is to select an item in a DataGrid instance with nothing but the coordinates on screen.

We are implementing right-click functionality in our Flash application, with the goal of being able to right-click a DG row, which would select that row plus show a popup window containing some context commands.

I have managed to get the right click event into my Flex app with the help of this site.

Further progress so far has been to obtain the DataGrid instance via

var objects : Array = this.getObjectsUnderPoint(new Point(this.mouseX, this.mouseY));

and then to investige each of the array's items, for one of those 'parent.parentList' refers to the DataGrid instance.

I couldn't find any point-to-item converter function or anything.

PS: Using the standard Flash ContextMenu is, unfortunately, not an option.

View 3 Replies

Actionscript :: Get Mouse Z Coordinates On Flex Papervision3d?

Mar 17, 2011

I am working on panoramic scene . And I want to move a plane with cursor. When I move mouse, plane must be mouse coordinates. And I want to take plane 3D coordinates (x,y,z) expecially z-coordinate. I try below code. But it doesnt work correctly. Mouse and plane are not be same coordinates on screen. How I can do?

public class RayTracer
{
public static function getIntersection(viewport:Viewport3D, camera:CameraObject3D, normal:Array):Number3D

[Code]....

View 3 Replies

ActionScript 3.0 :: Scaling A Bitmap To Mouse Coordinates?

Dec 1, 2010

I have a turret in the middle of the screen and I want to draw a laser from there to the mouse coordinates. I could do this with this.graphics.lineTo(mouseX,mouseY) etc. but I'm not happy with the graphics I can get programmaticly so I want to get the same effect but with a graphic I've imported.But I'm stumped on how I can scale the graphic to the mouse coordinates.I'm also concerned that even if I can scale it it will look stretched. Does anyone know of a good way to do this?

View 0 Replies

ActionScript 3.0 :: Save The Mouse Coordinates Upon MouseClick?

May 20, 2011

I am making a game where when I click a movie clip on stage and the man will walk to that area. The man only moves one space when click, so it works if you continualy click the mouse. I just want to click the mouse 1 time and the character walks to that spot. Here is my code,

clickObject.addEventListener(MouseEvent.MOUSE_DOWN ,record_Mouse);
function record_Mouse(event:MouseEvent):void {
var record_MouseX:Number= mouseX;[code]........

/*I tried a loop for these last two lines, but it did not work, maybe I am doing it wrong, or maybe there is another solution? I also tried to return the value of man.x and man.y into a ENTER_FRAME event which does not seem possible with AS3*/

man.x+=vx;
man.y+=vy;
}

View 2 Replies

ActionScript 2.0 :: Get Isometric (3d) Coordinates From The Mouse Click (2d)

Sep 14, 2007

A few people asked me how to get isometric (3d) coordinates from the mouse click (2d).

The answer is: you have to assume that one of the x, y or z coordinates is fixed.

The original tutorial: [URL]

Original equations:

Code:
xFla = (x-z)*Math.cos(0.46365) + xOrigin
yFla = yOrigin - y - (x+z)*Math.sin(0.46365)
Legend:

[Code].....

View 2 Replies

ActionScript 2.0 :: Tracking Mouse Coordinates Into Array

Mar 9, 2004

I've been reading through all the various threads related to the drawing API and saving drawings. About a hundred times I've seen mention of "log mouse positions into an array" and stuff like that, but I can't find any clear and simple examples of how to do this. Let's take a very simple use of the drawing object to do freeform drawing. What is the AS to capture the mouse XYs as the user draws and put that into an array. I can't figure out how to get Flash to keep updating things as I go, it invariably grabs the fist point and that's it.

Let's use the most basic drawing example I can find:
[AS]_root.createEmptyMovieClip("line",1);
_root.onMouseDown = function(){
line.moveTo(_xmouse,_ymouse);
line.lineStyle(0,0x000000,100);
this.onEnterFrame = function(){
line.lineTo(_xmouse,_ymouse);
}}
_root.onMouseUp = function(){
this.onEnterFrame = null;
}[/AS]

Where/what gets added to just capture all those _xmouse and _ymouse?

View 14 Replies







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