How to detect if a movieClip position changes or stays the same?
Hoping someone can point me in the right direction here. I think the solution is simple but I don't know how to code it. Basically what happens in my code below is the following:
- If the movieClip called 'tiles' is at 2048 pixels when the screen is dragged, remove the movieClip on stage called workSamples_mc.
What I actually want to do is say
- if the position of movieClip 'tiles' is changed, then remove the movieClip on stage called workSamples_mc, BUT if the screen is only tapped and the position is NOT changed, then DON'T remove workSamples_mc.
Please note that I've already called workSamples_mc to stage, I just didn't include the code.
Thanks, Mike
tiles.addEventListener(TouchEvent.TOUCH_BEGIN, homeTouchBegin);
tiles.addEventListener(TouchEvent.TOUCH_END, homeTouchEnd);
var homeDragBounds:Rectangle = new Rectangle(0, 0, 3072, stage.stageHeight-768);
function homeTouchBegin(event:TouchEvent):void {
event.target.startTouchDrag(event.touchPointID, false, homeDragBounds);
if (tiles.x == 2048)
// remove sample work icons from screen
TweenLite.to(workSamples_mc, .5, {alpha:0, onComplete:workSamplesGone});
function workSamplesGone():void {
workSamples_mc.visible = false;
}
}
