Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 5 of 5
  1. #1

    Default Draging to a target

    hi, i have a movie clip that i can drag.....is it possible to set an x and y position on the stage as a target for the movie.....is it possible to snap the movie to this position when the movie is dragged to within a few px of this target......and can the snapping trigger a getURL action.....
    i hope this is possible....thank you for any help you can offer
    have a great day
    gren

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2
    Join Date
    May 2003
    Location
    india
    Posts
    202

    Default

    hi Grenouille,

    yes it is possiable, use the below code to fix the area of drag movie


    Code:
    onClipEvent (load) {
        startDrag("MovieClipName", true, 10, 10, 10, 10);
    }
    startDrag("MovieClipName", true, LeftValue, TopValue, RightValue, BottomValue);

    Regards
    jeet

  4. #3

    Default

    Doesn't that code just allow the movieClip to be dragged within the defined coords?

    If you want it to click into place then I would suggest making a mC the size of the area you want, and then use hitTest like this:

    Code:
    on(release){
     if(test_mc.hitTest("dragged_mc", true)){
      //set the coords
      dragged_mc._x=50;
      dragged_mc._y=50;
      dragged_mc.stopDrag();
     }else{
      dragged_mc.stopDrag();
     }
    }
    Taff

  5. #4
    Join Date
    Nov 2003
    Location
    Adelaide, Australia
    Posts
    86

    Default yes

    wat they said

  6. #5

    Default

    thank you Taff for pointing me to the hitTest action script.....after a week of playing around i finally got it working close to how i want it....
    have a great day!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Buttons won't link to target
    By nkls in forum Newbies
    Replies: 3
    Last Post: 11-09-2005, 02:45 PM
  2. advertisement games where you hit the target
    By newgamer in forum Newbies
    Replies: 0
    Last Post: 10-06-2005, 05:48 PM
  3. Tell Target Action
    By phdsigns in forum Flash Scripting
    Replies: 2
    Last Post: 09-07-2005, 06:14 PM
  4. ad banner hit the target games.
    By newgamer in forum Games
    Replies: 1
    Last Post: 05-20-2005, 12:39 PM
  5. getURL target window
    By patp in forum Flash Scripting
    Replies: 1
    Last Post: 04-26-2005, 04:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial