Pages: [1]
  Print  
Author Topic: TypeError: Error #1009: Não é possível acessar uma propriedade ou um método de u  (Read 1615 times)
ivomiguelas
Gaia Novice
*
Posts: 1


« on: September 05, 2010, 09:39:19 AM »

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
Code:
<?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
Code:
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?
Logged
rd
Gaia Novice
*
Posts: 7


« Reply #1 on: November 29, 2010, 12:14:12 PM »

Hello, This error in my case was related to the time when the referenced objects (eg button) appears in the film. While they only appeared in a certain frame error persisted, after which I put to emerge (Alpha 0% and 100% at the desired time) since the first frame everything went right. Hope that helps.
Logged
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc