Jump to content
Search Community

Another Liquid Stage + Gaia Question

HyperNerd test
Moderator Tag

Recommended Posts

Hi gang,

 

I have been attempting to implement Liquid Stage with my Gaia project and I'm running into some difficulties. Using this post as an example:

http://forums.greens...stage-and-gaia/

 

I'm instantiating Liquid Stage in my Index.as and attempting to call it from ProductApage as follows:

 

Index.as

package 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;

import com.greensock.layout.*;

public class IndexPage extends AbstractPage
{

 public var lStage:LiquidStage;

 public function IndexPage()
 {
  super();
  alpha = 0;

 }
 override public function transitionIn():void
 {
  super.transitionIn();
  TweenMax.to(this, 0.3, {alpha:1, onComplete:transitionInComplete});
  init();
 }
 override public function transitionOut():void
 {
  super.transitionOut();
  TweenMax.to(this, 0.3, {alpha:0, onComplete:transitionOutComplete});
 }

 private function init():void {
		//Gaia.api.getWidth() and Gaia.api.getHeight() refers to the very original width and height
		lStage = new LiquidStage(this.stage, Gaia.api.getWidth(), Gaia.api.getHeight(), Gaia.api.getWidth(), Gaia.api.getHeight());
	}

}
}

 

ProductAPage.as

package 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;
import com.greensock.*;
import com.greensock.loading.*;
 import com.greensock.loading.display.*;
 import com.greensock.events.LoaderEvent;
import com.greensock.loading.VideoLoader
 import com.greensock.layout.*;


public class ProductAPage extends AbstractPage
{

 public function ProductAPage()
 {
  super();
  alpha = 0;
 }

 override public function transitionIn():void
 {
  super.transitionIn();
  init();
  TweenMax.to(this, 0.3, {alpha:1, onComplete:transitionInComplete});

  function init():void {
		trace(this.stage); //outputs: [object Stage]
		trace(LiquidStage.getByStage(this.stage)); //outputs: null

		var ls = Gaia.api.getPage("index").content.lStage; //gets a direct reference to the liquidstage instance through the index page.
		trace(ls); //outputs: [object LiquidStage]
		trace(ls.stage); //outputs: [object Stage]
		trace(LiquidStage.getByStage(ls.stage)); //outputs: null

		ls.attach(mainVideo, ls.TOP_LEFT); //does work

		var area:LiquidArea = new LiquidArea(this, 50, 50, 100, 100, 0x313f19);
		//var area:LiquidArea = new LiquidArea(this, 50, 50, 100, 100, 0x313f19, 0x313f19, 0, 0, 99999, 99999, true, ls);  //throws: TypeError: Error #1034: Type Coercion failed: cannot convert com.greensock.layout::LiquidStage@2604f581 to com.greensock.layout.LiquidStage.

	}

}
}

 

Just using his code as an example (complete with the domain="current" code), but I'm not getting past Index.as and receiving errors:

 

src/pages/IndexPage.as, Line 38 1180: Call to a possibly undefined method LiquidStage.

 

src/pages/IndexPage.as, Line 16 1046: Type was not found or was not a compile-time constant: LiquidStage.

 

It seems people have had luck using Liquid Stage with Gaia, but I can't figure this out. Any help would be super! Thanks

Link to comment
Share on other sites

Hm, those errors indicate that you didn't import the LiquidStage class properly. It looks like you did in your code, so I wonder if you've got an old version of your class in there or something. Very difficult to troubleshoot blind, but I'd recommend making absolutely sure that you imported the classes properly.

 

And you're sure that you're loading into the same ApplicationDomain? Are you loading across domains without a crossdomain.xml file in place?

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...