Create your own logo home button

For one language site

Open Main.fla, create your logo inside website mc and convert it to a movie clip. Give it an instance name, for example "logo".

Now, open Main.as and paste this code:

public function Main()
{
    ...
    initLogo();
    ...
}

// ***************************************************************
//
//    LOGO
//
// ***************************************************************

private var logo:MovieClip;
private var logoAnim:TweenMax;
       
private function initLogo():void
{
    logo = website.logo;
    logo.buttonMode = true;
    logo.mouseChildren = false;
    //logo.alpha = 0;
    logo.addEventListener(MouseEvent.ROLL_OVER, btnLogoOverHandler, false, 0, true);
    logo.addEventListener(MouseEvent.CLICK, btnLogoClickHandler, false, 0, true);
    logoAnim = TweenMax.to( logo, 0.3, { tint:0xBCCB5F, paused:true } );
}
       
private function btnLogoOverHandler(e:MouseEvent):void
{
    e.currentTarget.addEventListener(MouseEvent.ROLL_OUT, btnLogoOutHandler, false, 0, true);
    logoAnim.play();
}
       
private function btnLogoOutHandler(e:MouseEvent):void
{
     e.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, btnLogoOutHandler);
     logoAnim.reverse();
}
       
private function btnLogoClickHandler(e:MouseEvent):void
{
    //e.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, btnLogoOutHandler);
    varcentral.flebSWFAddress.setValue('/');
}

 

Post A Comment

Anti-Spam Quiz: