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








Detecting Non Mouse Movement


Can anyone point me in the right direction for the code of how to detect when a user hasnt moved the mouse for a certain amount of time.

thanks




FlashKit > Flash Help > Flash ActionScript
Posted on: 10-08-2003, 09:09 AM


View Complete Forum Thread with Replies

Sponsored Links:

Detecting Mouse Movement
Hi, does anyone know code for the detection of mouse movement so that I can reset a timer when it occurs in the parent movie?

View Replies !    View Related
Detecting Mouse Movement?
Lo all,

What code would i need if i wanted to detect when the mouse has been moved?

Thanks for any help u can give me

View Replies !    View Related
<<detecting Mouse Movement>>
I have a Movie Clip which is consist of 10 frames.
I want, if the mouse moves to right side it shows the next frame,
if the mouse moves to left side it shows the previous frame
does any one know...?
how should I detect if the mouse moves to right or left?

View Replies !    View Related
Detecting Mouse Movement While Pressed
Hi All,

Im trying to make a MC to change frames (to give a rotation illusion) while the mouse is being pressed.
The thing is that it should advance one frame if the mouse is moving right and go back if the mouse is moving left. (Always while pressed)
I tried to record the mouse position to compare it but it doesn't work

Any suggestions?

Thanks

Lame code:


ActionScript Code:
interactive.addEventListener(MouseEvent.MOUSE_DOWN, rotateMC);
interactive.buttonMode = true;

var prevMouseX = mouseX;

function rotateMC(event:MouseEvent) {
    if (mouseX > prevMouseX) {
    interactive.nextFrame();
    }
    if (mouseX < prevMouseX) {
    interactive.prevFrame();
    }
}

View Replies !    View Related
Detecting Direction Of Mouse Movement
Hey everyone,
I came up with two simple functions for determining the direction the mouse is moving, and I'm wondering if you all have an easier way of doing this:
ActionScript Code:
vertical_check = function () { j = 0; v = []; this.createEmptyMovieClip("tempy", this.getNextHighestDepth()); tempy.onMouseMove = function() {  j++;  v[j] = this._ymouse;  if (j>1) {   if (v[j]>v[j-1]) {    trace("moving down");    j = 0;    v = [];   } else {    trace("moving up");    j = 0;    v = [];   }  } };};horizontal_check = function () { i = 0; h = []; this.createEmptyMovieClip("tempx", this.getNextHighestDepth()); tempx.onMouseMove = function() {  i++;  h[i] = this._xmouse;  if (i>1) {   if (h[i]>h[i-1]) {    trace("moving right");    i = 0;    h = [];   } else {    trace("moving left");    i = 0;    h = [];   }  } };};horizontal_check();vertical_check();

This isn't necessarily a bug fix, for my above code works. It just seems too complicated for something so simple. I'm planning on making this into a quick tutorial, so be warned that I may use your suggestions (with credit) in my writeup

Thanks!
Kirupa

View Replies !    View Related
Detecting Mouse Movement Outside A Flash Movie
Hi all,
Does anyone know if it's possible to detect mouse movement outside a flash movie. Basically, I want a cube to rotate within a flash movie depending on the mouse movement from anywhere within the browser window.

Any suggestions would be much appreciated.
Thanks!

View Replies !    View Related
Detecting Mouse Movement In Transparent Stage
Hello,

