I am having an issue with my flash website. I’ve created it mostly using flash actionscript 3.0. My website is one large graphic that tweens to page coordinates. Each page is then loaded in with this script:
//Define function that will tween from page to page…
function moveContent(theXPosition:Number, theYPosition:Number, theSection:String):void {
trace("X: "+theXPosition);
trace("Y: "+theYPosition);
sectionLoader.source=null;
myxTween=new Tween(content_mc,“x”,Regular.easeOut,content_mc.x,theXPosition,1,true);
myyTween=new Tween(content_mc,“y”,Regular.easeOut,content_mc.y,theYPosition,1,true);
myyTween.addEventListener(TweenEvent.MOTION_FINISH, donePlaying);
function donePlaying(e:TweenEvent):void {
sectionLoader.source=theSection;
addChild(nav_mc);
}
}
I am having a problem when I click on my buttons to navigate from page to page. They have a Mouse Over state that animates. Once clicked, I use removeChild(nav_mc); but once the new page is loaded, addChild(nav_mc) is activated again and for some reason, my page buttons keep animating even though my mouse isn’t over them! I have to hover over the button again for it to stop again.
//navigate to home…
nav_mc.home.addEventListener(MouseEvent.CLICK, homeClick);
function homeClick(e:MouseEvent):void {
trace(“homeClick”);
moveContent(0,0, “pages/home.swf”);
removeChild(nav_mc);
}
Is there any way for me to say something like “add Child and stop” in order to stop all animation once it’s loaded? I’ve been working on this for a while now and can not find anything that works. Any help would be greatly appreciated. You can check out my website at http://www.tgfamilydesign.com to see what I am talking about if you’d like. Thanks everyone for your help.