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




Mouse Mover (need Left Not Right)



IM USING FLASH MX

onClipEvent (load)
{
xcenter=425;
speed=1/100;
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-860;
if (_x < -860) _x=0;
}



Hello, this code works fine but it will scroll my object to the right when the mouse moves to the right. I would like my object to scroll left when the mouse scrolls right. Can anyone help me ?

In addition I was wondering if it is possible to make it stop scrollong on rollout of the object ????

Thank you for any help

bill



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-16-2005, 12:33 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Right/left Mouse Help
I might be being very dumb, but can any one tell me how to go back and forward using right and left mouse clicks to navigate a projector i’m creating

If Mouse Went Left/right...
how can i find that out?

Mouse Left, MC Right + Mouse Right, MC Left
Hello,

I'm trying to figure out how I can make a masked slider so that I can have dates appear and move higher and lower according to the direction the mouse is moved left+right of center. I have it working, my problem is that it keeps moving even when I don't want it too. For an example of what I would like to do see this:

http://www.artmuseum.net/w2vr/overture/overture.html

The back and forward buttons slide the images L + R, but only when you click on them. The way mine works is that it goes constantly back and forth regardless of where the mouse is. I don't necessarily want to have to press forward and back buttons, I like the slide to happen simply by the left right movement of the mouse but HOW DO I KEEP THE SENSITIVITY ONLY IN ONE AREA INSTEAD OF THE WHOLE .SWF BEING SENSITIVE?

If you go to the "bibliography" of my site you can see what's wrong with my approach:

http://www.unseenproductions.net/mainSolo.html

Thanks,

Llyfre

Has Mouse Left Movie Yet?
ok, still haven't figured it out, can't find help, but it ought to be so easy...

i have a small swf embedded in html (like a banner or so). if mouse enters movie, an MC responds to it's x-position.
easy. i do that with _root._xmouse.
but if mouse leaves the swf-area, that MC is supposed to become invisible. i cannot figure out though when pointer is actually leaving the area. when it does _root._xmouse only keeps returning the last valid value.
Know what i mean?
it's being done all the time, so, like, everybody has to know. please tell me

thank you,

marc

Left Mouse-Button Down?
I need to perform some code WHILE the left mouse-button is down. onMouseDown is only called ONCE, and not again until a different event takes place. Anyone know how to do this?

Scrolling Mouse Over Left To Right
hi,

i'm trying to have a scroll effect from right to left. i can get it going one way but i can't seem to bring it back the other way after a certain point. i'm almost there but i can't figure it out, can someone help me out please???

thanks.

i've attached the fla

On ANY Left Mouse Click?
i'd like to use actionscript to make a sound play on left mouse click... not necessarily on click of a particular symbol.

can this be done? I just need the code for "on any left mouse click"?

Mouse Drag Only Left And Right
I am using the following code to drag my movie clip "cursor".

Mouse.hide();
startDrag("cursor", true);

It works fine but I only want the drag function to move in the x axis. ie left and Right only, not upwards/downwards.

How do I prevent movement on the y axis ?

Obviously when the user moves diagonally left, then the cursor should move left only.

Any help much appreciated.

[CS3] Left Right Mouse Detection
again in as2, how can you write code to say if the cursor is east of a movie clip change movie clip and if it is west of the movie clipchange the movie clip, if you understand, here is kinda what i want but u have to drag the movie clip...
http://www.flashkit.com/movies/Basic...1805/index.php
thanks
funky

Left And Right Mouse Button
Hello,

Does anybody know how I can give the right mouse button the same functionality as the left one ? So that it doesn't matter which button is pressed.

Greetz

Left And Right Mouse Clicks
Hi All,
I have script that currently has "stuff" happening when a keyboard key is pressed, but I would like to be able to do the same thing when the mouse buttons are clicked.

At the moment, pressing <Enter> starts 2 timers running, pressing <1> records the time from the first timer and pressing <2> will record the time from second timer.

I would like to be able to get the same result as pressing keys <1> and <2> by pressing the left and right mouse buttons.

Any ideas would be appreciated.

Thanks

