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








MC Moves On MouseMove ?


Ok what im trying to do is:

I got a movieClip on the stage and i want it to scroll left if mouse moves to the right and scroll up if mouse moves down. also scroll right if mouse moves to the left, and scroll down if mouse moves up.

If any one knows a good tutorial please tell me where i can find it!!! thankyou.




FlashKit > Flash Help > Flash MX
Posted on: 09-05-2002, 03:22 PM


View Complete Forum Thread with Replies

Sponsored Links:

Flash Background Effect Moves With Cursor Moves...help?
Hey All,

I know that this may be posted elsewhere, but I don't know how you would describe it...

Anyway what I have in mind is something like... http://www.nellyfurtado.com where different layers in the background shift when a cursor moves accross the screen...

any help or links or anything would be helpful, thanks!

View Replies !    View Related
Flash Background Effect Moves With Cursor Moves...help?
Hey All,

I know that this may be posted elsewhere, but I don't know how you would describe it...

Anyway what I have in mind is something like... http://www.nellyfurtado.com where different layers in the background shift when a cursor moves accross the screen...

any help or links or anything would be helpful, thanks!

View Replies !    View Related
Image Moves When Mouse Moves?
Hi,

I'm trying to work on a code so when the mouse moves left or right, the background image on a flash movie or multiple images will scroll the opposite way. However, Ive never coded anything regarding mouse movement (that I can remember) because I'm not too fluent in using mouse listeners. Id appreciate if someone could whip up a code like this that I can learn from.

Pixel movement rate (speed) and direction control would be really nice here. Its an easy code I'm sure, I just dont know how mouse listeners work (if this is what you have to use).

Thanks in advance!

View Replies !    View Related
A Little Help With MouseMove
onClipEvent (mouseMove) {
this._alpha = this._alpha + .5;
}

now I want to tell the clip to fade when I stop moving the mouse.... how do I do it. Sorry, I'm just learning, still new. Any help will be much apprieciated. Thanks

View Replies !    View Related
MouseMove
I am trying to get a movieclip to follow the mouse on which direction it plays, the movieclip plays from right to left normally and loops twice it plays the last half over and over

code:
onClipEvent (mouseMove) {
myMouseX1 = _xmouse;
myMouseY1 = _ymouse;
if (myMouseX1 > myMouseX2 and myMouseY1> 100 and myMouseY2 <0) {
onClipEvent (mouseMove) {
myMouseX1 = _xmouse;
myMouseY1 = _ymouse;
if (myMouseX1 > myMouseX2 and myMouseY1> 100 and myMouseY2 <0) {
_root.globescroll.nextFrame();
}
if (myMouseX1 < myMouseX2 and myMouseY1>100 and myMouseY2 <0) {
_root.globescroll.prevFrame();
}
if ( myMouseY1<100 or myMouseY1>0) {
play();
}
myMouseX2 = _xmouse;
myMouseY2 = _ymouse;
}_root.globescroll.nextFrame();
}
if (myMouseX1 < myMouseX2 and myMouseY1>100 and myMouseY2 <0) {
_root.globescroll.prevFrame();
}
if ( myMouseY1<100 or myMouseY1>0) {
play();
}
myMouseX2 = _xmouse;
myMouseY2 = _ymouse;
}


i cant see any problems with the code
myMouseY figures reference the _ymouse from _root which is the top left hand corner which is normal for flash although, the movieclip with the instance globescroll is 100pixels high, so it should play while the _ymouse is between 0 and 100

View Replies !    View Related
Help On Mousemove
I have a question about making a movie clip follow the mouse.

I have this code:


Quote:




onClipEvent (mouseMove) {
_x=_root._xmouse;
_y=_root._ymouse;
updateAfterEvent();
Mouse.hide();
}




However, the clip isn't centered on the mouse. What do I need to do to get it lined up?

My second question is that I want to constrain it to a box (the movie clip is a pair of eyeballs and I basically want the eyes to follow the mouse, but not leave the sockets) and I'm wondering the best way to approach this? Should I put some if then statements that don't allow the x and y to go above a certain amount?

Thanks in advance.

View Replies !    View Related
(mouseMove) Help
HI.
i have put this code on an mc that i want to follow the cursor on a menu

