PDA

View Full Version : Controlling Tween From Within Child Movie Clip


LoR*Evanescence
07-12-2008, 03:19 AM
I have a moveclip Named photoStrip_MC that is tweened to scroll across my flash page, I have each photo in the photoStrip_MC as a movie clipped named photo1_MC and so on.

What is happening is, I'm trying to stop and resume the tween of photoStrip_MC when there is a MouseOver of each photos movie clip.

What keeps happening though is flash is telling me that the tween is possibly undefined when I have my AS inside the photoStrip_MC, or it tells me that the photo1_MC is possibly undefined when I have it on the main stage.


How can I get them to communicate with each other?

This is my code with my latest attempt with the MouseOver event in photoStrip_MC trying this.parent.parent

colette1.addEventListener(MouseEvent.MOUSE_OVER, resizePhoto1One);
function resizePhoto1One(event:MouseEvent):void {
photo1_MC.scaleX *= 1.25;
photo1_MC.scaleY = photo1_MC.scaleX;
this.parent.parent.xTween.stop(this.parent);
}
photo1_MC.addEventListener(MouseEvent.MOUSE_OUT, resizePhoto1Two);
function resizePhoto1Two(event:MouseEvent):void {
photo1_MC.scaleX /= 1.25;
photo1_MC.scaleY = photo1_MC.scaleX;
this.parent.parent.xTween.resume(this.parent);
}


And this is the code for the tween on the main stage

var xTween: Tween;
xTween = new Tween(photoStrip_MC,"x",Regular.easeInOut,15,650,14,true);
xTween.addEventListener(TweenEvent.MOTION_FINISH,m otionFinish);

function motionFinish(event:TweenEvent):void
{
xTween.yoyo();
}

Thanks, any help would be appreciated. I had it working until I lumped all the photo MC's into one MC, and I'm new to AS3.

LoR*Evanescence
07-13-2008, 02:25 PM
Anyone have any idea's. I still haven't been able to figure this one out=\