Move Left And Right With Mouse
Hi Can anyone help me with moving a image left and right depending on the mouse position like the following...

http://www.assness.com/

I had the following...

// now i need the mouse to move

mspeed = 5
endX = _root._xmouse;
_x += (endX-_x)/mspeed;


But the image just follows the mouse, ideally I need it to keep on moving left or right (unless the mouse is in the center) any help please?

Mouse Buttons: Left & Right
Hi, how can you tell what mouse button has been clicked??

e.g. if left click, go back a frame, right click, go forward.

any ideas??



Regards,

Martin

Computing Help And Info:
http://www.webrevolt.biz

Left Mouse Click
Last edited by Murtada-Ki : 2003-09-14 at 02:43.
























Hi, I wanted to make a button who can be pressed by the Right mouse button is there a code or something for that?

Thanks

Detecting Mouse Has Left SWF
Hi there,

I was wondering if anyone knows if there is a function that returns a boolean value if the mouse has left the swf area or window.

Thanks for your time.

Differentiating Left And Right Mouse Clicks
Hello,

Is there a way to differentiate between a left mouse click and a right mouse click? I have an interactive demo that runs for a while until a one-liner bullet comes up. After appearing, the movie stops until the moderator desires to proceed. The moderator will use a remote mouse with left and right buttons. I would like for the moderator to use the left mouse button to go forward in frames, and the right mouse button to go backwards.

How is this possible?
Thank you so much!

Replicating Left And Right Mouse Clicks
Was wondering whether anyone knows if it is possible to replicate a left and right mouse click in flash.

Need to distinguish between whether the user has right clicked their mouse or left clicked....also any ideas on replicating a double click?

Cheers....

Help. Mouse Left Click Button
How do I make a mouse left click button script?
I would like to create a slide show and have the movie go to the next slide by clicking on the mouse.
Can anyone help me. Thanks

Help Mouse Left Click Button
How do I make a mouse left click button script?
I would like to create a slide show and have the movie go to the next slide by clicking on the mouse.
Can anyone help me. Thanks

Right & Left Mouse Click Navigation
I am doing a cd rom presentation for a client and at the moment they can sroll through each section, going forwards or backwards with the left and right arrow keys on the keyboard.

They have come back and asked if they can navigate to the next pages by clicking on the mouse.

The going forward bit is easy but was wondering if it is possible to asign a backwards comand to the right mouse button?

Can anyone please let me know if this is possible and if so what the scripting would be?

Thanks

Dan

[F8] Mouse Drag With Left Button
I have 64 x 60 boxes at 8px x 8px. I want to mouseover to change colors, this is easy because I am already done with it. But once clicked I would like it to change color and stay changed, no biggie, this is done too. I would like to hold down the left mouse button and drag my mouse over the other boxes to change colors as well, kind of like when selecting multiple files in a folder with your mouse in windows. I would then like to be able to hold down the control button and select different boxes as well. Any help would be greatly appreciated.

Detecting Mouse Has Left The Stage
I would like to know when the user has left the stage but not sure if the following is even close

stage.addEventListener(MouseEvent.REMOVED,leftStag e);

Scrolling Image Left And Right Using Mouse
Hi,
I am lookin for a way to scroll image left or right as soon as I rollover over my mouse on left or right button. I dont know how it is done but i have seen it. So kindly help me that regard.I need it urgently.
Puneet

[help] Game + Left/right Mouse Movement
Hi. I'm busy creating a game and Im stuck on this one part.

I basically need to have the 'character' move with the mouse.
The movement must be like Hasee Bounce
http://www.neopets.com/games/play.phtml?game_id=368

I have my character and when I click the mouse he falls down off a building, but I need him to move left and right with the mouse as you move the mouse. The movement is exactly like hasee bounce.