onClipEvent (mouseMove){
this._y=_root._ymouse;
updateAfterEvent();
}

trouble is, i want the mc that follows the mouse to slowly follow with more of a flow. at the moment its too immediate.
is there any way i can slow it down, to flow with some kind of delay ?
please see the attached .fla
thanks

View Replies !    View Related
MouseMove Event Ignored
Hi all,

I've got a little problem. I want some action to occur only when the mouse moves. This is the code on the clip:

----------------------
onClipEvent(enterFrame){
play_clip = Math.floor(Math.random() * 65) + 1;
}

onClipEvent (mouseMove){
if (_root["mc" + play_clip].selected == 0){
_root["mc" + play_clip].gotoAndPlay(2);
}
updateAfterEvent();
}
--------------------

I worked fine but yesterday suddenly the the play_clips started to play frame 2 even when there is no mouse movement.

Does anybody know why this happens and what I can do to stop the clips from going to the second frame all by themselves?

You can test what I described here:
http://home.wanadoo.nl/d.roberts/stuff/spion.html

Because it might have something to do with my mouse generating movement that I can't controle (a lose cable or something ?)

Thanks very much for any help.

Regards, Danielle.

View Replies !    View Related
OnClipEvent( MouseMove)
How do I determine when the mouse has stopped moving?

I have this navigation see and what I would like to happen is that if the mouse has stopped moving for x amt of time to highlight the button for the page that the user is currently viewing. I am sure I can do the rest I just don't know how to detect that the mouse has stopped moving. I tried doing a search but I had no luck.

Any ideas?

Thanks very much.

View Replies !    View Related
OnClipEvent (mouseMove)
Hope someone can help, I'm using the onClipEvent (mouseMove)command to track the movement of the mouse so that my movie clip can rotate itself towards the mouse pointer.
I'm not sure if I'm missing something though but it seems that I can only use this command in the actions of the clip instance and not frame actions of the movie clip symbol itself (so I can drag on loads of them).
Is there another chunk of code I can use to get round this?
My code is as follows and works fine other than me having to paste it into every instance of the clip and change the variable names.

Cheers


onClipEvent (mouseMove) {
xpos = _parent._xmouse;
ypos = _parent._ymouse;
xclip = _root.pointer._x;
yclip = _root.pointer._y;
ydiff = ypos - yclip;
xdiff = xpos - xclip;
_parent.result = (Math.atan2(ydiff, xdiff)*(180/Math.PI));
_parent.x = xdiff;
_parent.y = ydiff;
_root.pointer._rotation = _parent.result + 90;
}

View Replies !    View Related
MouseMove / MouseUnmove?
is there a way to get something different like mouseMove?

i need to detect mouseStability. and not MouseMove ,, is there a way?

View Replies !    View Related
On MouseMove Problem
I have two scenes. The first one has a wait script on it. After it waits for a specified time it goes to the second scene which is a simple animation (to be replaced in the future with a movie file) and a clear movie clip on top which has the following script to it:

onClipEvent (mouseMove) {
gotoAndPlay("Scene 1", 1);
}

But it never detects mouse movement. Any ideas? Must be simple but I can't get it. I have attached the .fla if anyone is feeling extra helpful.

BIG Thank You!

View Replies !    View Related
Trouble With MouseMove
I am building a kind of interactive kiosk presentation that will just be sitting on a computer at a conference. When it initially starts I put an onMouseMove so that it sits at frame one until someone moves the mouse, but as soon as it starts it detects that as mouse movement. I'm not sure if I'm putting the code in the wrong place. I've tried it on the mc that is in frame one, and I've also tried puting it on frame one.

code:

_root.onMouseMove = function(){
_root.gotoAndPlay("logoFadeOut");
}

Thanks

View Replies !    View Related
MouseMove AttachMovie
ok i'm trying to attach a movie clip at runtime so it does something like this, www.blink182.com. the top when you move the mouse it attaches a ink splatter, how would i go about this because the duplicate movieClip doesn't work for that goal at all...any info at all will help i'm a quick learner

View Replies !    View Related
Ease On Mousemove?
peepz,

i've got this script to move a arrow in the direction of the mouse with a delay, but i want to have some easing on it:


