Tuesday, 11 May 2010

Drag and Dropping the Stickers

Next I made it so the user would be able to drag the sticker from the sticker book and drop it onto the island. I did orginally put the following actionscript onto the sticker itself:

on (press) {
startDrag(this);
}
on (release) {
this.stopDrag();
}

The problem with this code is, because the stickers are within the stickerbook movie clip, when the user drops the sticker onto the island it is fine but when the stickerbook is not displayed on the stage, the sticker also moves with the stickerbook movieclip so I need to make it so when the user releases the sticker, it removes the sticker movieclip that is within the stickerbook movie clip and replace it with the same sticker which will be outside of the stickerbook movieclip so when the stickerbook is not displayed, it won't affect the stickers that the user has already placed on the island.


This actionscript is saying that when the user releases the sticker, it is going to attach the movieclip 'starfish' and then where abouts to place the starfish movieclip on the x and y axis and also how big or small to make the movie clip. I have chosen to make the movieclip that is being attached to be slightly bigger than the sticker that is in the stickerbook so it is more fun for the user.

No comments:

Post a Comment

Followers