Monnone Posted August 16, 2011 Share Posted August 16, 2011 I'm getting this error: Error: LiquidStage error: you must define a valid stage instance in the constructor. If the stage is null, please addEventListener(Event.ADDED_TO_STAGE) one of your DisplayObjects and wait to create the LiquidStage instance until AFTER the stage property is not null. I understand the error but I don't understand why this is happening in my project. Everything was working as should and then I started added more elements to the stage. Now I'm getting this error. When I guide out the new stage assets everything works. This doesn't make any sense at all. Here are main parts of my code abbreviated: public function Litterforce() { initStage(); } private function initStage() { trace(stage); TweenMax.to(subFooter, 0, {y:1100, autoAlpha:0}); TweenMax.to(subHeader, 0, {autoAlpha:0}); TweenMax.to(actMain, 0, {autoAlpha:0}); //TweenMax.delayedCall(1, initLS); initLS(); trace(stage); } private function initLS(){ trace(stage); ls = new LiquidStage(this.stage,1400,1100,0,0); //ls.attach(subHeader, ls.TOP_LEFT); //ls.attach(subHeader.rightMenu, ls.TOP_RIGHT); ls.attach(subFooter.bkgrnd, ls.BOTTOM_LEFT); ls.attach(subFooter.subFooterTab, ls.BOTTOM_RIGHT); ls.attach(subFooter.tiles, ls.BOTTOM_LEFT); ls.attach(subFooter.rightAssets, ls.BOTTOM_RIGHT); var areaBkgrnd:LiquidArea = new LiquidArea(this,0,0,1646,1100,0xFF0000); areaBkgrnd.preview = false; areaBkgrnd.attach(bkgrnd, {scaleMode:"proportionalOutside"}); var areaLanding:LiquidArea = new LiquidArea(this, 0, -65, 1400, 1150, 0xFF0000, 700, 500, 99999999, 99999999, true, ls, false); areaLanding.preview = false; areaLanding.attach(landingPage, {scaleMode:"proportionalInside"}); var areaActs:LiquidArea = new LiquidArea(this, 0, 0, 1400, 1100, 0xFF0000, 600, 400, 99999999, 99999999, true, ls, false); areaActs.preview = false; areaActs.attach(actMain, {scaleMode:"proportionalInside"}); } } I put the stage traces in there to see what's going on. The stage is found in all three traces with the new assets guided out. When I put them back in, stage takes a while to initialize apparently. I discovered this by delaying the call to initLS by a second and stage eventually is defined. The new assets are not anything dynamic, straight up object on the stage... thanks for any advice! Link to comment Share on other sites More sharing options...
Monnone Posted August 16, 2011 Author Share Posted August 16, 2011 I figured it out. I'll post my finding in case someone else comes across this too. The new objects I was adding included text from an Illustrator file. I copied the vector objects and text objects from the Illustrator file and pasted them onto the Flash stage. Apparently text copied from Illustrator and pasted into Flash defaults to TLF text. Turns out I was missing that font too. The combination of missing the font and defaulting to TLF caused the stage to delay initialization...thus breaking Liquid Stage. Link to comment Share on other sites More sharing options...
Carl Posted August 17, 2011 Share Posted August 17, 2011 thanks for posting your findings. I wouldn't have known about that. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now