Code:
onClipEvent (load) {

delay = 80;

xtarget = new Array (7)
ytarget = new Array (7)
xtarget.push(_x)
ytarget.push(_y)
}
onClipEvent (mouseMove) {
xtarget[xtarget.length] = _x
ytarget[ytarget.length] = _y
x=xtarget.shift()
y=ytarget.shift()
_rotation=(Math.atan2(y-_y,x-_x)/Math.PI)*180

x = this._x
y = this._y
_x=((this._parent._xmouse-x)/delay)+x
_y=((this._parent._ymouse-y)/delay)+y
}
can somebody tweak it up so it eases out ?

View Replies !    View Related
On(mouseMove)umWha?
Hiya,


it would be majorly cool if someone out there could tell me the script for a certain thing -

if the user doesn't move his move for 10 seconds, Id like this and this to happen...

like (and forgive my script jokery)

on(mouseDoesntMovefor10Seconds){
_root.holder.bla.gotoAndPlay("gogogo");
}

View Replies !    View Related
[F8] Need Immediate Help: MouseMove Or HitArea(?)
Hi! I'm having MAJOR difficulties getting my pullout tabs to work correctly. Mainly (now) on the "roll back in" animation. Here's what I want it to do:

When the user click the "learn more" tab it will pull out, this tab is a movie clip which houses another movie clip which has three buttons inside of it. Currently I'm using a button on the exposed tab area (when it's pulled in) to do the pullout animation (and display the buttons inside the clip(s)). So I'm using "on(press)...etc" in the pullouts movie.
My problem is that I can't get on(rollOut, dragOut) to work on frame 25 of the clip(when it's stopped so the user can click the buttons) to pull it back in because then the buttons become inactive. I've tried looking up different methods and found references to using the onClipEvent using a defined hitArea but could NOT get this to work correctly, and I don't understand the whole "mouseMove" idea.
I need to get this figured out ASAP!!!
...and I really can't recode it so i have to find a way for this to work without recoding everything else. Any ideas?