I have a flash movie that detects and points to the mouse position (it's a compass sitting on a table). It works fine as long as the rest of the stage is clear, the problem is when it is embedded into a html file - when the mouse is on areas of text, a box or anything other than the swf itself.

I've tried two options -
the .swf is the top layer, with the whole stage being transparent except for the pointing object itself (so it can show the rest of the html underneath) - in this case the mouse is detected only on the opaque area (i.e., the little pointing object).
the .swf is the background layer (as explained here) - in this case the mouse is not detected in the areas of the html menu and html text body block that are (in a layer) on top of it.
The problem seems to be that transparent areas (in option 1) and/or covered areas (option 2) are not part of the stage's scope. Currently, my compass registers to the stage to "listen" to events, is there another way to get mouse position events, outside the scope of the stage?

Or is there any other solution to this problem?

Thanks

View Replies !    View Related
Detecting Mouse Movement/creating 360 Degree Rotating Objects
Hello, I have created a 360 degree image rotator in flash using AS3 but i am having a few problems getting it to function exactly how i want.

I have basically copied most of the functionality of the 360 rotator on the Dune shoe website - http://www.dune.co.uk/catalogue/styl...08MLE00MSS026L.

My effort is - http://www.fianium.com/temp/360/

The code behind the scenes is pretty simple. It takes an xml with the paths to all of the frames in the rotation, preloads them, does a little twirl to show the user that you can spin the product and then activates the MouseEvent listener and rotates the shoe based on where the mouse is. It also animates the shoe rotation if you mouse out at a particular point and then mouse back in at a different one. This is to avoid the ugly 'jump' in frames.

Here is the code that handles the mouse detection/image rotation/animation:


ActionScript Code:
function CheckDirection(e:MouseEvent):void {
   
    prevX = curX;
    curX = Math.floor(stage.mouseX/(stage.width/17) ) ;
   
    if ( curX == 16 ) {
        curX = 0;
    }

    if ( ( Math.abs(curX - prevX) > 3 ) && ( Math.abs(curX - prevX) < 15 ) ) {
        ImgRotate(curX, prevX);
    } else {
        ShowImage(curX);
    }

}

function ShowImage(curPosition:int):void {
   
    container.getChildAt(curPosition).alpha = 1;
   
    for (i = 15; i >= 0; i--) {
        if ( curPosition != i ) {
            container.getChildAt(i).alpha = 0;
        }
    }
   
}

function ImgRotate(curX:int, prevX:int):void {

    j = prevX;
   
    var duration = Math.abs(curX - prevX);
   
    stage.removeEventListener(MouseEvent.MOUSE_MOVE, CheckDirection);

    var animTimer = new Timer(5, duration);
    animTimer.addEventListener(TimerEvent.TIMER, AnimRotate);
    animTimer.addEventListener(TimerEvent.TIMER_COMPLETE, FreeRotate);
    animTimer.start();
   
}

function AnimRotate(event:TimerEvent):void {
   
    if ( curX > prevX ) {
       
        if ( j == 16 ) {
            j = 0;
        }
       
        j++;
       
    } else {

        if (j < 0) {
            j = 15;
        }
       
        j--;
    }
   
    ShowImage(j);
   
}

The main difference between my effort and the dune one is their behaviour at fast mouse 'speeds'. Waving your mousecursor over the dune rotator just results in a shoe the moves about quite fast. It's important to note that the dune rotator also has some animation to show the inbetween frames if you mouse out and in at different locations. Also, the dune creation has 23 frames (i think) whereas mine only has 15.

When the mouse is moved quickly over mine, it goes a bit crazy due to the inbetween animations and because it is unable to register where the mouse has been at times.

Is there a way to increase flash's 'sampling rate' of the cursor position and if not, what can i do to make my rotator behave more like the dune one?

Thanks in advance!

View Replies !    View Related
Detecting Movement Of An Mc
Hello,

I have a mc that moves into place when the movie starts. The mc's name is 'longBar'.


PHP Code:



onClipEvent (enterFrame) {
    currentlocx = this._x;
    currentlocy = this._y;
    differencex = locationx - currentlocx;
    differencey = locationy - currentlocy;
    accelx = differencex/14;
    accely = differencey/14;
    this._x = this._x + accelx;
    this._y = this._y + accely;
}
onClipEvent (load) {
    locationx = 50;
    locationy = 23;
}




When a button is pressed, the mc starts moving. I have the following on the button:


PHP Code:



on (release) {
    _root.longBar.locationx = -2460;
    _root.longBar.locationy = 23;
}




I would like to have a separate mc start playing once the mc 'longBar' stops moving. Would this be possible?

Any help or advice would be great! Thanks!

View Replies !    View Related
Detecting End Of Movement
Hello.

I have an mc that moves into position after a button is pressed. I would like a seperate mc start playing after the moving mc stops. Can someone help me in how this can be achieved? I have attached a sample .fla file that has the parts that are needed.The file was over the allowed limit so I have uploaded it here:

http://www.mediafire.com/?1czgd374mxa

I would like the mc 'red' start playing after the mc 'longBar' stops moving. The mc 'longBar' starts moving after the gray square button is pressed.

Thanks in advance!

Kei

View Replies !    View Related
Mouse-movement Triggers Background Movement - Help Me Find Tutorial
I want to learn how to make an image react on my mouse-movement, so you get the effect as if you're looking around. You move the mouse to the right, and the image on the screen moves to the right, etc. I've seen an example of that on http://www.center-of-the-world.com/ - but I don't know how to find a tutorial for that on the Flashkit-site. Can anyone help?

View Replies !    View Related
Detecting When MC Movement Has Stopped
Hello,
I have a few concepts that rely on the ablility to detect when a movie clip has stopped its movement.

For example:

I have a movie clip that scrolls on button click, to a location along its length and then slowly stops in its new _x position. I need to know how to detect when it has stopped its movement so I may then load new content and text clips, thus allowing for a smoother less CPU intensive operation.

Also, for another project I need to define an _x or _y position that is not absolute. I want to say something like:

if (_root.clip._x == -200){
gotoAndPlay (5);
}else{
gotoAndPlay ("loop"){
}

Where -200 is a range between -200 and -150
How do you define a range in actionscript??

Please, if can help, do.

Thanks my FK family..

View Replies !    View Related
Detecting No Movement In Screensaver
Hello,

I wonder if you could help me?

I am producing a screensaver and have 3 section which dynamically display the latest financial news, company news and other stuff.

The problem is that all 3 sections are static (which defeats the purpose of a screensaver). I have a save screen button which displays an animation, but this is not very practical.

I wonder if there is a way to detect no mouse movement in Flash 5, say if nothing happens for 5 minutes then the animation kicks in.

Many thanks in advance.

View Replies !    View Related
AS Movement - Detecting Completion?
I have a movie clip on the main timelinewhich moves smoothly to different _x and _y coords according to which button gets pressed. The movement is AS controlled, rather than tweened. I need to detect when the clip has arrived at the specified coords in order to activate a loadMovie action.

The movement is specified by the following script:

onClipEvent (enterFrame) {

Xsquare = _root.plan._x;

Xdiff = Xpos-Xsquare;

Xmove = Xdiff/3;

_root.plan._x = Xsquare+Xmove;

Ysquare = _root.plan._y;

Ydiff = Ypos-Ysquare;

Ymove = Ydiff/3;

_root.plan._y = Ysquare+Ymove;

updateAfterEvent(enterFrame);

}

View Replies !    View Related
Detecting MovieClip Movement
I can start, and i can stop a drag, is there anyway to actually tell if the user IS dragging?

it would prolly code it like this:

var $mcListener:Object = new Object;
$mcListener.onDrag||$mcListener.onMove = function(){trace(this._name " is moving");}
my_mc.addListener($mcListener);

Any ideas?

View Replies !    View Related
Capturing Mouse Movement/locking Out A Direction Of Movement
does anyone have a good solution in AS 2 for simulating horizontal and vertical finger gestures like on an iPhone?

I have a Mouse listener that calculates movement in both directions and whichever one is larger in value (primary movement of mouse) then it locks out the other using a boolean value. And then once the mouseUp event is triggered, it sets the values to true again to listen for another horizontal or vertical gesture movement.

the problem I'm running into is that every once in awhile while I'm "gesturing" or moving the mouse in a particular direction, I'll get some funky results which clues me into that the other direction might not being totally locked out.

Make any sense?

View Replies !    View Related
Detecting Boundaries For Movieclip Movement
I have a feeling there is an easy solution to this but here goes. What I am trying to do is similar to the scrolling thumbnail tutorial. I have a movieclip(box_mc) on the stage that has a nested movieclip(item_mc) which is duplicated six times. The movement of box_mc is controlled by a button event along the x axis.

When the prev_btn is clicked, box_mc keeps moving along the x axis into oblivion. I want the clip to stop animating when the xMin of the box_mc reachs 0, or at least close to it. I am using xMin because I want to use the same theory for xMax with the next_btn. I have tried many options, defining boundaries, disabling buttons, and hitAreas/hitTests. Maybe I need to use a listener? If anyone can help I would be greatly appreciative.
I'm always on yahoo messenger and always open to bounce AS with anyone. Drop me a line. mailto:syl_nt@yahoo.com

Here is my code and I have included a link to the fla.

http://www.justin-tucker.com/dev/tester.fla

//create function that defines variable and duplicates item_mc 6
// times within box_mc and space them 10px apart from each other
function attachBox(){
var spacing:Number = box_mc._width + 10;
var numberOfButtons:Number = 6;
var i:Number = -1;

while (++i < numberOfButtons){
var name:String = "item" + i;
box_mc.item_mc.duplicateMovieClip(name,i);
box_mc[name]._x = i * spacing;
box_mc[name]._y = 0;
}
}

attachBox();

//create a function that moves box_mc on button press
next_btn.onRelease = function() {
box_mc._x -= 30;
trace(box_mc._x);
}

prev_btn.onRelease = function() {
box_mc._x += 30;
trace(box_mc._x);
}

//get the bounds of the of box_mx
var b = box_mc.getBounds(_root);
var bM:Number = b.xMin;
trace(bM);

if(bM <= 10) {
trace("work");
prev_btn.enabled = false;
bM = 10;
}

View Replies !    View Related
Flowing Mc Movement Opposite Of Mouse Movement
I have a mc (fStrip) which looks like a piece of filmstrip with thumbnail images in it. I want this mc to move when the users mouse is positioned over it, but I only want it to move only along it's x-axis and in a direction opposite that of the mouse. And I want it to move or flow smoothly.

I've been trying to figure this out (see my lame attempt below) but without much luck. Can anyone help me out? Thanks.


onClipEvent (mouseMove) {
buffer=20 //movement buffer
mousePos=_root.fStrip._xmouse //store mouse position
if (mymouse!=_root.fStrip._xmouse){ //if the mouse has moved
diff=mymouse-_root.fStrip._xmouse; //find amount of movement
_root.fStrip._x-=diff/buffer; //buffer & set strips movement
updateAfterEvent(); //adding this makes the movement cleaner
}
}

View Replies !    View Related
Image Movement Based On Mouse Movement
I have my Flash canvas. In the Canvas I have an image that's centered and larger than the canvas. Obviously the entire image isn't shown. How can I use actionscript to move the image according to where the mouse is? So if I move my mouse to the top right corner I want the image to move accordingly to display the top-right corner (obviously in a smooth fashion . I tried looking for examples but wanted to know if anybody out there new.

Any ideas?

Little help and thanks in advance!
Brian

View Replies !    View Related
Object Movement Based On Mouse Movement
Not sure how to word this but. I have a object on the stage lets say that is 300 pixels wide. The actual stage is only 100px wide. I want to be able to "pan" the object left and right based on mouse position/movement. I saw a tutorial for it a while back but cant seem to find it. Anyone have a link to a tut or can throw out a little source code? It would be greatly appreciated.

View Replies !    View Related
Scroller That Moves According To Mouse Movement Not Mouse Location.
I am trying to recreate the effect seen here:

Express Top Ten

alright here's the request:

I have found many scroller tutes most of which use buttons to control them. What I need or think I need is a tute or file to refer to, that uses a mouseover effect to move the movieclip with respect to how much the mouse has moved and still uses easing.

I have found files that make the movieclip move according to the mouse position on the stage, but i need it to move in according to how far it just moved.

feel free to email me with any questions.

thanks in advance,
chris
email me

View Replies !    View Related
Detecting Mouse
I know this is simple...how would I make a movieclip detect the mouse when they collide?

View Replies !    View Related
[CS3] Detecting Mc On Mouse Over
Hey intelligent Flash developers,

I am trying to be efficient with my code but I need some help!

I have a world map with about 170 individual movie clips on the stage, each one a country. Here is the code I am using for EACH movie clip:

NZ.onRollOver = function() {
whichcountry = "NZ";
getcountry();
overcolor();
};

NZ.onRollOut = function() {
hideTip();
getcolor();
};

NZ.onDragOut = function() {
hideTip();
getcolor();
};

So if I copied and pasted this code 170 times you can imagine the mess I would have! and what a nightmare to add/remove things.

Is there some way to track the mouse movement, on the stage, and when over a movie clip, detect the movie clip name? so I can use a short function for this...

I have played with hitTest but still havn't cracked it.

Thoughts?

View Replies !    View Related
Detecting Mouse Outside Of SWF?
Im having a problem with some rollover code im using for a movieClip, basically if the mouse runs over to fast the rollover animation is played but not the rollout as the mouse has left the SWF area. Is there anyway of telling where the mouse is on the screen so i can run a check to see if its in the swf or not and then run code accordingly. That make sense?

Cheers.

View Replies !    View Related
Detecting Mouse Over?
How do I detect if the mouse is over a button?

View Replies !    View Related
Detecting If Mouse Is Over.
Hi

I´m creating a flash projector that opens some other projectors with the fscommand exec command.

Is there a way of detecting when the mouse is over one or another to change some values of variables?

View Replies !    View Related
Detecting If Mouse Is Offstage.
Hello, all.

Is there a way to detect if the mouse position is outside the "Flash" area so as to trigger a switch?

Cheers.

View Replies !    View Related
Help On Detecting Mouse Location
I have a movie that is 760pxl by 100pxl. I need to be able to determine if the mouse cursor is within this specific area. If it is not, then unload specific movies on specified levels. What kind of actionscript is involved? What do I need to do here?

Please help...

Thanks.

View Replies !    View Related
Detecting No Mouse Activity - How To Do It?
I have a CD-ROM that will be played at a kiosk at a tradeshow. What I want to do is, when there are no users on the kiosk, I want my program to revert back to a slide show movie clip. How do I detect no mouse activity? Thanks!

View Replies !    View Related
Detecting Right Mouse Click
I need to be able to detect when the user has clicked the right mouse button. Any ideas?

JiL

View Replies !    View Related
Mouse Detecting Button
I've seen this type of thing done before on other site, and I'm curious as to know if anyone might know how to do it? I want to have a button that's moving slightly when there's no mouse over it, but when the mouse moves over it, the button reacts. Now, I don't mean that it just calls a MC with some different movement, I mean that it starts to move with fluid motion, then when the mouse is not over it again, goes back to its original state, fluidly. I know how to create a rollover MC, but when I move the mouse away, it abruptly goes back to the original state. Does someone out there think they might be able to help?

View Replies !    View Related
Detecting Mouse Angel
I'm making the classic alien shooting game where a canon i the middle have to shoot invading aliens from the sky. The canon has to point in the directions of the curser but I just can't figure out how to do that (I've spent 5 hours now!!!)

Here's the script I'm trying to use:

onClipEvent (mouseMove) {
curserPos = new Object();
curserPos.x = _root._xmouse;
curserPos.y = _root._ymouse;
this.globalToLocal(curserPos);
myRadians = Math.atan(curserPos.y / curserPos.x);
myDegrees = myRadians * 180/Math.PI;
setProperty(this, _rotation, myDegrees);
}

(those are the actions for the canon movie)
The canon is just acting crasy (spinning around madly) when I'm moving the curser.
Why isn't this working, please help!

View Replies !    View Related
Detecting Mouse Position
What I want to do is detect my _ymouse position so that if it's great than y:470 gotoAndPlay a MC.

can I do this?

View Replies !    View Related
Detecting The Mouse Being Pressed
hey, this is probably something very simple, BUT!

im working on something and i want to get the movie detecting the mouse to be down.

on (press) {
_root.cop1._x += 1;
show_x = _root.cop1._x;
}

this is the script for the button at the moment, but i want "cop1" to continue moving when the mouse is down and not only moving 1 point every mouse click.

can you help?

View Replies !    View Related
Detecting Mouse Position
Can someone help me with detecting the mouse position: x and y cordinates.
I just want some input text that shows the position of the cursor in the movie...not relative to a movie clip or anything complicated like that. Just how to display the mouse cordinates.

Thanx

View Replies !    View Related
Detecting Right Mouse Click
Hello there:

I have a problem in detecting the right mouse button click??
so pls if u have answers tell me
thanks

View Replies !    View Related
Detecting Right Mouse Click
Hi

how can i detect the click of the right mouse button

View Replies !    View Related
Detecting Mouse Direction
Could some one give me a nice simple bit of code that i could use to work out the direction that the mouse is going in, some sort of speed would be good 2 but that isnt nessasery. got any ideas of how i can do this??

View Replies !    View Related
Detecting If Mouse Is Outside Stage
Is there anyway to detect if the mouse is outside the stage area?

I have been using the _xmouse and _ymouse coordinates to do this, but have noticed that if you move the mouse too fast it doesn't detect that its moved outside the stage area when the file is in a web page.

View Replies !    View Related
Detecting Mouse Angle
how do i find the mouse coodinates so that i can create a line to shoot a bullt from my hero to the mouse position when i clicked.

View Replies !    View Related
Please Help Detecting Mouse Speed
Hello!

Please could somebody help me out on this:

I want to detect the speed the user is moving the mouse.
If the mouse is still I want my soundclip to pause.
If the mouse is moving at a fast speed I want my soundclip to play louder.
If the mouse is moving at a slow speed I want my soundclip to play quieter.

How would I go about doing this?

Any fla files would be great! I have flash mx pro 7.2

Thanks
Sinem

View Replies !    View Related
Please Help Detecting Mouse Speed
Hello!

Please could somebody help me out on this:

I want to detect the speed the user is moving the mouse.
If the mouse is still I want my soundclip to pause.
If the mouse is moving at a fast speed I want my soundclip to play louder.
If the mouse is moving at a slow speed I want my soundclip to play quieter.

How would I go about doing this?

Any fla files would be great! I have flash mx pro 7.2

Thanks
Sinem

View Replies !    View Related
[F8] Detecting Mouse Speed
I have simple button that makes a character rises from the ground on rollover and sink back down into the ground on rollout. It works great if the user slowly puts the mouse over the button and then rolls off. But if the user quickly slides across the screen, and touches that button for a split second, the rollover action doesnt have time to get activated but the rollout action does, so it looks odd that the person suddenly appears and then shrinks.

The only thing I can think of is to tell it to only do the rollover and rollout actions if the user is moving the mouse slowly. How is this done?

thanks,
~Dan

View Replies !    View Related
[CS3] Detecting Mouse Direction
hello - just wanted a bit of help with a mouse direction problem i've run into. just trying to use the simplest way to detect the mouse direction based on "oldMouse" and "newMouse" variables getting passed the _xmouse value.

so essentially, the newMouse value would be always be the current _xmouse value and the oldMouse value would always be the previous _xmouse value.

...would like to do this with onEnterFrame or with setInterval.

Cheers!

View Replies !    View Related
Detecting Mouse Over Behind Mask
I'm having trouble detecting mouse events on movie clips behind a mask. I remember coming across this problem in the past, but can't remember the solution. Any ideas?

Thanks in advance for any suggestions...

View Replies !    View Related
Detecting Mouse Angle
Hi
Can anyone teach me how to detect mouse angles? instructions including the coding and what should be on my stage?

Thanks!

View Replies !    View Related
Detecting If Mouse Is Outside Frame
Is there anyway to detect if the mouse is outside the stage area?

I have been using the _xmouse and _ymouse coordinates to do this, but have noticed that if you move the mouse too fast it doesn't detect that its moved outside the stage area.

View Replies !    View Related
Detecting Mouse Direction
Hey, I'm having a problem when detecting the direction of the mouse.

I'm using the following script:


Code:
stop();
//
var old_x:Number = this._xmouse;
var old_y:Number = this._ymouse;
//
function getDir():Void {
var new_x:Number = this._xmouse;
var new_y:Number = this._ymouse;
new_x > old_x ? trace("moving right") : trace("moving left");
new_y > old_y ? trace("moving down") : trace("moving up");
old_x = new_x;
old_y = new_y;
}
//
this.onMouseMove = getDir;
But for some reason I'm not getting any output. Any help would be much appreciated.

Thanks.

View Replies !    View Related
Detecting Mouse Bumps
I'm trying to detect a mouse motion thats intentional instead of an accidental bump. So, I have a function that detects if the mouse moves 10 pixels and displays a simple circle, and on click of the circle I want it to disappear, yet the circle still appears.

Why is it on click of circle, I still get values for x and y and sometimes it resets to 0 and 0?

Any ideas would be appreciated.


circle._visible = false;
var active = true;
var xChange:Number = 0;
var yChange:Number = 0;
//
function mouseSpeed() {
//circle._visible = false;
xChange = 0;
yChange = 0;
xChange = Math.abs((_root._xmouse-xMouse));
yChange = Math.abs((_root._ymouse-yMouse));
xMouse = _root._xmouse;
yMouse = _root._ymouse;
trace(xChange+" "+yChange);
if (xChange>10) {
if (active) {
clearInterval(intervalId);
circle._visible = true;
trace("clear Interval");
active = false;
xChange = 0;
yChange = 0;
}
}
if (yChange>10) {
if (active) {
clearInterval(intervalId);
circle._visible = true;
trace("clear Interval");
active = false;
xChange = 0;
yChange = 0;
}
}
}
circle.onRelease = function() {
circle._visible = false;
active = true;
beginInterval();
};
function beginInterval():Void {
xChange = 0;
yChange = 0;
trace("begin interval");
intervalId = setInterval(this, "mouseSpeed", 100);
}
beginInterval();

View Replies !    View Related
Detecting Mouse Clicks
i have some movie clips on the stage and the background of these movie clips are, of course, the stage. now, i need to detect a click on any area of the background(the stage) to do something to the movieclips above it.

What I did is, I laid a movieclip which has the same size as the stage, above the Stage and below the other movieclips. I then set this movieclip to visible = false. Next, I thought I could use onMouseDown to get the clicks but unfortunately, it isn't working because onMouseDown detects the click on anywhere I click.

I am not using onPress because I don't want to have the hand cursor appearing on the entire flash movie.

How can I do to detect mouse clicks within a movie clip, without using the onPress, which comes with the hand cursor?

thanks!

View Replies !    View Related
Detecting Mouse Click
Hey,

What I'm trying to do is very simple. I want to trigger an event handler whenever the mouse is clicked, no matter where on the stage it is clicked.

Right now, I'm using something like this:

Code:
stage.addEventListener(MouseEvent.CLICK, myEventHandler);
That works as long as the click is not on any MovieClips, but rather just the bare stage. My question is, how can I make the handler detect the click for anywhere including MovieClips rather than just the stage like it does now?

Thanks in advance!

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