A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: mouse trail

  1. #1
    Junior Member
    Join Date
    Jul 2004
    Location
    luton, england
    Posts
    10

    mouse trail

    I'm trying to get a group of lines/blocks to follow the mouse and lock into a certain place a specific point so it looks something like this:

    http://www.chameleoncreative.co.uk

    If you've got the know-how or perhaps have seen similar tutorial anywhere please let me know!
    Thanking y'all !

  2. #2
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    First off make a new mc from a colourful circle (press F8) name it circle or summit original like that. Next open the actions panel for your "circle" mc and paste the following code :
    code:
    onClipEvent (load) {
    _x = 0;
    _y = 0;
    speed = 5;
    }
    onClipEvent (enterFrame) {
    endX = _root._xmouse;
    endY = _root._ymouse;
    _x += (endX-_x)/speed;
    _y += (endY-_y)/speed;
    }



    Now just test your movie and there you have it.

    Regards,

  3. #3
    Junior Member
    Join Date
    Jul 2004
    Location
    luton, england
    Posts
    10
    Wow that was easy peasy thanx!the only ting is i need to constrain it to certain areas-it needs to sort of clip into certain sections.do you happen to know how i do that??would be much appreciated!

  4. #4
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    I'm not to sure what you mean by clip into certain areas?

    If you mean to certain movieClips then all you go is add on the path to the begining of the code:
    code:

    onClipEvent (load) {
    _root.myClip._x = 0;
    _root.myClip._y = 0;
    _root.myClip.speed = 5;
    }
    onClipEvent (enterFrame) {
    _root.myClip.endX = _root._xmouse;
    _root.myClip.endY = _root._ymouse;
    _root.myClip._x += (endX-_x)/speed;
    _root.myClip._y += (endY-_y)/speed;
    }



    If this isnt what you mean let me know.

    Regards,

  5. #5
    Junior Member
    Join Date
    Jul 2004
    Location
    luton, england
    Posts
    10
    sorry, what i meant was that the bars are supposed to follow the mouse along a straight line (like in the website featured) and then slot into menu sections. i realised that this could be done by puttin in button on the sections of menu and when they are rolled over it goes to a frame where there is a still of the lines.the prob is that after the mouse rolls out of the button area the lines shooot up to the side if the screen...phew!!well if you understood that then your probably a genius coz i certainly didnt!
    i made a little test mock-up thingy (dont worry this isnt the real thing!) which shud explain all that rubbish ive just bored you with!so if you get a chance it would be wik if u could take a look!no hurry!
    Attached Files Attached Files

  6. #6
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    hmm i know what you are talking about and i will give you the fla of an example of mine when i get home
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center