Mouse follow in flash MX

Hi, I just got my copy of Flash MX…have a few simple questions.\r\r\rWhat actionscript commands involves a movie following the mouse in vertical directions? Is this done by calculating/constraining the rectangle area?\r\rexample:\r\rwww.hugeinc.com/2001/huge_1000.html\r\r----------------------\r\rIf i would like to have a movie slide from point A to point B according to the movement of the mouse position, what actionscript will it involve?\r\r\r-----------------------\r\ralso, what is the use of xmouse and xscale? \r\r\r\rThanks guys.\r\r\r\r\r\r

Well… _xmouse is a global property which requests the location of the mouse’s x possition on the player.\r\r_xscale is a property which is similar to _width. It discribes a property of scale to the width of an object.\r\rAs for your request… it’s the same as Flash 5.0 unless they’ve got a new way of doing it. Either way, the 5.0 version of the script will still work.\r\rthis code is placed on the movie clip that is to move\r\ronClipEvent(enterFrame){\rdiff=_ymouse-_y;\rthis._y+=diff/50;\r}\r\rThe division by 50 is arbatrary. If you want it to move more slowly towards the mouse up the amount that you’re dividing it into. If you want the object to follow exactly where the mouse is, take out the /50 entirely.\r\r(PS I’m doing this from my head so if that doesn’t seem to work, change line 2 to\rdiff=_y-_ymouse;\r)

Hey Upu, the problem with your script is that you have to put _root._ymouse, or _parent._ymouse.\r\rIf you want to do that with MX, you can do it with callbacks functions. Put your clip on the scene, give it the instance name ** cli** and then in the ** FIRST FRAME OF YOUR MOVIE** (not on the clip !) enter :

 cli.onEnterFrame = function () { \r\r&nbsp &nbsp &nbsp &nbsp diff=_root._ymouse-this._y;\r\r&nbsp &nbsp &nbsp &nbsp this._y+=diff/15;\r\r}

pom 0]

And after deep thinking, _width and _xscale are reated but not the same thing. For instance, if the movie is originally 75 pixels wide, you’ll have _width=75 and _xscale=100.\rNow if you do _xscale*=2, you’ll have _width=150 and _xscale=200.\rNot the same thing, but similar.\r\rpom 0]

Last but not least, this thing on that site was done with masks. If you’re using F5, see my cough amazing cough tutorial on this site, and if you’re on MX, there’s a post somewhere about that.\r\rpom 0]

You know what, you guys are amazing. thanks for your help.\r\rWhat is your advice to someone like me who started using flash one month ago…and would like to get serious with actionscipting? Do i need to get a book, learn the basics go form there Or is it like HTML, where you can kinda skip the basics and do a trial by error thingy? \r\rOne month has taught me alot - do visit - www.jonwee.com\r\rcheers!\r\rP/s: ilyaslamasses : i did learn masking through your cough masking thing. got it in an hour, now i’m trying to take it to the next level by controlling the masked area with the movement of the mouse like hugeinc’s.\r

One month, hue ? I’m impressed. The design of your site is really great. It’s just too bad that there’s not more Flash in it, but I’m sure there will in no time.\r\rAbout that mask control, asI said, if you’re working with MX, nothing simpler, and if you’re on F5, and if you’ve understood that cough truely amazing cough tutorial of mine, there shouldn’t be any problem (as a matter of fact, that’s the reason why I made that effect in the first place :smiley: )\r\rpom 0]

yeah, its been a month since my company shut down and for the first time in years, i have the opportunity to play with flash as i always wanted to.\r\ractually, i did a basic html site as most of my clients, the market sector i am in - are kinda technically backwards. I deal with clients who are willing to pay good money for a site but are on a 56k modem and a 15 inch monitor. \r\rwhen i brush up on the flash skills, then perhaps ill make a flash version of the site. \r\rbut actionscripts…actionscipts…Need to master it…arrggh!!!\r\r\r\r