Jump to content
Search Community

liquidArea issue does not expand on the left side

copperjohn test
Moderator Tag

Recommended Posts

Hi Everyone,

 

I'm doing this:

 

var ls:LiquidStage = stage.getChildAt(0)["myLiquidStage"]; // don't mind this line...

var area:LiquidArea = new LiquidArea(this, 0, 0, 960, 30, 0xffc700);

area.pinCorners(ls.TOP_LEFT, ls.TOP_RIGHT); // in questo modo impedisco alla barra di modificare la propria altezza

area.preview = true;

 

(my stage is 960, 550 and liquidStage is the same)

 

 

i want my area to stay at 30pixel height but whe i resize the browser the area goes upwards

 

Thanks

Link to comment
Share on other sites

Hey mate,

 

Remember in Gaia that the top left isn't truly the TOP-LEFT if your centering your content via the included panel in the framework.

What you can do is run a Gaia.api.getSitePosition() to find how far the site's top left has shifted and use a bit of math in your positioning code.

 

Cheers

 

-Z

Link to comment
Share on other sites

Hi Zync,

 

Thanks for the reply, but nothing to do...

 

I have tryed to give the initial position to the LiquidArea using the real "0" of the stage in Gaia (when centered)s :

 

var currentX:int = Gaia.api.getSitePosition().x;

var currentW:int = Math.round(960 + currentX*2);

var area:LiquidArea = new LiquidArea(this, -currentX, 0, currentW, 30, 0xffc700);

 

this seems ok when i reload the page, but when i resize... NOTHING the left corner doesn't adjust its position!!!

 

I have tryed to add this liquidArea directly on the stage (stage.addChildAt(area, 0);) and it works but i would like it to work in the Gaia siteview

 

Thanks!

Link to comment
Share on other sites

Frankly I'm not very familiar with Gaia so I may not be able to help much here (sounds like a Gaia-specific issue). Keep in mind that LiquidArea and LiquidStage are built for convenience in the sense that you can build all your stuff as though it is positioned at the ORIGINAL (native) size at which you built your swf and then it will adjust things if/when the stage is resized (like to fill the browser). I say this because some of your code is using the stage.stageWidth/stageHeight to set the initial size of the LiquidArea, but you shouldn't do that, otherwise it makes the resizing redundant. In other words, make your LiquidArea without any concern for the stage size - build it as though everything is at the native size of your swf. (to be clear, LiquidStage and LiquidArea can accommodate attaching things after the stage resized but it's not the typical usage and I'm trying to simplify things here).

 

Also, is your swf filling the browser or is it at a set size inside the browser (with gaps on each side)?

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...