Hey guys, I'm completly new to Gaia Framework and first of all I would like to congratulate the whole team for their effort.
I'm having some trouble with this outpost message:
TypeError: Error #1009: Não é possível acessar uma propriedade ou um método de uma referência de objeto nula.
at com.CCASol.Pages::NavPage()
This is my xml
<?xml version="1.0" encoding="UTF-8"?>
<site title="Gaia Framework Site: %PAGE%" menu="true">
<page id="index" src="index.swf">
<page id="nav" src="nav.swf" depth="top">
<page id="home" title="Home" src="home.swf" menu="true" />
<page id="sobre" title="Sobre Nós" src="sobre.swf" menu="true" />
<page id="oqfazemos" title="O Que Fazemos" src="oqfazemos.swf" menu="true" />
<page id="colab" title="Colaboradores" src="colab.swf" menu="true" />
<page id="venda" title="Bens Em Venda" src="venda.swf" menu="true" />
<page id="links" title="Links Úteis" src="links.swf" menu="true" />
<page id="contactos" title="Contactos" src="contactos.swf" menu="true" />
</page>
</page>
</site>
This is my NavPage
package com.CCASol.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;
public class NavPage extends AbstractPage
{
public var home_btn:SimpleButton;
public var sobre_btn:SimpleButton;
public var oqfazemos_btn:SimpleButton;
public var colab_btn:SimpleButton;
public var venda_btn:SimpleButton;
public var links_btn:SimpleButton;
public var contactos_btn:SimpleButton;
public var escudo_MC:MovieClip;
public var logo_MC:MovieClip;
public function NavPage()
{
super();
alpha = 0;
home_btn.addEventListener(MouseEvent.CLICK, onNavClick);
sobre_btn.addEventListener(MouseEvent.CLICK, onNavClick);
oqfazemos_btn.addEventListener(MouseEvent.CLICK, onNavClick);
colab_btn.addEventListener(MouseEvent.CLICK, onNavClick);
venda_btn.addEventListener(MouseEvent.CLICK, onNavClick);
links_btn.addEventListener(MouseEvent.CLICK, onNavClick);
contactos_btn.addEventListener(MouseEvent.CLICK, onNavClick);
}
private function onNavClick(e:MouseEvent):void
{
switch(e.currentTarget){
case home_btn: Gaia.api.goto(Pages.HOME); break;
case sobre_btn: Gaia.api.goto(Pages.SOBRE_NOS); break;
case oqfazemos_btn: Gaia.api.goto(Pages.O_QUE_FAZEMOS); break;
case colab_btn: Gaia.api.goto(Pages.COLABORADORES); break;
case venda_btn: Gaia.api.goto(Pages.BENS_EM_VENDA); break;
case links_btn: Gaia.api.goto(Pages.LINKS_UTEIS); break;
case contactos_btn: Gaia.api.goto(Pages.CONTACTOS); break;
}
}
override public function transitionIn():void
{
changeState(Gaia.api.getCurrentBranch() );
Gaia.api.afterGoto(onAfterGoto);
super.transitionIn();
TweenMax.to(this, 0.3, {alpha:1, onComplete:transitionInComplete});
}
private function onAfterGoto(e:GaiaEvent):void
{
var branch:String = e.validBranch;
changeState(branch);
}
private function changeState(branch:String):void
{
var currentPageArray:Array = branch.split("/");
switch(currentPageArray[2]) {
case "home": TweenMax.to(escudo_MC, 0.5, { x:250 } ); break;
case "sobre": TweenMax.to(escudo_MC, 0.5, { x:330 } ); break;
case "oqfazemos": TweenMax.to(escudo_MC, 0.5, { x:436 } ); break;
case "colab": TweenMax.to(escudo_MC, 0.5, { x:556 } ); break;
case "venda": TweenMax.to(escudo_MC, 0.5, { x:673 } ); break;
}
}
override public function transitionOut():void
{
super.transitionOut();
TweenMax.to(this, 0.3, {alpha:0, onComplete:transitionOutComplete});
}
}
}
Can someone help me please?