How do I go about doing this? My game is almost finished, its just this bit of code that has puzzled me. (I'm using Flash 8)

I would really appreciate any help or guidance, as I'm very desperate

Test If Mouse Has Left The Stage
I'm working on a flash dropdown navigation to be used in the middle of an html page. I've got the dropdowns working as the client wants them with no issue, but I need to test for "if the mouse is not on the stage, roll-up the menus".

I'm having some issues with it.

Currently I have a big invisible movie clip that I'm performing a hitTest against.

ActionScript Code:
////////// TESTS HIT AREA ///////////
hiddenButton.onEnterFrame = function() {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
        if (!this.isRollOver) {
            this.isRollOver = true;
            trace("rolled over");
        }
    } else {
        if (this.isRollOver) {
            this.isRollOver = false;
            nav.gotoAndStop(1);
            _global.oldSelection.slideTo(null, 0, 1,"easeOutSine");
            ///// enables default menu's buttons //
            defaultMenu.currentSection.one.enabled = true;
            defaultMenu.currentSection.two.enabled = true;
            defaultMenu.currentSection.three.enabled = true;
            defaultMenu.currentSection.four.enabled = true;
            defaultMenu.currentSection.five.enabled = true;
            /////      
            trace("rolled off")
        }
    }
};
/////////////
 


The issue is that when you move your mouse too quickly or move it around too much while in the movieclip, it doesn't register when it leaves the stage and will keep the old rollover menu down. (you can see it here: http://brett-robinson.com/06/navTest/).

I tried a mouse listener and it was even worse. It's like I need a conditional of "if you can't figure out where the mouse is/don't see it on the stage, roll up all menus)....but that's kind of what I have now.

Left To Right, Mouse Activation, Slider..._____________
I have a problem,
I downloaded a fla. file, which was picture, sliding bar. Which has thumbnails photos which will later be buttons, with later actions added to them. The file worked fine when, I tested it in the original fla. file.

Now here is the problem, I want to add this fla. file, to one of my original, files which contains my main_movie. I would like to compy and paste it but the document size in my movie, is 800x 600, and my downloaded fla. is 431 x 103. Also, I feel if I copy any paste these, I will losse the symbols, from the librarys , on the transfer. Can I not have two different document sizes, in seperate scenes, or do I have to just test, the movies, seperatly, then change the document size, then test the other sized scenes?


I want that to work in a document the size of 800 x 600.

When I copy/pasted the frames, they work, when I test the movie once, if I switch scenes, to my main movie, (another scene), the document size, will be small, it will be the size, of my second scene, (the one with the photoslider in it). and it will not work. When I open the fla. file , test scene it works, if I swithc scenes, and come back to it to test it again, it won't work.

How Do I Test If The Left Mouse Button Is Down In An If Loop?
My question is pretty simple, but I cant figure it out. How do I test if the left mouse button is down in an if loop? Someone told me it was:
code:
if(Key.isDown(1)){
//blah
}

but that doesnt work. Thanks in advance.

Urgent Please How To Detect The Direction Of The Mouse Left Or Right
please how to detect the direction of the mouse left or right
means i move the mouse to the right i get x=5 else x=-5;

thanks

Help. How To Make A Mouse Left Click Button
How do I make a mouse left click button script?
I would like to create a slide show and have the movie go to the next slide by clicking on the mouse.
Can anyone help me. Thanks

Problems Detecting When The Mouse Has Left An Object.
I'm having big problems detecting when the mouse has left an object.
The problem is that my object is at the edge of the screen.
If the user moves the mouse too quickly, then the fact that the mouse has left the area is not detected.

I've tried lots of things... nothing works.

I tried putting a big buttons around and positioned behind the main object.
I've got a command saying onRollout do xxxxx.
That didn't work.

Then I hit upon an idea that just could not fail.
I have a dummy movie in the background.
I have an onFrame command doing a hitest continously.
If the mouse is not over the dummy background... then do xxxx.
This still fails!

For the hitest, I have run a few trace commands that retunr true or false when the mouse is over.
Because my movie is on the edge, the user can move the mouse quickly... and the code still reports as 'true' the mouse is still over the object.

I'm pulling my hair out over this one.

Surely this must be a really common problem...?

Thanks.


OM

I Want To Have An Mc Move Left And Right Depending On Where The User's Mouse Goes.
Basically, I have a photo gallery, on a long horizontal strip. I want the user to navigate this strip by simply moving their mouse to the right to make it move right, and moving their mouse to the left to make it move left.

