A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: drag problem

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Location
    indianapolis
    Posts
    144

    drag problem

    i have a button that i am dragging to a draggable area target. i want there to be an image change (like a mouse over) when the dragged object is hovering over the target area but it isnt working. ive tried a drag over event and i have tried using script for "when this object is over this target...." but that didnt work either. any thoughts?


    thanks

  2. #2
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    You could always to a hittest. Make the target area a movieclip and give it an instance name, also, make the button a movieclip as well and give that an instance name

    Now on the target area moveclip place the following code

    onClipEvent(enterframe){
    if (this.hitTest(_root.buttoninstance)){
    // Do your stuff
    }
    }


    This is probably a bad way of going about what your trying to accomplish so hopefully someone will help you out better then I

    Anyways, good luck

  3. #3
    Senior Member
    Join Date
    Oct 2000
    Location
    indianapolis
    Posts
    144
    hey that worked...now how do i turn that off when they either let go or drag out of that area?

    thanks!

  4. #4
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Glad it did

    To make it so something else happens (key word, else) then add the following to the code I gave you

    onClipEvent(enterframe){
    if (this.hitTest(_root.buttoninstance)){
    // Do your stuff
    } else
    // Do your other stuff
    }
    }

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