-
1. Re: Button in draggable MC
Ned Murphy Mar 31, 2010 7:50 PM (in response to Shed Simas)Just on a hunch I'd say you need to use 'currentTarget' instead of 'target for the drag code'. Beyond that, you'll be in a better position to get help when you post your code and explain how things are put together and where your code is.
-
2. Re: Button in draggable MC
Shed Simas Apr 1, 2010 1:19 PM (in response to Ned Murphy)Thanks! That did work.
I was hoping you might be able to help me with my previous attempt, where click-and-drag moves the card and double-clicking flips it. I would prefer to use this method over the flip button if possibel. Here's the code I was using:
TVmc.addEventListener(MouseEvent.MOUSE_DOWN, startDragging); TVmc.addEventListener(MouseEvent.MOUSE_UP, stopDragging); TVmc.addEventListener(MouseEvent.DOUBLE_CLICK, flipCard); TVmc.doubleClickEnabled = true; function flipCard(myEvent:MouseEvent):void { TVmc.gotoAndPlay(currentFrame+1); } function startDragging(myEvent:MouseEvent):void { myEvent.currentTarget.startDrag(); } function stopDragging(myEvent:MouseEvent):void { myEvent.currentTarget.stopDrag(); }The flipping animation is within TVmc. Each of the two states in TVmc (face up and face down) has a variation of the following code, changing only the movie clip instance name and the finction name:
stop(); TVfront.addEventListener(MouseEvent.DOUBLE_CLICK, flipFront) TVfront.doubleClickEnabled = true; function flipFront (myEvent:MouseEvent): void { gotoAndPlay(currentFrame+1); }The code half-works. If the card is face up, it flips properly; however, if it is face down, the animation plays from the beginning (ie. from the face up state instead of from the current face down state).
-
3. Re: Button in draggable MC
Ned Murphy Apr 1, 2010 1:40 PM (in response to Shed Simas)It may just be a case of targeting the wrong timeline:
TVmc.gotoAndPlay(TVmc.currentFrame+1);
Though I'm not sure which object is supposed to be animating