I know that there is a way to do this where you track the mouse whereever it is on the stage...but I'd only like it to be only active when it is over this particular strip.

Also, each thumbnail on this strip has a rollover effect. I would like to have that roll over effect stay active...

Any help would be appreciated.

Thanks.

Problems Detecting When The Mouse Has Left An Object.
I'm having big problems detecting when the mouse has left an object.
The problem is that my object is at the edge of the screen.
If the user moves the mouse too quickly, then the fact that the mouse has left the area is not detected.

I've tried lots of things... nothing works.

I tried putting a big buttons around and positioned behind the main object.
I've got a command saying onRollout do xxxxx.
That didn't work.

Then I hit upon an idea that just could not fail.
I have a dummy movie in the background.
I have an onFrame command doing a hitest continously.
If the mouse is not over the dummy background... then do xxxx.
This still fails!

For the hitest, I have run a few trace commands that retunr true or false when the mouse is over.
Because my movie is on the edge, the user can move the mouse quickly... and the code still reports as 'true' the mouse is still over the object.

I'm pulling my hair out over this one.

Surely this must be a really common problem...?

Thanks.


OM

Emulate Left Mouse Button With Key Press
hello
What I'm trying to do is to create a mouse action like pressing the left mouse button when another key is pressed like CTRL or SHIFT.
thanks

On Rollover In Conjunction With Left Mouse Press
hi all.
I've created a "scratch-off" lottery-type of interface for a quiz I'm designing. Right now it works great with the "on (rollOver)" script call enabling the mouse cursor to act as the "coin" doing the scratching-off of the grey top material. However, it would be much more efficient if the user had to hold down the left mouse button AND roll over the grey material in order to scratch it off. It would prevent a lot of false scratches that way...

on(dragOver) doesn't work because the mouse click down has to be initiated on top of the actual mc and I need the mouse click to be initiated outside of it.

Hopefully there is an easy way to put a condition on the on(rollOver) which will make this work. Can anyone point me in the right direction?

Thanks in advance!

Problems Detecting When The Mouse Has Left An Object.
I'm having big problems detecting when the mouse has left an object.
The problem is that my object is at the edge of the screen.
If the user moves the mouse too quickly, then the fact that the mouse has left the area is not detected.

I've tried lots of things... nothing works.

I tried putting a big buttons around and positioned behind the main object.
I've got a command saying onRollout do xxxxx.
That didn't work.

Then I hit upon an idea that just could not fail.
I have a dummy movie in the background.
I have an onFrame command doing a hitest continously.
If the mouse is not over the dummy background... then do xxxx.
This still fails!

For the hitest, I have run a few trace commands that retunr true or false when the mouse is over.
Because my movie is on the edge, the user can move the mouse quickly... and the code still reports as 'true' the mouse is still over the object.

I'm pulling my hair out over this one.

Surely this must be a really common problem...?

Thanks.


OM

How Do I Rotate An Object/MC Etc By Moving Mouse Left Or Right?
Hi all,

I'm sure a lot of you have seen the tutorials for buttonless scrolling (where you move your cursor to the right of the screen and the movieclip scrolls to the left etc). Here is an excellent example...http://www.gotoandlearn.com/ (and then scroll down until you get to the title, 'Scrolling Thumbnail Panel'.

Now, I want to use this principle to rotate a MC of the world instead of scrolling the MC left and right. So, as your cursor moves to the right of the screen, the globe rotates in an anti-clockwise direction and visa versa.

Could anyone moderate the code below to make this work? I've tried a few things but none of them work. Thanks to anyone who tries...really need this for a campaign at work (deadline is looming!!)

FG.

the code...

panel.onRollOver = panelOver;

function panelOver() {
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}

var b = stroke.getBounds(_root);

function scrollPanel() {
if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
this.onRollOver = panelOver;
delete this.onEnterFrame;
}

if(panel._x >= 89) {
panel._x = 89;
}

if(panel._x <= -751) {
panel._x = -751;
}

var xdist = _xmouse - 250;

