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




How To Get Mouseposition



can someone help me,is there an action to get my position of my mouse?



FlashKit > Flash Help > Flash MX
Posted on: 11-28-2002, 03:41 PM


View Complete Forum Thread with Replies

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

As Mouseposition Help
hi, i have been playing with some actionscript that makes a menu scroll up and down. The code works great apart from one thing, when it is placed into a webpage, straight away the menu scrolls up by itself, and will continue to do so until the cursor is over the flash itself. My question is how can i get it to only scroll the menu when your over the menu area itself within the flash. My code so far is as follows:


ActionScript Code:
// ---------------------------------------------
// Speed is INVERSE
// ---------------------------------------------
speed = 55;
drag = "/dragControl";
/:h = getProperty("/nav", _height);
// ---------------------------------------------
// line below controls invisible mouse scroll center point SET the number TO HALF OF THE HEIGHT OF YOUR MOVIE!
// ---------------------------------------------
/:yPos = getProperty(drag, _y)-80;
/:xPos = getProperty(drag, _x);
// ---------------------------------------------
// adjust for Speed
// ---------------------------------------------
setProperty("/nav", _y, getProperty("/nav", _y)-(/:yPos/speed));
// ---------------------------------------------
// see if we're run out of menus either up or down
// ---------------------------------------------
if (Number(getProperty("/nav", _y))<Number(-(/:h/2))) {
    setProperty("/nav", _y, 0.01);
} else if (Number(getProperty("/nav", _y))>0) {
    setProperty("/nav", _y, -/:h/2);
}

as always any help would be greatly appreciated.

thanks

Flip MC On Mouseposition
I was wondering how i could flip a MC regearding the position of the mouse. this way i want to make a MC which will be fronted to the mouse.

i saw something like:

this._xscale *= -1


but i dunno how to combine it. how i built up the checks so i doens't flip at every framerate.

help would be very apriciated!

Zoom According To Mouseposition
Hello,

i search for a simple zoom for an mc. This Zoom should be activated by a click on the mc (map) and stop at the zoomed positon. I found this very good script but i can`t figur out how i can stop at the zoomed position. Maybe someone can help me???

I am thankful for any good advice...

Cheers

// Origin
movieclip.prototype.getOrigin = function () {
trace('getOrigin')
this.targetX = this.startX;
this.targetY = this.startY;
this.targetXs = this.startXs;
this.targetYs = this.startYs;
}
// Target
movieclip.prototype.getTarget = function (factor) {
this.targetX = this.startX+(this.startX-this._parent._xmouse)*factor;
this.targetY = this.startY+(this.startY-this._parent._ymouse)*factor;
this.targetXs = this.startXs*factor;
this.targetYs = this.startYs*factor;
}
// Zoom
movieclip.prototype.zoom = function (delay, targetX, targetY) {
this.difX = this.targetX-this._x;
difY = this.targetY-this._y;
difXs = this.targetXs-this._xscale;
difYs = this.targetYs-this._yscale;
this._x += (this.difX/delay);
this._y += (difY/delay);
this._xscale += difXs/delay;
this._yscale += difYs/delay;
if(Math.abs(10*this.difX) < 2){
delete this.onEnterFrame
}
}
//


myStadt.startX = myStadt._x;
myStadt.startY = myStadt._y;
myStadt.startXs = myStadt._xscale;
myStadt.startYs = myStadt._yscale;
myStadt.getOrigin();

myStadt.setOnEnterFrame = function(){
this.onEnterFrame = function(){
this.zoom(4, this.targetX,this. targetY);
}
}

myStadt.onMouseDown = function(){
this.getTarget(2)
this.onMouseMove = function(){
this.getTarget(2);
}
this.setOnEnterFrame();
}

myStadt.onMouseUp = function(){
this.getOrigin();
delete this.onMouseMove
this.setOnEnterFrame();
}

stop ();

Locating A Movieclip Relative To Mouseposition
How can I put a MovielClip at a position relatively to the current position of the Mosepointer.

Mouseposition Panel, Very Simple Question I Think
hi, i'm absolutly new in scripting actionscript and my problem is, that i want to print out the mouse, y x-position on a "panel"

My plan is to give the "panel" the command on load .... mouse.y.. mouse.x.. and than maybe print or something, need help - thank you

Making The Carousel Move On Click Instead Of Mouseposition
I realize there have been a lot of questions asked about the Carousel tutorial. It is a great tutorial and I really enjoyed going through it. What I am trying to accomplish right now is to have the Carousel stationary, until one of the icons is clicked. Once it is clicked, the Carousel spins around until that icon is at the front, then information will be displayed and the user has an option to contiune with the selection of this icon, OR click on a different icon, at which point the Carousel will spin to that icon.

I've read all of the posts I could find on the Carousel in the forums here, but came up empty handed. If someone could point me in the right direction I would be very greatful. Thank you.

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