Hey Guys,

Been trying to solve this for the past three days.. Need your guys pro help
on this one.

I am trying make a pretty simple transition using Gaia Framework. Here is
the a test animation of the what I am trying todo:
http://www.pixeltheory.la/clients/visionsteen/motionComp/movement2.html The
first to buttons only work. I want to add this animation to the nav so its
all be in one place. I have my nav.as working with the buttons and pages
loading in, but I can seem to figure out where to hijack and release to make
this happen correctly. Steven Flash Master, tired to help me with the
transition but I couldn't seem to get it working. Here is what he said:

Here is the way to do: beforeTransitionOut, your swipe will animate in,
releaseGaia, then afterTransitionIn it will animate out revealing the page
underneath.

I seems easy enough looking at it, but can seem to figure out where it goes
in the nav.as. Here is what I have so far, most of the code so far is just
for the navArray.

____________________________________________________________________________________________

package pages
{
        import com.gaiaframework.templates.AbstractPage;
        import com.gaiaframework.events.*;
        import com.gaiaframework.debug.*;
        import com.gaiaframework.api.*;
        import flash.display.*;
        import flash.events.*;
        import com.greensock.TweenMax;
        import com.greensock.*;
        import com.greensock.easing.*;
        
        public class NavPage extends AbstractPage
        {       
                public var home_btn:MovieClip;
                public var topBlue:MovieClip;
                public var bottomWhite:MovieClip;
                public var facilities_btn:MovieClip;
                public var whatWeDo_btn:MovieClip;
                public var aboutUs_btn:MovieClip;
                public var contactUs_btn:MovieClip;
                public var backShadow1:MovieClip;
                public var backShadow2:MovieClip;
                public var backShadow3:MovieClip;
                public var backShadow4:MovieClip;
                public var navArray:Array;
                
                public var releaseGaiaNav:Function = 
Gaia.api.afterGoto(onAfterGoto);
                public var releaseGaia:Function =
Gaia.api.afterTransitionOut(onTransitionOut, true);
                        
                public function NavPage()
                {
                        super();
                        alpha = 0;
                        
                        home_btn.branch = Pages.HOME;
                        facilities_btn.branch = Pages.FACILITIES;
                        whatWeDo_btn.branch = Pages.WHAT_WE_DO;
                        aboutUs_btn.branch = Pages.ABOUT_US;
                        contactUs_btn.branch = Pages.CONTACT_US;
                        
                        navArray = [home_btn, facilities_btn, whatWeDo_btn, 
aboutUs_btn,
contactUs_btn]
                        for each (var button:MovieClip in navArray)
                    {
                                button.buttonMode = true;
                                button.mouseChildren = false;
                                button.addEventListener(MouseEvent.CLICK, 
onClick, false,0,true);
                    }
                
                }
                
                override public function transitionIn():void
                {
                        super.transitionIn();
                        TweenMax.to(this, 0.3, {alpha:1, 
onComplete:transitionInComplete});
                }
                
                override public function transitionOut():void
                {
                        super.transitionOut();
                        TweenMax.to(this, 0.3, {alpha:0, 
onComplete:transitionOutComplete});
                        for each (var button:MovieClip in navArray)
                        {
                                button.removeEventListener(MouseEvent.CLICK, 
onClick);
                        }
                }
                
                private function onTransitionOut(e:GaiaEvent):void
            {
                        releaseGaia();
                }
                
                private function onClick(e:MouseEvent):void
                {
                        Gaia.api.goto(e.target.branch);
                }
                
                private function onAfterGoto(e:GaiaEvent):void
                {
                        for each (var button:MovieClip in navArray)
                        {
                                if(button.branch == Gaia.api.getCurrentBranch())
                                {
                                        TweenMax.to(button, 1, {tint:0x8EB6C8});
                                        button.buttonMode = false;
                                }
                                else
                                {
                                        TweenMax.to(button, 1, 
{removeTint:true});
                                        button.buttonMode = true;
                                }
                        }
                }
        }
}

_________________________________________________________________________________________________________



Thanks for your help!!!

Ryan
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to