panel._x += Math.round(-xdist / 7);
}

Navigating Left And Right Based On The Users Mouse
Basically, I have a photo gallery, on a long horizontal strip. I want the user to navigate this strip by simply moving their mouse to the right to make it move right, and moving their mouse to the left to make it move left.

I know that there is a way to do this where you track the mouse whereever it is on the stage...but I'd only like it to be only active when it is over this particular strip.

Also, each thumbnail on this strip has a rollover effect. I would like to have that roll over effect stay active...

Any help would be appreciated.

Thanks.

The Mouse Pointer Has Left The Boundaries Of A Movie Clip?
I need to determine when the mouse is over the boundaries of a swf movie loaded on level1, in order to disable certain buttons on level0.

Once the mouse has left the boundaries of the clip in level1, I need to enable the previously disabled buttons on level0.

Anyone can give me a clue on how to achieve the above?
(I´m using MX)

Thanks a lot in advance.

Control A Flash Movie With The Mouse To Move Left And Right
Dear all,

How to create a flash movie that controlled by the mouse to move left (play backward) and to right (play forward)

Thanks!!!

Left Mouse Button Press/release Function
hi guys,

need some help with this basketball game Im building, everything is working fine with the codes below using <spacebar> to shoot the ball (hold down to power up and release to shoot), but now the design change requires me to make change on using left mouse button to do the same. Here's the current code:

ActionScript Code:
keyListener = new Object();
// on keyDown
keyListener.onKeyDown = function() {
    if (Key.isDown(Key.SPACE)) {
        //trace("space pressed");
        if (Ball.status == "reset") {
            if (_root.powerOn == false) {
                _root.powerOn = true;
                _root.playerMC.powerMC._visible = true;
                _root.playerMC.powerMC.gotoAndPlay(2);
            }
        }
    }
};
// on keyUp
keyListener.onKeyUp = function() {
    if (Key.getCode() == Key.SPACE) {
        //if (Ball.status == "reset" && _root.power<100) {
        if (Ball.status == "reset") {
            _root.powerOn = false;
            _root.doneBounce = false;
            _root.playerMC.powerMC.gotoAndStop(1);
            _root._root.playerMC.arrowMC._visible = false;
            _root.playerMC.powerMC._visible = false;
            _root._root.playerMC.playerangle._visible = false;
            Ball.initShoot();
        }
    }
};
Key.addListener(keyListener);
I understand that I can create button and use the on<press> and on<release> default function, but i need this left mouse press function to be at anywhere on stage instead of pressing on a specific button. I found this snippet of code which detects the left mouse button:

this.onEnterFrame = function ()
{
if(Key.isDown(1))
{
trace("Left Mousebutton");
}
}

this works fine alone, but when I swap out the <key.SPACE> with Key.isDown(1) the code doesnt trace.

Can anyone help me out?

thanks.

Moving Clip Contents Left/right On Mouse Over, Any Tutorials Out There?
Hi there,

Getting a whole load of data from a xml doc.

Want to load images into a movie, one next to another. Obviously there will be too many images in the movie for the user to see so..

When the user puts the mouse over the movie, and moves the mouse left/right, the movie will 'drag' its self in the relevant direction.

Anybody out there know a tutorial for doing this? Also want to turn each image into a button, so that it will change the main image to the selected image.

Thanks in advance....

Script To Send Animation Back To Beginning When Mouse Is Left Alone For A While?
Script to send animation back to beginning when mouse is left alone for a while?

im creating a screen saver with an animation that ends in a screen that becomes static.

I want the screeen saver to start at the beginning when the mouse is left alone an isnt moved for a while.

Is there a script that will do this?

Thanks.

HELP - 360 TYPE FRAME EFFECT BY MOVING THE MOUSE LEFT AND RIGHT (NOT LIKE QTVR )
Hi Guys I am basically wanting a tutorial link URL .fla etc on how to do the following effect.

http://www.martiniracing.com/content...cherEXT_hi.asp

What I need to do is change the frame up or down by moving the mouse left or right. For example when the mouse moves to the right I want the frame to move up 1,2,3,4,5,6 etc and when the mouse moves left I want the frames to go the opposite way

