Tracking Mouse
Hi,
I want to change a movieclips frame by the mouse movement around the stage. for example different body movements for different areas of the screen. I thought about certain hidden movieclips around the stage which change the state of the central movie.
Has any on any ideas or links etc
??
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 12-07-2005, 11:00 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Mouse Tracking
Okay, this is TWO questions in one post.
What I want to do is track the mouse movement. Now, I CAN do this, but there are two things I want to ask.
I have two dynamic textboxes called posX and posY.
First, a look at my code:
Frame 1:
var posX = _root._xmouse;
var posY = _root._ymouse;
Frame 2:
gotoAndPlay(1);
Now, here are my two questions.
1) How come I always get whole numbers whenever I move my mouse around? Is that the way it always is? Is there a more accurate way? Or should I not even bother?
2) Is there a better looping system then using 2 frames and going back to another frame? There's got to be a better way to do the loop so that it's more exact.
Riki
Tracking The Mouse? Possible?
Hi
is it possible to continously track the position of a mouse in an MC
I tried using the
_xmouse
_ymouse
properties and returned the values to a text field
but it only gave me the position of the mouse for only one position.
i need to continously track the mouse so i can implement an action that does something when the cursor goes out of a specific area that is designated in the form of a square by two x values and two y values
Thanx
Mouse Tracking
Hello,
I'm using a mouse tracking function like the one you can see here:
The target_mc is the movieclip that appears and tracks the movements of the cursor when you rollover button_bt.
Code:
_root.target_mc._visible = false;
_root.button_bt.onRollOver = function() {
_root.target_mc._visible = true;
_root.button_bt.useHandCursor = false;
setProperty(target_mc, _x, _root._xmouse);
setProperty(target_mc, _y, _root._ymouse);
startDrag(target_mc);
};
_root.button_bt.onRollOut = function() {
_root.target_mc._visible = false;
};
The problem is that everything works well, untill i rollover the button_bt a second time. Then the target_mc won't play. It seems the flash player forgets my actions. The second time i rollover, flash player only shows the last frame of the movieclip. Unless i reload the whole thing, or reload the webpage.
What can i do to force the flashplayer to play my movieclip every time i roll over the button?
Thanks in advance,
Noob.
Mouse Tracking Help Please
are there any tutorials or would anyone be able to help regarding mouse movement similar to this website. (its a "coming soon" page but the images on the left are what im talking about)
www.amontobin.com
it seems there are three layers and they all have a different relationship with the mouse.
thanx.
Mouse Tracking
Does anyone know of any mouse tracking APIs out there? i.e. tracking mouse movements of a user session for data collection. If there's nothing out there, I can come up with something but I don't want to develop something that's already around and better implemented.
Mouse Tracking
Hi i have a flash movie nested in an html page. And i would like the flash movie to know when the mouse is not over the flash part of the page anymore.
Can anyone help??
thanks
Guys
Tracking And Using The Mouse Location
I am trying to track the movement of the mouse, store it in a varible, then use that value to affect the scale of another movie clip. So far I've made a draggable movie clip, locked it to the mouse center and used it's location to put into the varible. Everytime I try to use the varible on the scale of the other movie clip, nothing happens. It seems like the varible is not updating as the location of the mouse changes or something.
TIA
Tracking Mouse Clicks
Is there a way that I can track what the user has clicked on?
I have a form and want it to go the last button that the user had pressed, after the form is submitted
Mouse Tracking Line
I need to know how to make it so that a line is drawn to follow where my mouse goes
i'm using the standard startDrag tracker script to track mouse but do not know where to go from there
help appreciated
thanx
Mouse Tracking End Of Line
How do I make a line that stretches to where ever I am pointing my mouse?
The start of the line is static, and the end of the line streatches to where my mouse is.
Mouse Co-ordinate Tracking
Ok here is the thing. I have written a small piece of code.
Code:
this.onEnterFrame = function() {
x_txt.text = this._xmouse;
y_txt.text = this._ymouse;
};
that tracks the mouse co-ordinates. It works fine while the mouse is within the bounds of the embeded flash movie. when you move your mouse outside of the flash movie and onto any other part of the screen it stops working. Which I guess makes a little bit of sense, except that if you hold down the mouse while moving elsewhere on the screen it works just fine.
anyone come across this before or know a work around so that you can track the co-ordinates of the mouse no matter where it is on the page (and without having to hold down the mouse button)?
[edit]
Actually. Just discovered that it only tracks with the mouse down on a mac, not on a pc.
Tracking Mouse Release
Hi ppl,
I have a grid which is generated using duplicatemovieclip() function, and I am looking to track the _x,_y position using movieclip events like on(press) and on(release)
The problem here is, the on(press) event needs to be tracked on one movie clip instance and the on(release) on another.
Basically what this would mean is clicking on 'movie clip A' dragging the mouse over a couple of other movie instances in the grid and finally releasing the mouse over some 'movie clip B'.
I am unable to track the on(release) event happening at 'movie clip B'. I was wondering how this could be achieved using Actionscripting. I am attaching the .fla file to make things more clear.
Any help would be appreciated.
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.
Mouse Tracking Problem
I am creating a banner that has a horizontal scrolling menu. The scrollspeed depends on the mouseposition. (The futher away from center of banner the faster it scrolls).
Problem is that it is a ad and I want the scrolling to slow down to a set speed when the mouse is not over the banner. I can't however seem to do this. Using _xmouse to track the mouse (in my onEnterFrame event) won't work because if you move the mouse off the scene it will just keep reporting the last recorded position of the mouse.(from the last frame update).
Its important for me to be able to slow down the scroll speed when the mouse is off the banner because otherwise people are gonna go crazy over it.
Inside the banner I am using the on(rollover) and on(rollout), on the menu so I can't have a on(rollover) on(rollout) on the entire banner.
Hope this makes sense. And thanks!
Mouse Tracking On Stage
Is there a way I can track the mouse position to see if it's on the stage? Rather than use something like a movie clip to detect a onRollOver event I just need to see if the mouse is on the stage. I actually just need to detect the hit not actually the _x and _y position of the mouse.
Tracking The Mouse Position
Hey
I am using drop down menus with invisible buttons to open and close the menus. When I roll outside the canvas area (e.g. Outside the actual SWF ) sometimes the menu sticks on the open state.
Is there a way to write code for the following: If mouse is outside the canvas, close all menus?
Thanks Kindly
cytone
Mouse Tracking Question...
okay.. I'll do my best to explain this one...
I have a 3D box that I exported from Swift 3D.
In my flash movie I want to the box to rotate left or right depending on where the mouse is on the box.
The movieclip that contains the spinning box is all individual keframes ( no tween). So i guess it's going to have to play the MC backwards or forward depending on the mouse position??
*If possible I'd like it to rotate faster the further the mouse gets from the center of the box. And i'd like it to stop spinning when the mouse is not touching the box.
Now I've seen the never-ending menu effect, and I've tried to hack some of that code and use it toward accomplishing my goal, but to no avail.
Any help is appreciated. Thanks.
Tracking Movement Of Mouse
Hello all,
Here is my problem,
I am making a cursor to replace the standard arrow in a flash movie. I am using the standard :
_root.attachMovie("cursor", "cursor", -1);
_root.onMouseMove = function() {
cursor._x = _root._xmouse;
cursor._y = _root._ymouse;
updateAfterEvent();
}
Now here is the kicker...I want the cursor to be a playing movie clip, that reacts to the "fact" of the mouse moving, not where it is. An example would be "when the mouse moves, a treasure chest opens. When the mouse stops, the treasure chest closes, but from the state the treasure chest was in when the mouse last moved (ie, moving the mouse ..the chest got to half way opened, when the mouse stopped...the chest closed from that half way spot)"
this making any sense?
My train of thought took me towards making a movie clip with simple frame by frame movements:
(close to open, open to close)
on different sets of frames:
(close to open on 1 - 20,stop, open to close 30 - 50,stop)
and getting the _currentframe when movement stopped, and then playing the movie on the corresponding opposite set of frames,
but I can't get past how to set up a handler for mouse movement stopping, then getting it all back to the onMouseMove.
Any suggestions on how I might tackle this?
Thank you all in advance
LaGrange
Tracking Mouse Position
hello again
I'm currently doing a site where I use a sliding menu which drops down from the top via a hit test. This is working perfectly with one exception. It your mouse goes outside the stage area at the top of the browser the sliding menu starts to bounce up and down as it would appear that flash still thinks it's within the stage. Does anyone have a suggestion for this ?
I was going to attach the file so you can see what I mean but the 72kb limit wont allow me to. I can email it to anyone who needs to look at it.
cheers
Tracking Mouse Position
hello again
I'm currently doing a site where I use a sliding menu which drops down from the top via a hit test. This is working perfectly with one exception. It your mouse goes outside the stage area at the top of the browser the sliding menu starts to bounce up and down as it would appear that flash still thinks it's within the stage. Does anyone have a suggestion for this ?
I was going to attach the file so you can see what I mean but the 72kb limit wont allow me to. I can email it to anyone who needs to look at it.
cheers
Tracking Mouse Position
hi,
I know this is a pretty simple technique, but I couldn't find a tutorial that does this exactly (they were often more complicated). Have a loot at: http://choppingblock.com/
Look at the TV on the bottom right corner, and there is this thing that follows the mouse next to the sub menus. Can someone show me how it's done or perfaps point me to a tutorial? (btw, I've already tried flash kit)
thanks in advance
Al
Mouse Tracking In HTML From Flash
Hello All,
I built a Flash Movie for navigating HTML pages. I have a rollover Icon that triggers a menu to open in a different location. I use mouse tracking to control animations in the menu. But when the mouse is quickly moved off the Flash movie onto the HTML frame, Flash doesn't realize the cursor has moved and reports no change in the coordinate varible. So the movie sort of hangs where the user left it when roaming around in the HTML links. Using a button didnt work for my purposes where the roll out would have been very helpful here.
Any possible solutions? Any help would be appreciated. thank you!!!!!
Tracking Mouse For Drop Down Menu
I am trying to create a drop down menu without using a empty button. What I would like to do is some how find out when my cursor is off of my movieclip and then go to the frame that will shut the menu. Any help would be appreciated. Thanks Mike
Mouse Tracking/ Pattern Recognition
Is it possible to use actionscript to recognize mouse movements and act on them? I'm thinking of an interface similar to one I read about in a game called Black and White, in which the user moves his mouse in a predefined pattern/shape and the computer recognizes that and triggers something. Can anyone help?
Thanks.
Help: Mouse Movement Tracking Issue
Hi all,
I'm having an issue with a dock-style menu I'm working on. The code I've found came from a Flashkit tutorial and it seems to work quite well, however I would like to modify it slightly.
The mouse interacts with the menu as it is moved around the stage. I am trying to limit this interaction to a certain section, as I don't want the menu to be effected when the mouse is moving somewhere else.
It's a little hard to explain, so I've attached the fla I'm working on. I have added a red rectange which I'm trying to limit the mouse interaction within.
The menu system would be used within an interface, so it would look strange if the button animated when the mouse was nowhere near them...
Following is the code used on each button (movieClip containing a button):
code: onClipEvent (enterFrame)
{
Mouse = _xmouse;
if (Mouse<0) {
Mouse = -1*Mouse;
}
scale = 180-Mouse;
if (scale<100) {
scale = 100;
}
if (scale>180) {
scale = 180;
}
setProperty ("", _xscale, scale);
setProperty ("", _yscale, scale);
}
I would really appreciate it if someone could provide some advice on this.
NOTE: I should also point out, the fla is saved in MX 2004 format, but I am exporting to Flash 5, so I think that makes it appropriate for this thread?
Thanks.
Tracking Mouse LAST Vertical Move?
Hi all,
I've got some functions which monitores the coordinates when the mouse is pressed and the coordinates when the mouse is released.
That is you can now press the mouse button and you'll get a coordinate - releasing it will give you another coordinate. Start and end coordinates sort of speak.
You can also press the mouse button (hold it down) and move the mouse up and down several times, release it and then get the ending coordinate.
BUT I would like to retrieve the LAST movement where the mouse moves in a negative direction (up). Is this possible and if so how is it done?
In short: I press the button getting a starting coordinate. I move the mouse down and up and down and up and down and up - THEN I release the mouse button and get the last coordinates (being my last down-up movement in coordinates x1,y1,x2,y2).
Cheers for ANY help - I've tried this for the last week or so - but have almost given up.
Mads
Mouse Tracking Eyeball With A Little Glitch
I've been studying trig functions and other mouse following tutorials in an attempt to make an eyeball that follows the mouse while keeping the eye pupil within the boundaries of the larger oval eye white. I've almost got it working but theres still a little "glitch" I can't get past. If I put the mouse cursor in just the right spot to the upper left, upper right, lower left, or lower right of the eye white, the eye pupil manages to slowly creep past the "mathematical boundaries" of the eye white.
I've included a copy of the code so far for my eyeball class. I have a feeling the problem may be in the use of my "if" and "else" logic.
The EyeBallClass is my Document class and is built from seperate EyePupilClass and EyeWhiteClass objects.
which are just movie clip objects linked to custom ActionScript classes. My goal is to create this Dynamically Animated EyeBallClass using nothing but
Object Oriented programming with nothing at all being placed on the timeline.
Below is the code for my almost functional EyeBallClass so far. I hope the ideas are beneficial and I hope even more that someone out there could help me crack it's final remaining glitch. Or just show me an entirely different way that's 10 times more efficient...............
package {
import flash.display.MovieClip;
import flash.events.Event;
public class EyeBallClass extends MovieClip {
private var eye_pupil:EyePupilClass = new EyePupilClass();
private var eye_white:EyeWhiteClass = new EyeWhiteClass();
private var speed:Number = 1;
public function EyeBallClass() {
init();
}
private function init():void {
eye_white.x = 100;
eye_white.y = 100;
eye_pupil.x = 100;
eye_pupil.y = 100;
addChild(eye_white);
addChild(eye_pupil);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(event:Event):void
{
move_eye_pupil(eye_pupil);
}
public function move_eye_pupil(eye_pupil:EyePupilClass):void
{
var dx:Number = mouseX - eye_pupil.x;
var dy:Number = mouseY - eye_pupil.y;
var eye_white_dx:Number = mouseX - eye_white.x;
var eye_white_dy:Number = mouseY - eye_white.y;
var following_angle:Number = Math.atan2(dy, dx);
var eye_white_angle:Number = Math.atan2(eye_white_dy, eye_white_dx);
var eye_white_x_boundary:Number = this.eye_white.x + (this.eye_white.width / 2 * Math.cos(eye_white_angle));
var eye_white_y_boundary:Number = this.eye_white.y + (this.eye_white.height / 2 * Math.sin(eye_white_angle));
var eye_pupil_left_side:Number = this.eye_pupil.x - this.eye_pupil.width / 2
var eye_pupil_right_side:Number = this.eye_pupil.x + this.eye_pupil.width / 2
var eye_pupil_top_side:Number = this.eye_pupil.y - this.eye_pupil.height / 2
var eye_pupil_bottom_side:Number = this.eye_pupil.y + this.eye_pupil.height / 2
var vx:Number = Math.cos(following_angle) * speed;
var vy:Number = Math.sin(following_angle) * speed;
x_pupil_movement(eye_pupil_left_side,vx,eye_white_ x_boundary,eye_pupil_right_side);
y_pupil_movement(eye_pupil_top_side,vy,eye_white_y _boundary,eye_pupil_bottom_side);
}
private function x_pupil_movement(eye_pupil_left_side:Number,vx:Num ber,eye_white_x_boundary:Number,eye_pupil_right_si de:Number):void
{
if(eye_pupil_left_side > eye_white_x_boundary)
{
eye_pupil.x += vx;
}
else
{
if(eye_pupil_right_side < eye_white_x_boundary)
{
eye_pupil.x += vx;
}
}
}
private function y_pupil_movement(eye_pupil_top_side:Number,vy:Numb er,eye_white_y_boundary:Number,eye_pupil_bottom_si de:Number):void
{
if(eye_pupil_top_side > eye_white_y_boundary)
{
eye_pupil.y += vy;
}
else
{
if(eye_pupil_bottom_side < eye_white_y_boundary)
{
eye_pupil.y += vy;
}
}
}
}
}
Re: Tracking Mouse Cursor Position...
Hi,
How can I track the mouse cursor position and perform an action if the mouse moves into a defined boundary area?
I'm making a Flash banner ad and the whole ad has a button that's clickable and uses clickTag for tracking on button release, but I'd also like to have a "Click Here" button within the ad, and I want it to light up when rolled over and there are two problems with simply making another button:
1) The ad trafficking/serving people say I can't have clickTag on two buttons in one ad...
2) So I was thinking to make a second button where there's an event on rollover but no event on release, however Flash doesn't support overlapping buttons (right?)...
So tracking the mouse cursor position and performing an action if the mouse moves into the defined button area seems like the best solution.
What do you think?
Thanks for your help!
-Todd Lerner
http://www.toddlerneradvertising.com
[F8] Tracking Multiple Mouse Points
I am wondering if Flash has a method for dealing with/allowing 2 or more points (mouse cursors) to function on the same page at the same time from the same PC and the points not having mathmatic relation.
I.E. I am not trying to make a multi-touch screen like the iTouch, but allow two people to draw on the same art board at the same time with out hi-jacking the cursor from the other person.
I have a home made interactive white board that allow control over the desk-top using light(IR) pens. Thus I could have multiple pointing devices functioning at the same time. I want Flash to be able to distinguish who is who. Is this possible? or should I just be happy with what I got?
If anyone has on oppinion or knows of a resource, I would appreciate the help.
Cheers
Mark Hollas
Reserve Mouse Tracking Effect
Hi,
I'm new to the furon and was wondering it you guy could help me out?
Check out this reserve mouse tracking effect here (choose UK from menu then The Game)
http://www.atari.com/gettingup/
The image moves in the opposite direction to where you place the mouse. The other neat bit is that is slows down and remains in that position when the mouse cursor leaves the swf area.
I've almost got it I think but my version follows the mouse cursor instead of moving in the opposite direction. I've tried changing the x and y positions in the script without success.
This is this code I've currently got...
main.onEnterFrame = function() {
var xMouse = _root._xmouse;
var yMouse = _root._ymouse;
if(Math.abs(xMouse - this._x) < 1) {
this._x = xMouse;
this._y = yMouse;
} else {
this._x -= (this._x-xMouse) / 5;
this._y -= (this._y-yMouse) / 5;
}
}
Anyone know how to get the effect on the Atari website?
My scriping skils are basic so be gentle!
Cheers,
Steve
Tracking Mouse Location On A Roll Over
Quite a simple one i think (to complicated for me though!!)
i have a sprite attached to the stage (i have drawn this using the API). the sprite is 100px wide and 300px high.
my question is how do i track when the mouse is over the top 100px of the sprite and the bottom 100px of the site. leaving the middle 100px alone
if i use "..target.mouseY" that works but it tracks it all accross the stage, not just on the sprite!
will a simple mouse roll over work, with some maths tracking where the mouse is??
Thank in advance for any tips
Sam
Tracking And Drawing Mouse Movement
Once I am displaying a SWF file on the screen, how can I annotate it (using my pen with my tablet computer)? PowerPoint has this feature with the inking option.
This will be a great feature to use in SWF files to teach.
Thanks.
[F8] Vertical Menu Tracking Mouse Movement HELP
This should be very easy.
Anyone know where I can get either a template, or tutorial how to do this:
have a vertical menu. One the right side of the menu bar are the words:
home
Info
Links
and so on
to the left of that there is a graphic ">>"
and when the mouse rolls over the words, the ">>" graphic moves up and down to the same level the mouse is at. Should be easy. I have spent the last 3 hours looking on all sites for help.
HELP!
Mouse Tracking And Rotation Ponts For A Beginner
Hi there, first post on these forums.
Am trying to work out how to create a piece of actionscript for a website I am working on. A quick overview:
Navigation bar will be a man holding a lantern, the arm will be made of two separate elements, with the hand at the end holding the lantern. The idea is that the arm will track the mouse movement to light up the navigation bar.
It has been suggested to me to set rotation points that will limit the amount of rotation an element will go through to get a semi realistic arm movement.
...Unfortunately I am a COMPLETE beginner with actionscript and don't even know where to start, so input/advice/links to tutorials would be frightfully helpful!
Thanks a lot in advance,
-Matt
Tracking Mouse Motion On Window Edge
i'd like to run a flash file in full screen mode and use the mouse to zoom in and out a map. e.g. you move your mouse up to zoom in the map... but i'd like to zoom in even after the mouse reached the top edge of the screen. is there any way to track the mouse movements of the user, when the mouse on screen is at the edge of the screen / flash window? (the problem: if you try to move your mouse up and the mouse is on the upper edge, the _ymouse property stays at 0)
Need Some Help... Tracking Mouse Click + State Of Button
I don't know if I'm approaching this correctly..probably not as I can't get it work. Need some help here.
Movieclip A is playing in the foreground on the main stage, when button B(on the main stage) is clicked, it plays frame 10-15 of Movieclip A and after it played it will goes to Movieclip B. And if button C is clicked, it will check if Movieclip A or B is on the main stage, if it is it will play Frame 10-15 of MovieClip A or B depends which is on the foreground playing and after it played, it will goes to MovieCip C.. and so on..
Here is the code I tried..
Advice: Mouse Movement Tracking Issue
Hi all,
I'm having an issue with a dock-style menu I'm working on. The code I've found came from Flashkit and it seems to work quite well, however I would like to modify it slightly.
The mouse interacts with the menu as it is moved around the stage. I am trying to limit this interaction to a certain section, as I don't want the menu to be effected when the mouse is moving somewhere else.
It's a little hard to explain, so I've attached the fla I'm working on. I have added a red rectange which I'm trying to limit the mouse interaction within
The script for each movieClip that causes the interaction is as follows:
ActionScript Code:
onClipEvent (enterFrame){ Mouse = _xmouse; if (Mouse<0) { Mouse = -1*Mouse; } scale = 180-Mouse; if (scale<100) { scale = 100; } if (scale>180) { scale = 180; } setProperty ("", _xscale, scale); setProperty ("", _yscale, scale);}
NOTE: I should also point out, the fla is saved in MX 2004 format, but I must export to Flash 5.
Could anyone provide me with some pointers on how I may achieve this?
Cheers.
Need Some Help... Tracking Mouse Click + State Of Button
I don't know if I'm approaching this correctly..probably not as I can't get it work. Need some help here.
Movieclip A is playing in the foreground on the main stage, when button B(on the main stage) is clicked, it plays frame 10-15 of Movieclip A and after it played it will goes to Movieclip B. And if button C is clicked, it will check if Movieclip A or B is on the main stage, if it is it will play Frame 10-15 of MovieClip A or B depends which is on the foreground playing and after it played, it will goes to MovieCip C.. and so on..
Here is the code I tried..
Mouse Tracking Issue - Submenu Flyouts & Timers
I found this thread (http://www.actionscript.org/forums/s...407#post215407) that partially addresses my concern, but I wasn't sure if I should post there since it was in the older ActionScript forums, and I'm using 2.0.
Basically, I'm having issues making my menus collapse if the cursor flies off the physical SWF. divarch suggested the following fix:
Code:
on (rollOver) {
clearInterval(closeInt);
_global.OpenMenu("mainmenu");
}
on (rollOut) {
closeInt = setInterval(_global.CloseMenu, 1000, "mainmenu");
}
That bit of code works just great for keeping the menus closed if the cursor flies off the SWF, but it doesn't do so hot in keeping the menu open when the cursor is on the submenu items.
Here's a rough layout of my situation. I have a button (near the edge of the SWF, thus my interest in this fix) that, when hovered, flies out a menu beneath it. That menu is a motion-tweened graphic with more buttons on it. I want to have the hover events on those buttons on the flyout to also clear the interval timer, since I don't want the menu retracting while the user's pointer is on the submenu (not the original button that expands the menu and has the successful clearInterval function).
I've tried both
Code:
_root.getInvolvedMovie.clearInterval(closeInt);
and
Code:
this._parent.clearInterval(closeInt);
but I can't seem to get the rollover event of the submenu buttons to clear the timer. I feel that I'm just referencing the function wrong, but I am new to ActionScript and so am more prone to these sort of (potentially) silly roadblocks...
Any help would be appreciated!!
Back To Basics, Tracking Mouse Coords Into An Array
Hello all,
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.
Could one of you AS gods just write out a super simple routine for this? I know I'm not the only one that needs this (as it seems to be asked every week)
Let's use the most basic drawing example I can find:
ActionScript Code:
_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;}
Where/what gets added to just capture all those _xmouse and _ymouse?
Thanks a bajillion everyone
Back To Basics, Tracking Mouse Coords Into An Array
Hello all,
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.
Could one of you AS gods just write out a super simple routine for this? I know I'm not the only one that needs this (as it seems to be asked every week)
Let's use the most basic drawing example I can find:
ActionScript Code:
_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;}
Where/what gets added to just capture all those _xmouse and _ymouse?
Thanks a bajillion everyone
Tracking And Displaying Mouse Cursors From Multiple Users On One Page
Think a multiplayer game, except this is tracking multiple mouse cursor positions on the page.
www.doodlenow.com is an excellent example of something I want to accomplish.
When a user logs on to my page, I want his mouse position to be visible to every other user on the site, and I'm not expecting more than 5 people on the site at a time.
Anyways, does anyone have any tips or tutorials or just a push in the right direction of how to accomplish this, or can provide a simple demo of even tracking one other persons mouse position?
Also, will I need any special server technology to do this? I know php and mysql will be used to track the user names and such, but other than that, tracking the actual mouse positions and displaying them to other users.....
Any help out here?
I'd really appreciate it.
Tracking "Spying" Mouse Corsur
I want to have an swf on a site when lets say 5 people are on teh website i want to be able to see where their mouse pointer is going etc. all 5 of them, but I don't want them to see each others mouse pointer.
how can this be done?
Tracking
I was wondering if anyone could supply some script that would allow an object to rotate itself to track another... Such as the little eye effect where the eyes follow you cursor, or in games where the enemy shoots at you, not just randomly. Any help is appreciated. TY
Tracking
i have a mail form on site for people to respont is there any way to track it, to find out the email address of the people who do fill it out
thanks
Tracking
I am currently developing a fully flash web site and I want to have animated transitions between pages. How, when i click to go to another 'page' or section of the animation, do i get flash to remember where it is and play an 'out page' animation before bringing in the new page?
I hope i've described what I want well enough for someone to understand what it is i want to do. I am reasonably comfortable with flash but i'm far from an expert.
Please help!
_x _y Tracking For Mc In Mcs
may i ask...
if i have a mc embedded in another mc, and then in another mc, is there any way to track the real exact x and y position of the deepest embedded mc?
say, i have _root.ball.spot
and i want to track the exact x and y position of the spot mc, even if after _root.ball has been rotated, resized, whatever...
is that possible? because i know references to _root.ball.spot._x would not change if _root.ball had been rotated or reshaped or transformed in any way.
Thanks in advance~!
|