(if you'd like to see the file please email me at stellagifford@gmail.com)

I'LL BE GRATEFUL FOR ANY HELP AT ALL!

View Replies !    View Related
MouseMove Problem...
I've revamped some code I found on the web to look like this:

onClipEvent (mouseMove) {
x=this._xmouse;
y=this._ymouse*-1;
angle = Math.atan(y/x)/(Math.PI/180);
if(x<0){angle+=180}
if(x>=0&&y<0){angle+=359}
framenumber = Math.round(angle)
gotonumber = angle+1
this.arrow._rotation=framenumber*-1;
updateAfterEvent();}

This determines the mouse angle, and rotates an arrow around a "donut" that I created. This 'donut' is going to act as a 360 degree navigational tool. Therefore, I only want it to function while directly over the movie clip. No matter the size of my movie clip, it operates while on any portion of the stage.

Question: Can I limit the mouse detection operation of this movie clip to occur only when the mouse is within the limits of the actual movie clip?

Thank you in advance!!!

View Replies !    View Related
[CS3] MouseMove Problem...HELP
Hello,

I have a panning movieclip (Main_mc) that reacts on MouseMove.

Inside Main_mc is a movie clip with a button (btn_A).

I want Main_mc to move when I rollover btn_A (it already works)

but since my mouse is still over Main_mc, when I roll-over btn_A, Main-mc will move to a specific location but right after it will shift because the
on MouseMove panning script on the main timeline interferes.

????

is there a way that I can disable the panning script on the main timeline as I rollover btn_A (which is inside Main_mc) and then enable on rollOut.

please help it's almost there but not quite

View Replies !    View Related
[MX6.0] Mousemove Listener Etc
Hi. I need some code that does not handle movieclips dynamically despite being good coding praxis. I am a rookie at actionscript 2 and my mission is to make a product simulation. I need to do the following:

After a mousepushdown on mcA I want the currentframe in mcB to be changed depending of the mouseposition.

I am thinking something like the following would work but it does not!

//This is put in mc A:

onClipEvent (mouseDown)

{
var onMouseMoveListener:Object = new Object();

//for

onMouseMoveListener.onMouseMove = function()
{
if (this._ymouse > 20)
{
_root.mcB.gotoAndStop (_root.mcB.currentframe + 1);
}
else (this._ymouse < 20)
{
_root.mcB.gotoAndStop(_root.mcB.currentframe - 1);
}
updateAfterEvent();
}
//I need something this to be done over and over again until I release the mousebutton. //Therefore I tried to ad something like this:
intervalID = setinterval(onMouseMoveListener.onMouseMove, infinity);
}

In mcB I put this code:

onClipEvent (mouseMove)
{
this.addListener(onMouseMove);
}

Any tips? A would very much appreciate any comments. I am new to actionscripting. I am using Macromedia Flash MX 6.0.

View Replies !    View Related
Ease On Mousemove?
peepz,

i've got this script to move a arrow in the direction of the mouse with a delay, but i want to have some easing on it:


ActionScript Code:
onClipEvent (load) { 
   
    delay = 80;
   
    xtarget = new Array (7)
    ytarget = new Array (7)
    xtarget.push(_x)
    ytarget.push(_y)
}
onClipEvent (mouseMove) {
        xtarget[xtarget.length] = _x
        ytarget[ytarget.length] = _y
        x=xtarget.shift()
        y=ytarget.shift()
        _rotation=(Math.atan2(y-_y,x-_x)/Math.PI)*180
       
        x = this._x
        y = this._y
        _x=((this._parent._xmouse-x)/delay)+x
        _y=((this._parent._ymouse-y)/delay)+y
   }

can somebody tweak it up so it eases out ?

View Replies !    View Related
Opposite Of MouseMove
Is there any way of determing whether a mouse isn't moving, something like the opposite of mouseMove?

View Replies !    View Related
MouseMove/ MouseStop?
Hi,
i just want the play head to go to the next frame when the mouse stops.
Did somebody know how i could do this?

...i don´t found an opposite to mouseMove in the As-libery...

Please help me!

greets, ohara.

View Replies !    View Related
MouseMove Navigation Bar - Can´t Stop It
hi,

i´ve got a dynamic navigation menu that moves depending
on the xy-mouse position. i use the event-handler (Mouse
MOVE). if the mouse is not over the
swf-file, the movement doesn´t stop. but it should stand still, when the mouse is outside the film.

PLEASE HELP !!

ciao
gordo

View Replies !    View Related
MouseMove Arghhhh Hihi
onClipEvent(mouseMove){
this._currentframe = _root._xmouse;
}

How do i get this clip to work, I want the MC to move when I move the the mouse.........anyone =) knows