I have searched through all the .flas on Flashkit and non of them cover this. they all cover 360 panoramas which this is not

Any help would be more than appreciated

HELP - 360 TYPE FRAME EFFECT BY MOVING THE MOUSE LEFT AND RIGHT (NOT LIKE QTVR )
Hi Guys I am basically wanting a tutorial link URL .fla etc on how to do the following effect.

http://www.martiniracing.com/content...cherEXT_hi.asp

What I need to do is change the frame up or down by moving the mouse left or right. For example when the mouse moves to the right I want the frame to move up 1,2,3,4,5,6 etc and when the mouse moves left I want the frames to go the opposite way

I have searched through all the .flas on Flashkit and non of them cover this. they all cover 360 panoramas which this is not

Any help would be more than appreciated

Movie Clip Will Move Left To Right Continuesly When Mouse Hovers On Bu
  I have a flash movie that displays and loops my 40 logos inside a movie clip...

 then,I have two big Button Arrows on each side(left & right  side)on the main movie.

 I need these arrows to be functional..
- when mouse hovers on left arrow, the logoClips will move fast right to left
- when mouse hovers on right arrow, the logoClips will move left to right.

 can you guys help me?

note: movie clip logos are already moving right to left slowly using motion tween, I need to put button arrows to navigate. If you have better version ...pls help

 thanks in advance.


Right Mouse Btn Like Left Mouse Btn
HI
Is possible to use right mouse btn like left mouse btn?
E.g. for simple game.
For the Player would be the same if the fire btn is left or right mouse btn.

Thanks

Right Mouse Btn Like Left Mouse Btn
HI
Is possible to use right mouse btn like left mouse btn?
E.g. for simple game.
For the Player would be the same if the fire btn is left or right mouse btn.

Thanks

Please Help MC Mover
Hi,
I have a character which moves around the screen using the cursor keys from a birds eye view. I would like it so that when you move the character, up, down, left or right, a movie clip moves over the top so that it looks like a scrolling background, i have all this working ok.. i cant quite get the correct syntax to enable the character to move around freely in the middle of the screen, but when the character gets near the edge of the screen the backgound mc begins to scroll in the relavant direction..
my stage is 800---450px working in flashmx..
ne help on how to achieve this is much appreciated

i have this script attached to my character
onClipEvent (load) {
moveSpeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.lastpress = 6;
_root.man.gotoAndStop("right");
this._x += moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
_root.man.gotoAndStop("left");
_root.lastpress = 4;
this._x -= moveSpeed;
} else if (Key.isDown(Key.DOWN)) {
_root.man.gotoAndStop("down");
_root.lastpress = 2;
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)) {
_root.lastpress = 8;
_root.man.gotoAndStop("up");
this._y -= moveSpeed;

} else {
_root.man.gotoAndStop("stop");
}
}onClipEvent (load) {
moveSpeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.lastpress = 6;
_root.man.gotoAndStop("right");
this._x += moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
_root.man.gotoAndStop("left");
_root.lastpress = 4;
this._x -= moveSpeed;
} else if (Key.isDown(Key.DOWN)) {
_root.man.gotoAndStop("down");
_root.lastpress = 2;
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)) {
_root.lastpress = 8;
_root.man.gotoAndStop("up");
this._y -= moveSpeed;

} else {
_root.man.gotoAndStop("stop");
}
}

and this script attached to my scrolling background
onClipEvent(load) {
speed = 5;
}
onClipEvent(enterFrame) {
if (key.isDown(key.LEFT)) {
_x += speed;
} else if (key.isDown(key.RIGHT)){
_x -= speed;
} else if (key.isDown(key.DOWN)){
_y -= speed;
} else if (key.isDown(key.UP)){
_y += speed;
}
}


thanx speakerz

Mover Over Tags
I've made a flash page but I was wondering how to make a hovering image that follows the mouse. There's an example of it at http://www.jkrowling.com/ if you want to see what I mean...

ps: This is my first ever post! Yeay!

Copyright © 2005-08 www.BigResource.com, All rights reserved