A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: moving a movie clip around

  1. #1
    Junior Member
    Join Date
    Mar 2004
    Posts
    4

    moving a movie clip around

    I am making a game where players can pick up objects and use those objects to unlock doors, chests, closets, etc. I need to know what would be the best and easiest way to do this. How can I make it to where the player can click an object on the ground, send it to the top of the screen as if it were in their "inventory", and then later use it to unlock a door. I've asked this question for the last 3 days and no one can seem to help me.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Its probably because your questions may involve several different techniqes, so it would be a very long answer.

    You should probably make your objects into movieclips. In the movieclips you can have a invisible button ( just the hitstate defined ) with...

    // Signal to script ON the movieclip
    on(release){
    moveUpWhere=50;
    moveUpOnScreen=1;
    }

    This would not do anything by itself but if you also put a little script ON the movieclip it will move nicely to a position set by the
    moveUpWhereTo variable.

    // ON the movieclip
    onClipEvent (enterFrame) {
    if (moveUpOnScreen == 1) {
    this._y += (moveUpWhere-this._y)/7;
    }
    }

    Thats a start for you. If later want the movieclip to be draggable ( to unlock things ) you can get great tutorials in the Tutorial section for this or on Google like.....

    http://www.almost-leet.com/fla/tut2/.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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