Display Mouse Coordinates
does someone know how to make a textfield that shows the mousecoordinates?
i hope someonecan help me
greetz Robb
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 11-30-2004, 10:36 AM
View Complete Forum Thread with Replies
Sponsored Links:
Display Coordinates
Hi all,
I was wondering if anyone can tell me how to place numbers in my website that will correspond to the coordinates of the mouse?? I tried looking up a tutorial but it doesn't work and causes my computer to freeze. Please help!
quester
View Replies !
View Related
Display X And Y Coordinates
Hi,
I'm new to actionscript. What I'd like to do is as follows:
I have a draggable movie clip called ln, and what I'd like to happen is, when you click it and drag it, its X and Y coordinates get displayed somewhere on screen, where they're visible to the viewer. Then when you release it, the coordinates freeze in place
How would I go about doing this?
Any help would be thoroughly appreciated.
View Replies !
View Related
Display X And Y Coordinates
Hey,
I have a draggable movie clip (ln), and what I'd like to be able do is display the X and Y values of this movie as you drag it. I've tried ceating two variables, to hold these coordinates as follows:
posY = ln._y;
posX = ln._x;
Then I use these variable names in the Var bar of two input text boxes. They both display the x and y variable, but only once. They don't change as the clip is dragged accross the screen, which is what I want to happen.
Does anyone know what I'm doing wrong?
View Replies !
View Related
Getting There: How To Add Coordinates And Display Order To Script?
Ok, I'm trying to make this script work with some pictures. Now I need to add something to this script so that when the pictures is involved, ie moused over or clicked on etc it moves to the front and, when clicked on, moves to the center of the page, then when clicked on again, as it would return to normal scale, also returns to its initial position and order. Any help is great, thanks alot!
Quote:
function ZoomButtons() {
this.onRollOver = function() {
this.maxScale = 200;
this.scaleInc = 50;
this.onEnterFrame = function() {
if (this._xscale<this.maxscale) {
this._xscale = this._yscale += this.scaleInc;
} else {
this._xscale = this._yscale=this.maxScale;
delete this.onEnterFrame;
}
};
};
this.onPress = function() {
this.scaleInc = 50;
// set the increments at which you want the mc to scale
this.onEnterFrame = function() {
if (this._xscale>150) {
this._xscale = this._yscale -= this.scaleInc;
} else {
this._xscale = this._yscale=150;
delete this.onEnterFrame;
}
};
};
this.onRelease = function() {
if(_level0.button_pressed_once == false){
this.scaleInc = 50;
// set the increments at which you want the mc to scale
this.onEnterFrame = function() {
if (this._xscale>500) {
this._xscale = this._yscale -= this.scaleInc;
} else {
this._xscale = this._yscale=500;
delete this.onEnterFrame;
}
};
_level0.button_pressed_once = true;
} else {
this.scaleInc = 50;
// set the increments at which you want the mc to scale
this.onEnterFrame = function() {
if (this._xscale>100) {
this._xscale = this._yscale -= this.scaleInc;
} else {
this._xscale = this._yscale=100;
delete this.onEnterFrame;
}
};
_level0.button_pressed_once = false;
}
};
this.onRollOut = function() {
this.scaleInc = 50;
// set the increments at which you want the mc to scale
this.onEnterFrame = function() {
if (this._xscale>100) {
this._xscale = this._yscale -= this.scaleInc;
} else {
this._xscale = this._yscale=100;
delete this.onEnterFrame;
}
};
};
}
ButtonArray = new Array (ZoomBtn, ZoomBtn1, ZoomBtn2, ZoomBtn3, ZoomBtn4, ZoomBtn5, ZoomBtn6, ZoomBtn7, ZoomBtn8, ZoomBtn9, ZoomBtn10, ZoomBtn11, ZoomBtn12)
for (var i = 0; i < ButtonArray.length; i++){
var who = ButtonArray[i]
ZoomButtons.apply (who)
}
View Replies !
View Related
Movie Clip Coordinates Display +
trying to display the co ordinates of the center of a MC. but this then have to be change this to grid reference on a map(image) which is below it .
Grid is 1-8 down
and A - H across.
so the MC display would be like A1, or D5.
Any help or tutorials would be appreciated.
Many thanks
View Replies !
View Related
3D Flash Actionscript Coordinates Display
I was wondering how would someone put the x and y coordinates onto the screen during their movie? I want the coordinates of the movement frm the key pad control (up,down,left & right) to be displayed and change as the view in the movie on the screen during the movie, how would i do that. and can i also get the time that someone is on the site to be displayed on the movie also (changing second by second).
View Replies !
View Related
Mouse Goes To Coordinates
hi,
is it possible to make an animation where the mouse goes from one coordinate to another - automaticaly.
I need this for showing a certain point in the movie. I know it can be made with hide and show cursor, but I want that the mouse stays at the last coordinates and that one can continue from this new point.
thanks for help
caitanya
View Replies !
View Related
Help - Mouse Coordinates
I have a set of lines in my movie, and buttons that relate to them. When the mouse goes over the line, I want the button to move to whatever position the mouse is at.
Hope this is making sense...
I jsut need help in getting started... if anyone can help it would be appreciated.
View Replies !
View Related
Mouse Coordinates
I want to tell my movie to go somewhere if my mouse leaves certain Coordinates (for example a rectangle in the middle of the screen)
- I can't use mouseout or anything like that is has to be done with Coordinates
Thanks,
Kaan.
View Replies !
View Related
Mouse Coordinates
Anyone know how to grab the mouse coordinates and then display a movieClip exactly where those coordinates are when rolling over a button?
Also, is there a way where you could place the movieClip just a little off of those coordinates? say, maybe 50+/- pixels off of the y axis?
thanks.
4zero4
View Replies !
View Related
Mouse Coordinates
hello again. I posted last week and received a reply, but still can't make any headway on this problem.
I'm trying to make a script that recognizes if the mouse movement on the x-axis is higher or lower than it's last position. I know to use _xmouse for the position, but I can't grasp the logic on how to get it to compare two _xmouse positions in the same script without it giving the same coordinates for each. Does that make any sense? I guess it's something like this:
last mouse = ? _xmouse ?
current mouse = _xmouse
if current mouse > last mouse
goto...
else if current mouse < last mouse
goto...
Any help is appreciated. Thanks
-A
View Replies !
View Related
X And Y Mouse Coordinates
Just a quick Question....
I want to display the mouse x and y coordinates. I know how to do that, BUT is there any possible way to make it so there are no decimal places showing. I can only fit 3 characters max.
Thanks
Trev
View Replies !
View Related
How To Get Mouse Coordinates?
Hello everybody
I just got Flash CS3 and I need to work on a project that involves knowing where the mouse is when on screen. There will be an object that will follow the mouse as it is moved using tween. I found pretty much what I needed in a book but it is in AS2. I am trying to port it to AS3 without success. So being mthodical, I want to know, first of all how to access the mouse coordinates. When that is done, I will start working on the tweening. Here is the code I found:
Any help would be greatly appreciated.
Thanks
Rick
Attach Code
//Import the Tween and easing classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
// Declare the hero instance on the Stage
var hero:MovieClip;
// Establish variables to store Tween instances,
// one for the X position of the hero and
// one for the Y position of the hero
var twX:Tween;
var twY:Tween;
// When the mouse cursor moves
onMouseMove = function():Void {
// Retrieve the current position of the mouse
var xPos:Number = this._xmouse;
var yPos:Number = this._ymouse;
// Establish the duration of a tween, in seconds
var duration:Number = 1;
// If a Tween instance has not been created yet
if(twX == undefined){
// Create a new Tween for the X position
twX = new Tween(
hero,
"_x",
Regular.easeOut,
hero._x, // Start value: current hero X position
xPos, // End value: current mouse X position
duration,
true
);
// Create a new Tween for the Y position
twY = new Tween(
hero,
"_y",
Regular.easeOut,
hero._y, // Start value: current hero Y position
yPos, // End value: current mouse Y position
duration,
true
);
// Whenever the X position Tween instance
// starts (or restarts), show the defense frame
twX.onMotionStarted = function():Void {
hero.gotoAndStop("defense");
};
// Whenever the X position Tween instance
// finishes its motion, show the offense frame
twX.onMotionFinished = function():Void {
hero.gotoAndStop("offense");
};
// If a Tween instance has already been initiated
} else {
// Change the end value of the X position Tween instance
// to the new X position of the mouse
twX.continueTo(xPos, duration);
// Change the end value of the Y position Tween instance
// to the new Y position of the mouse
twY.continueTo(yPos, duration);
// Retrieve the current absolute scale of the hero
var scale:Number = Math.abs(hero._xscale);
// If the end value of the X position Tween instance
// is to the right of the mouse, use a positive X scale value.
// Otherwise, if the end value is to the left of the mouse,
// invert the X scale value to flip the graphic horizontally
hero._xscale =(twX.finish > twX.position) ? scale : -scale;
}
};
View Replies !
View Related
Mouse Over Coordinates
I am looking to create a menu similar to the one found here:
http://www.denovoartwear.com/
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?
Any help would be much appreciated.
View Replies !
View Related
Mouse Coordinates
why doesn't this work
PHP Code:
onClipEvent (enterFrame) {
_root.xval.text = _root._xmouse;
_root.yval.text = _root._ymouse;
}
it's attatched to a blank mc on the main stage.
there are two dynamic text boxes that have var names of xval and yval ..... i thought this would work ... apparently i've missed something
thanks
View Replies !
View Related
Mouse X And Y Coordinates
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. Any thoughts would be appreciated. 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. Thanks in advance for your ideas.
View Replies !
View Related
Mouse Over Coordinates
I am looking to create a menu similar to the one found here:
http://www.denovoartwear.com/
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?
Any help would be much appreciated.
View Replies !
View Related
X Mouse Slider Within Certain Y Coordinates
Hey there!
I am doing a website for a photographer and I want to display thumbnails of his images on an x_mouse slider. However I only want the slider to work when it is within certain y coordinates.
My boy genius 18 year old co-worker figured out exactly the code I wanted inspired largely by one of lynda.com cd roms. Anyways the company just went under and I no longer have access to the code. DOH!
Here is a look at what I have so far:
onClipEvent ( enterFrame ) {
shift = ((320 - _root._xmouse)/20)
if (((this._x >= 277) && (shift > 0) && (_ymouse < 550)) ||
((this._x <= -287) && (shift <
0) && (_ymouse < 550))) {
shift = 0
}
this._x = this._x + shift;
}
View Replies !
View Related
Constraining Mouse Coordinates
Hi all,
I have a panorama that scrolls according to the mouse _x value (i'm getting the _x value from a dragged mc).
everything works great. the only problem is it scrolls when my mouse is not only over the panorma image but anywhere in the swf file. i want to constrict the scrolling to only the area that has the panororama image.
any suggestions would be helpful.
thanks!
mike
View Replies !
View Related
Play When Mouse Within Certain Coordinates?
I'm trying to play the main timeline as soon as the mouse moves over a certain area.
Let's say, something along these lines:
If mouse_X>300 and <600
and mouse_Y>600 and <750
play.
I'm guessing I need an empty movie clip that tracks the mouse and set's a
property or something. Please help.
Thank You,
- olaf
View Replies !
View Related
Mouse Cursor Coordinates
Hi
Can anyone help? I'm trying to show the position of the mouse cursor in a Flash 5 movie. Rather than having just 3 digits for both the x and y positions I would like a longer list of numerals, similar to how they are displayed in the status bar of vector drawing programs.
Thanks
View Replies !
View Related
Getting Mouse Coordinates When DragLock Is On
I'm making a game, and basically, at the bottom, I have a projectile launcher, and as you move your mouse from left to right, it shifts left to right but does not move up.
startDrag("_root.toss", true, 0, 382, 550, 382);
So it's locked to the 382nd y pixel, and can move between 0 and 550 on the x axis.
Now, depending on where you click, vertically, I want it to throw either a short, medium, or long toss. I have the tosses defined, all I need is to figure out a way to get the mouse's Y location so I can process it in this script:
on (release) {
if (_root.tosslocation<=140) {
// init toss length
tossdepth = 3;
// initiate throw
gotoAndPlay("long");
// line up splash
_root.splash3._x = throwx;
} else if (_root.tosslocation>140 && _root.tosslocation<215) {
tossdepth = 2;
gotoAndPlay("medium");
_root.splash2._x = throwx;
} else if (_root.tosslocation>=215) {
tossdepth = 1;
gotoAndPlay("short");
_root.splash1._x = throwx;
}
}
View Replies !
View Related
Track Mouse Coordinates
Ok, so I posted earlier about a "turkey chasing" game I'm doing in MX. In that game, I had the 'chasers' attached to the mouse in the basic "mouse-tracking game" style.
Now, I'm trying to rewrite this so that the "chasers" all work independently. There are 4 chasers. Each must come on screen one at a time (preferrably like 10 seconds apart from each other). The turkey is the mouse. I've hidden the mouse and replaced it with a movie clip of a turkey.
I'd like each of the "chasers" to come on screen (independently) and follow the mouse coordinates at random rates of speed so that the same 'chaser' doesn't catch the turkey every time. When one of the chasers does eventually "catch the turkey", I'll just go to a different point on the time line and load a screen that says "You Win" or "Happy Thanksgiving" or something.
Note: each chaser must be independent as they all will have different "faces". I can't just make one MC and just have that load that one 4 times at different intervals, unfortunately.
Can anyone help with this? I'm desperate for some assistance. What I originally wrote is apparently not what my boss had in mind and I've got a very quick turnaround on this.
Help!!
I'm attaching the *original* file that I worked with, where it was just following the mouse, but none of the chasers are independent of one another, nor do they stagger their intervals. It's straight "track the mouse". Using placeholder images (circles, squares) for the turkey and chasers for now.
Thank you in advance!!!
View Replies !
View Related
Controlling An MC According To Mouse Coordinates
I Would like to control an MC depending on where the position of the cursor is. When the cursor is over a specified area, the mc plays a certain keyframe. When it is not over this specified position it plays a different keyframe in the same MC.
Is this possible without using buttons? I don't want to see the cursor turn to a hand when my curser is over the designated area.
Can anyone help.
Thanks.
Daze
View Replies !
View Related
Tracking Mouse Coordinates For Map...
Hello all,
I did a search of the forums but I didn't come across anything that specifically answered my questions.
I have a map of Colorado and I want to dynamically display the _xmouse and _ymouse coordinates in dynamic text fields. The goal is to have the dynamic text fields to display the specific coordinates of the mouse wherever it may be on the map. These coordinates need to be dynamic so they can change with the movement of the mouse. I.E.- As you move your mouse you can visually see the dynamic text fields change their output.
I have gotten the coordinates to display properly but I am experiencing a couple of problems.
1) The dynamic text field is displaying the map's x/y coordinates but I would like for it to display latitude/longitude coordinates instead.
2) I am encountering some rounding issues with my current code. I would like for the dynamic text fields to display a total of 4 decimals. The code I am currently using only displays whole numbers.
-------------------------------------------------------------------------
Below is the current code I am using to display the dynamic mouse coordinates where Latitude and Longitude are the variable names for the dynamic text fields.
Code:
this.onEnterFrame=function(){
longitude="_longitude: "+Math.round(_ymouse)+"š N";
latitude="_latitude: "+Math.round(_xmouse)+"š W";
}
-------------------------------------------------------------------------
Below is a diagram of how I would like the coordinate system to be.
-------------------------------------------------------------------------
Questions:
1) Does anyone know how I can display my "desired" latitude/longitude coordinates instead of the actual x/y coordinates? Please keep in mind that as the mouse moves I want the dynamic text fields to update their displayed data with the appropriate coordinates.
2) How can I make the desired output display four decimals instead of zero decimals?
Thank you all in advance.
View Replies !
View Related
Scaling From X And Y Mouse Coordinates
I have a script that dynamically loads a series of movie clips onto a larger movie clip after reading a xml file. I have a blank movie clip called container_mc that is sitting on the stage in the upper left hand corner. Currently when the user clicks a lot that lot scales from the container_mc which is currently working, I want to determine where the mouse is on the stage and move the container_mc to that location then scale it. Here is my function:
function showBigLot(mClip:MovieClip) {
trace(this._x);
trace(this._y);
var lotNo:String;
var scalex:Number=7;
var scaley:Number=7;
mark = mClip._name.lastIndexOf("_");
lotNo = mClip._name.substring(4,mark);
trace(this);
var newClip:MovieClip;
trace(close_btn);
newClip = mClip._parent._parent.container_mc.attachMovie("lo t "+lotNo,"lot_"+lotNo+"_big_mc",mClip._parent.conta iner_mc.getNextHighestDepth());
close_btn._visible=true;
container_mc._visible=true;
mClip._parent._parent.gotoAndPlay(2);
close_btn.onRelease = function () {
close_btn._visible=false;
lots_mc._visible=true;
mClip._parent._parent.gotoAndPlay(6);
}
newClip.onRelease = function () {
newClip._visible=false;
lots_mc.close_btn._visible=false;
lots_mc._visible=true;
}
}
any help would be appriciated.
View Replies !
View Related
[CS3] Rotating Using Mouse Coordinates
Hi, i'm pretty new to flash action script.
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.
any help would be great. I'm trying to get the effect of a horizon line rotating to the mouses movement around the screen.
cheers
View Replies !
View Related
One More Question, Mouse Coordinates
instead of using a rollOver button to close a menu, I would like to use something in actionscript like mousecoordinates. something like:
if(mouse_x > 200){
gotoAndStop(1);
}
This, ofcourse, doesn't work. The whole idea above in simple words:
if you move the mouse to x:240 and y:490 gotoAndStop frame 1.
Thanks!
Tipsko
View Replies !
View Related
Mouse Coordinates Over A Triangle
Hi Friends,
I need to make a tool where as you mouse over a triangle it displays the percentage of proximity to each of the triangle's three corners. Then, when clicked, it places a dot on that spot and the corresponding percentage values are sent to a web form. Please help! I am even willing to pay someone if you can help with this.
willstone06 @ gmail.com
View Replies !
View Related
One More Question, Mouse Coordinates
instead of using a rollOver button to close a menu, I would like to use something in actionscript like mousecoordinates. something like:
if(mouse_x > 200){
gotoAndStop(1);
}
This, ofcourse, doesn't work. The whole idea above in simple words:
if you move the mouse to x:240 and y:490 gotoAndStop frame 1.
Thanks!
Tipsko
View Replies !
View Related
Papervision : 3d Mouse Coordinates?
I'm trying to bring a 3D object closer to the camera upon rollover. The problem is that when it moves, it can move itself right out from under the mouse cursor, thereby cancelling the rollover.
What I'd like to do is bring the object closer, but simultaneously tween it toward the mouse cursor in the X and Y dimensions, to fix this problem. However, as far as I can tell, I would need to calculate 3d scene coordinates for the mouse cursor. How might I go about this?
Thanks very much,
View Replies !
View Related
Rotate Object Using Mouse Coordinates
Does anyone know how to or where I can find the actionscript for rotating an object on the spot by moving the cursor around the screen?.
Meaning when the mouse is to the right of the object it rotates left and if the cursor is to the left it rotates right.
while distance away from the object on screen affects the speed of rotation.
anyone know??
View Replies !
View Related
Detecting Mouse Coordinates, Tricky One
I have an MC that glows in and out, like a pulse. I want to have the pulse speed up as the mouse gets closer. I imagine it might take more than one mc with the pulse going at different speeds. Then when the mouse gets closer it will switch to a faster MC. I just don't know how to detect mouse coordinates and couldn't find any tutorials to help.
View Replies !
View Related
Rotation With Actionscript Using Mouse Coordinates
I'm working on a compass as navigation to a site that I'm working on, and the way it is set up is that the needle will rotates with the mouse as you roll onto the stage while a dial outside the compass rotates to the categories. Basically, what I want to happen is this: As you roll off the compass I want the needle to stop following the mouse and snap back up to whatever page you are in. I have included the fla file for anyone to take a gander at and hopefully give me a little help. Thanks in advance.
View Replies !
View Related
|