Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
rjForbes

LiquidStage not seeing dynamically added objects.

Recommended Posts

HI All,

 

I'm just getting started with LiquidStage and I am having a issue with it seeing objects that are added to the stage dynamically. I may be overlooking something obvious here, but this is whats happening.

 

If I add a new object and attach it to the ls like this:

 

var header:infHeader = new infHeader();
ls.attach(header, ls.TOP_LEFT);

 

I receive this error:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.greensock.layout.core::LiquidData()
at com.greensock.layout::LiquidStage/attach()
at contendo::Interface/buildInterface()
at contendo::Interface()

 

If the 'header' object was on the stage though with the 'header' instance name it works though.

 

 

Any help is appreciated,

RJ

Link to post
Share on other sites

It looks like you just forgot to add the object to the display list - you need to do that so that LiquidStage can figure out where it is nested in the display list hierarchy and adjust it accordingly when the stage resizes. So make sure you addChild() your new object somewhere before you attach() it. Make sense?

Link to post
Share on other sites

Thanks Jack, I knew it had to be something simple. I thought i had tried to addCHild before , but then had taken it out thinking the attach function was doing that for me. The liquidStage class is really cool, looking forward to working with it in this project.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×