View Replies !    View Related
OnClipEvent(mouseMove ... Over A Certain Area
i have an mc on frame one, on the main stage

i want the mc to play when the mouse rolls over it

something like:

onClipEvent (mouseMove) {
this.play();
}

how can i specify the x and y coordinates in that code? and ho wdo i get the x and y coordinates from the stage?

thanks to anyone who can help

View Replies !    View Related
Control Movieclip By Mousemove
Does anybody how to do it?
I've seen it on this page:
http://www.janvision.com/yulia/eng.htm

When you move right or left with the mouse over the movieclip, the animation goes forward or backward frames.

View Replies !    View Related
MouseMove Movieclip Visibility
I want to make a movieclip invisible when the mose is moving and visible when it stops.
Do you know how to do it?

View Replies !    View Related
Onclipevent(mousemove) Problems
Im running Flash 5.

The problem is the onclipevent(mousemove) isn't being activated when I move the mouse on the clip. I have basically created a clip placed it in the bottom layer and am trying to update a dynamic text field with the x value of the mouse.

This is the code i use:

onClipEvent (mouseMove) {
xval = _xmouse;
}

Is there something I'm missing? Known problems?

View Replies !    View Related
Null A Mousemove Function
hi guys,, i have a pencil drawing api

my intention are KILL THE DRAWING API WHEN I HIT SPACE BAR



ON CLIP EVENT

PHP Code:



on (press) {
    _root.window_mc.container_mc.clip3.container.gotoAndStop(7);    
    Mouse.hide();
    this.startDrag(1);
    _root.window_mc.container_mc.clip3.container.cap.gotoAndStop(40);    
}
//HERE I WANT TO KILL THE MOUSEMOVE FUCTION HERE
on (keyPress "<Space>") {    
// DOESNT WORK this.onMouseMove = null;
    Mouse.show();
    this.stopDrag();






DRAWING API


PHP Code:



_root.window_mc.container_mc.clip3.container.pencil_mc.swapDepths(2);

// 1. SETTING THINGS
_root.window_mc.container_mc.clip3.container.createEmptyMovieClip("line",1);

// 2. EVENTS IN _ROOT:
_root.window_mc.container_mc.clip3.container.pencil_mc.onMouseDown = function(){
    //this.quitar = null;
    line.curveTo(_xmouse,_ymouse);
    line.moveTo(_xmouse,_ymouse);
    line.lineStyle(4,0xAE001A,90);
    this.onMouseMove = function(){
        line.lineTo(_xmouse,_ymouse);
        updateAfterEvent();
    }
    
}
_root.window_mc.container_mc.clip3.container.pencil_mc.onMouseUp = function(){
    this.onMouseMove = null;
}

// 3. BUTTON "ERASE":
// --------------------
buttonErase.onPress = function(){
    _root.window_mc.container_mc.clip3.container.line.clear();
}
stop(); 





THANKS FOR ANY SUGGESTION OR HELP

View Replies !    View Related
Droptarget MouseUp MouseMove
Hi there.

After searching the forums, I still cant find an answer to this problem...

I have a drag and drop activity. I click my desired shape, and then use MouseMove to 'drag' the duplicated shape around.

Now, on MousUp, I want to check the droptarget of that clip that is following the mouse - alas, no joy.

I have a function called fCheckDropped(forWho). In there I have:
ActionScript Code:
this.myTarg = eval(forWho._droptarget)

I obviously pass the name of the clip that is dragging to that function.

That seems to work when I use press and release to move the clip, but not when using MouseMove and MouseUp. Does _droptarget only register when onRelease has been invoked?

How can I get the droptarget - without using hitTest?

Any help would be appreciated (I have a feeling I am going to have to loop and hitTest... )

View Replies !    View Related
How Can I Disable Mousemove Function
my code is

Code:
_root.onMouseMove = function() {
if(_root._xmouse <= 275){
globe.playBack();
}
if(_root._xmouse >= 650){
globe.playForward();
}
/*if (_root._xmouse>=276 && _root._xmouse <=649){
trace (_xmouse);
}*/
}
if _root._xmouse>=276 && _root._xmouse <=649
i want to disable onMouseMove function ( mouse is not playBack(); and playForward();. back to be normal mouse)
How can i do??

thanks

View Replies !    View Related
Using Mousemove To Start Animation
Hello flash masters,

I'm just a newbie here, so please be gentle.

I have a menu that slides out when the user moves the mouse to the left of the stage. Since the menu itself has to be active (to initiate the slide) and the menu items within the menu have to be active, I have the problem of a movieClip ontop of a movie clip while trying to use an (on) event for both.

So I now have a mousemove function to start the slide animation of the menu, thus leaving me free to put (on) events on the menu items. Here it is:

onMouseMove = function () {
x_pos = this._xmouse;
y_pos = this._ymouse;
if (x_pos >= 0 && x_pos <= 200 && y_pos >= 0 && y_pos <= 768) {
mcNavBar.slideTo(90, null, 1, Strong.easeIn);
mcNavBar.mcNavBarArrowStrip.alphaTo(0, 1, Strong.easeIn);
mcNavBar.NavHLine1.slideTo(-70, null, 1, Strong.easeIn);
mcNavBar.NavHLine2.slideTo(-70, null, 1, Strong.easeIn);
mcNavBar.NavHLine3.slideTo(-70, null, 1, Strong.easeIn);
mcNavBar.NavHLine4.slideTo(-70, null, 1, Strong.easeIn);
NavG1.slideTo(23, null, 1, Strong.easeIn);
NavG2.slideTo(23, null, 1, Strong.easeIn);
NavG3.slideTo(23, null, 1, Strong.easeIn);
NavG4.slideTo(23, null, 1, Strong.easeIn);
}
else{
mcNavBar.slideTo(-70, null, 1, Strong.easeIn);
mcNavBar.mcNavBarArrowStrip.alphaTo(100, 1, Strong.easeIn);
mcNavBar.NavHLine1.slideTo(120, null, 1, Strong.easeIn);
mcNavBar.NavHLine2.slideTo(120, null, 1, Strong.easeIn);
mcNavBar.NavHLine3.slideTo(120, null, 1, Strong.easeIn);
mcNavBar.NavHLine4.slideTo(120, null, 1, Strong.easeIn);
NavG1.slideTo(-137, null, 1, Strong.easeIn);
NavG2.slideTo(-137, null, 1, Strong.easeIn);
NavG3.slideTo(-137, null, 1, Strong.easeIn);
NavG4.slideTo(-137, null, 1, Strong.easeIn);
}
};

The problem lies in the mouseMove function. It all animates fine, but if I continue to move the mouse after activating the menu, it causes the animation to lag. It only works smoothly if I move the mouse into the active area and then don't move it any further until the animation is complete.

So my real question is: How can I make the mouse call the mousemove function only once so that the animation will not be interupted everytime the position of the mouse is being calculated.

I hope this makes sense

View Replies !    View Related
MouseMove Event Problem
I’m trying to make an image gallery using AS3. I have two MovieClip objects: the first with a rectangle and the second with the thumbnails. The first MovieClip is rising a MouseMove Event that makes the thumbnails’ MovieClip slide left and right.

The problem is: when the mouse moves over a thumbnail, the MouseMove Event stops rising.

Is there any way of making the event “pass through” the thumbnail?
Here is my swf file that demonstrates my problem.

Thaks

View Replies !    View Related
X Y Scaling Buttons In A MC On MouseMove
How would you go about making Buttons in side a MC size oposit the MC

Example

MC sizes when i move my mouse whic means the buttons get all distorted. (Move mouse on _xmouse scale _xscale and move _ymouse scals _yscale, how MC sizes )

This is the code for the Buttons to get resized.

if (_root.MC > 100){
BX = _root.MC_xscale - 100;
BX2 = Math.abs (BX - 100);
Button._xscale = BX2;
}else if (_root.MC < 100){
BXX = _root.MC._yscale + 100;
BXX2 = (BXX + 100);
Button._xscale = BXX2;
}else if (_root.MC = 100);
Button._xscale = 100;
}

The same goes for _yscale.

Trying to keep The origonal size of the buttons.

Thanks
MadWilson

View Replies !    View Related
Onclipevent Mousemove Jumpy
I'm trying to get a MC to move when I move my mouse, my code is:

onClipEvent (mouseMove)
{
_x=(_xmouse);
}


It works, only it's real jumpy. How can I get a smooth scroll?

View Replies !    View Related
MovieClip Triggered By MouseMove
I have a menu that I have been working on that is inside a movieClip. I want to trigger the menu to open when the mouse is in the far left hand part of the stage. The code that I have for this so far is:

leftX = 0;
topY = 0;
widthX = 10;
heightY = 600;

_root.onMouseMove = function()
{
if (this._xmouse >= leftX && this._xmouse < leftX+widthX &&
this._ymouse >= topY && this._ymouse < topY+heightY)
trace(_root.menu._currentframe);
if (_root.menu._currentframe == 30) {
stop();
}
else
{
if ( ! rolledOver ) {
menu.gotoAndPlay("open");
}
}
}

The code was working fine before I put in the trace function, but I would really like to have this so that if the menu is already open it won't go and play again.

What is happening now is if the mouse is moved just a little the code exicutes, and plays the menu MC.

Can anyone figure out a remedy for this problem?

View Replies !    View Related
Moving Background With Mousemove
Hi, I have a movie of 700*400.
I have a background image of 900*600.
I'm looking a way to move the background image attending the position of the mouse.
I want the background image moves to the LEFT when i move the mouse to RIGHT.
I want the background image moves UP when i move the mouse DOWN.
I'd also like the speed of the movement equal to the mouse movement speed...
And the most important thing is that the background has limits. It has not to go outside of the movie.

The effect I'd like to obtain is exlporing hide parts of image moving the mouse over the MC.
Please help me with a script (I'm trying to learn)

View Replies !    View Related
Item Movement On Mousemove....
sry it may sound confusing but i dont exactly know what to call this....but i want a certain item (or 2) to move when the mouse moves the opp direction


example

http://www.rollups.com.au/

hit "join later" then once it goes in....this is more or less what i want to create...the movement of the stage items when the mouse moves

any ideas

PS, sorry if this is in the wrong place

View Replies !    View Related
Function On MouseDown Or MouseMove
Okay,
First off, thanks to all you guys. You have all been great help over the days.

Question:
Can I make it so that a function runs if the mouse is down or the mouse moves. I dont know why I cannot figure this out. Once again, thanks!
Cheers.

Here is the code for reference.

Code:
onMouseDown = function () {
stopMyTimer();
unloadMovieNum(99);
alert_txt.htmlText = "";
clearInterval(wait);
count = 0;
count++;
trace(time);
}

View Replies !    View Related
Detect MouseMove After 2 Seconds
I want to detect my users mouse 2 seconds after they've clicked on a button.

How do i delay an onMouseMove event so that it will only perform an action 2 seconds after a button has been pressed?

something like this (in all caps)?

watchmouse = new Object();
watchmouse.onMouseMove = function() {
trace (_ymouse)
if (THE MOUSE MOVES 2 SECONDS AFTER A BUTTON IS PRESSED) {
delete this.onEnterFrame;
}else {
Mouse.show();
test.onEnterFrame = function() {

if (this._alpha >= 99) {
delete this.onEnterFrame;
} else {
this._alpha += 5;
}
}
}
}

Mouse.addListener(watchMouse);

View Replies !    View Related
MouseMove Movieclip Visibility
I want to make a movieclip invisible when the mose is moving and visible when it stops.
Do you know how to do it?

View Replies !    View Related
Dynamic Mc - Scrolling Based On Mousemove
I am trying to achieve a scroll effect with mouseevent . I am dynamically attaching 4 mc clips (image1,2,3,4) from the library using attachMovie and I duplicate another movie clip.



ActionScript:-------------------------
numImages = 4;
width = 200;
for (i=1; i<=numImages; i++) {
name = 'm'+i;
_root.holder.attachMovie("image"+i, name, i);
_root.holder[name]._x = i*200;
}
holder.duplicateMovieClip(image2,50);
_root.image2._y= _root.holder._y;

--------------------------------------------------------

I add this code on the mc holder which holds the 4 images scrolling


ActionScript:--------------------------------------------
onClipEvent(load){
centerPoint = 200;
switchDistance = (_width - (centerPoint*2))/2;
//trace(switchDistance);
_root.image2._y = _y;
}
onClipEvent(enterFrame){
movieBounds = this.getBounds(_root);
if( _root._xmouse <=movieBounds.xMax && _root._xmouse >=movieBounds.xMin && _root._ymouse <= movieBounds.yMax && _root._ymouse >= movieBounds.yMin)
{
//speed factor = 40
_x += (centerPoint - _root._xmouse)/100;
if (_x < -switchDistance) {
_x += _width;

}
if ((_x - _width) > -switchDistance) {
_x -= _width;

}

_root.image2._x = _x - _width;
}
}


------------------------------------------------------

I am not sure whether this method is right... also how do I test whether the duplicatemovieclip is working or not..

advacned thnx!!

View Replies !    View Related
One MouseMove Clip Event Or Multiple?
if i have a mouseMove clip event in a movie should i use it for everything or can i use a few? is it bad programming or inefficient to use more than one?

thanks!

View Replies !    View Related
Any Way To Stop Or Pause An OnClipEvent(mouseMove)?
Hi,
Is ther any way to stop or pause an onClipEvent(mouseMove)?
I need to turn it off and on again later. Is there alternate syntax I should be using? I tried to make a function within it and that didn't work. THanks in advance.

View Replies !    View Related
MouseDown, MouseMove Event Listener
Having trouble understanding AS3 event listener model. My use case is to zoom an image by clicking on it and dragging mouse up or down, aka iPhone's "pinching", but with one finger.

Here's my code that identifies the x reference of my mouse position once i click and start dragging. I have no idea how to remove the event listener since i used an inner function. Why did i use an inner function? I could not get a hold of img reference from inside mouseMove(e) function. e.target would not yield Image but results in FlexLoader object. Does this description make sense to anybody?


Code:
private function zoom(img:Image):void{
img.addEventListener(MouseEvent.MOUSE_MOVE,
function(e:MouseEvent):void{
debug.label = new String(img.mouseX);
}
);
debug.label = new String(img.mouseX);
}


<mx:Image id="img1" source="http://localhost/getImage/id={imageId}"
mouseDown="zoom(img1)"/>

View Replies !    View Related
On MouseMove Question. Simple Stuff?
okay.. so i have a movieclip that i want to play (fade in). when the mouse is moving. That part works fine. Hoever, when the mouse STOPS moving I want the movieclip to play backwards and fade out.

Basically I just need to know how to tell my movieclip that the mouse is NOT moving.

any ideas? Keep in mind i'm fairly novice and if this is going to involve a "listener" I have no idea what that is.

thanks.

View Replies !    View Related
MouseMove Restrictions For Background Image
Hello,

I'm attempting to create a website with a background image that pans when the mouse moves around. The image is enclosed by a border to hide where the image ends. I have worked a script that links the image to the mouse movement but have been unable to stop the movement continuing past the edges of the image. This means that the user can move the mouse to an extreme so that the edge and past is shown in the visible area. Here is the script for the mouse action so far:

var midX = 520;
var midY = 350;
var scaleX = -0.2;
var scaleY = -0.2;
onMouseMove = function(){
bg_mc._x = midX + (_xmouse-midX)*scaleX;
bg_mc._y = midY + (_ymouse-midY)*scaleY;
}

I would be very grateful if anyone can guide me to the actions needed to stop the mouseMove action from continuing to move the image when it reaches it's edge. Also, the registration point is currently in the immediate centre of the image.

Thank you.

View Replies !    View Related
MouseMove Movie Clip Follower
Hi all,

I have a small problem with a menu i am creating in flash.

the idea is - to have a menu that follows my mouse when people visit my site. I have made a basic movie with this working to a fashion.

the problem I have is as follows: -

Obviously I want people to be able to rollover the movie clip to click the different options available. I can get that part to work, its just that when it comes to the mouse rollout from this movieclip: - when people rollover to the right hand side, or indeed the bottom of the clip. the movie clip tries to make the MC follow the mouse and return so that Xmouse and movisClip._x = 0. But the MC gets stuck because it again hits my rollover state, which is telling it to stop.

I am trying to work with a mouse listener, but cant figure out what needs doing! (to no avail)

Was wondering if any1 can help??

A great example of what I ideally want to get to is at http://www.douglasfisher.co.uk/ Click on this guys portfolio tab and check out the mouse following menu.

Any help would be greatly appreciated. attached is the code I am currently using so u can see where Im at.

Mark








Attach Code

ball_mc.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) / 24;
this._y -= (this._y-yMouse) / 24;
}
}


ball_mc.onRollOver = function(){

ball_mc.onEnterFrame = false
}

ball_mc.onRollOut = function(){
if(_root._xmouse > ball_mc._width)
trace("hello")
ball_mc.onRollOver = false


ball_mc.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) / 6;
this._y -= (this._y-yMouse) / 6;
}
}
}

View Replies !    View Related
Details On When MouseMove Events Issued
Can anyone point me to a reference discussing details of when mousemove events are dispatched? For example, if you have a display object that covers the entire display area and you move the mouse from the upper left to the bottom right within a one second duration, how many mousemove events are dispatched? It seems it could vary from one to positive infinity. Does it depend on frame rate? How does the player define what constitutes a "move'? Thanks for any help you can give.

View Replies !    View Related
Help On Adjusting The Speed Of Easing On Mousemove?
hey all,

i have the simple easing code:



bg_mc.onEnterFrame=function(){
speed = 30;

this._x+=(_root._xmouse-this._x)/speed;
this._y+=(_root._ymouse-this._y)/speed;
}

// ok this work fine on a small movieclip
but when my movieclip is 5500 x 5500 px big;
the small movements are to fast..
so what is a smart Math way to calculate if the mouse is moved slowly the speed is also slowly if the user moves fast the speed is very fast

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