SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post FLASH 8 ACTIONSCRIPT

    Hello,

    First I want to say I have been coming here for a long time. Sitepoint rocks. I figured I would try my luck here first.

    I built a simple drag and drop city building game. All of my buildings are simple movie objects or graphic objects. Using simple start drag and stop drag. What code must I add in order to have these buildings snap to a single line at the bottom of the page. Imagine that H is a building and t is a tree or accessory. How do I make that H and T snap to that simple and single bottom line.

    HHH HHtt HHttttHHH HHHH
    _________________________

    I have been trying to make this work forever but I keep getting actionscript errors and I know its because im dumb. Someone please help me. I am using Flash 8.

  2. #2
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,547
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    Code:
    yourDraggableMovieClip.onRelease = function() { 
      this.stopDrag();
      this._y = yourBottomLineClip._y; 
    };


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
  •