Pages: [1]
  Print  
Author Topic: Bitmap asset: Can't access property of null object 1009  (Read 475 times)
limitedwave
Gaia Novice
*
Posts: 9


« on: February 08, 2010, 01:29:31 PM »

Sorry to post with such a lame problem...I'm finally trying to throw up a Gaia test and can't seem to load a bitmap. I'm not a noob to Flash btw. Gaia 3.2.0, Flash CS4.

Site XML:
Code:
<site title="Gaia Framework Site: %PAGE%" menu="true">
  <page id="index" src="index.swf" bytes="21804">
    <page id="nav" src="nav.swf" depth="top" bytes="25900">
      <page id="home" title="Home" src="home.swf" menu="true" bytes="59425"/>
  <asset id="galaxy" src="assets/galaxy.jpg" preload="true" />
      <page id="music" title="Music" src="music.swf" menu="true" bytes="81856"/>
      <page id="video" title="Video" src="video.swf" menu="true" bytes="84137"/>
      <page id="contact" title="Contact" src="contact.swf" menu="true" bytes="66227"/>
    </page>
  </page>
</site>

I'm trying to simply display the image on the Home page. HomePage.as:
Code:
package com.harp
{
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 flash.geom.*;

public class HomePage extends AbstractPage
{
public function HomePage()
{
super();
alpha = 0;
//new Scaffold(this);
}

override public function transitionIn():void
{

super.transitionIn();
TweenMax.to(this, 1.0, {alpha:1, onComplete:transitionInComplete});

// add or show bitmap
assets.galaxy.visible=true;
}
override public function transitionOut():void
{
super.transitionOut();
TweenMax.to(this, 0.3, {alpha:0, onComplete:transitionOutComplete});
}
}
}

I've tried adding the line: assets.galaxy.visible=true; in a few spots, all yield errors. I know it finds the image, cause I can break the link and cause that specific error. So it finds the asset, just no display. Thanks.

What am I doing wrong?
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3863


gaiaframework
WWW
« Reply #1 on: February 08, 2010, 02:17:26 PM »

Your galaxy asset belongs to the nav page, not the home page, because the home page node is self-closing.  Firefox is a great way to view your site.xml and see its true structure.
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
limitedwave
Gaia Novice
*
Posts: 9


« Reply #2 on: February 08, 2010, 02:22:35 PM »

OMG...thanks Steven. That wasn't worth your time Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc