Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
brantseibert

LiquidArea Anchor to Top

Recommended Posts

What is the best syntax to use to anchor a Liquid Area to the top?

 

var ls:LiquidStage = new LiquidStage(this.stage, 1000, 500, 1000, 500);

...

var la2:LiquidArea=new LiquidArea(this,35,90,930,400);

la2.attach(mask1, ScaleMode.PROPORTIONAL_INSIDE);

 

This code is working great. But I would like to improve it by anchoring la2 so that it stays at y=90. Currently it floats down on large browser sizes.

 

PLEASE post a code example with the proper syntax. I am syntacticly challenged. After I see one code example, I can riff from there and develop an understanding by using it.

 

Thanks so much.

 

p.s. The generic question is if it is possible to anchor something that is ScaleMode.PROPORTIONAL_INSIDE. But, again, seeing the code would be immense help. Much obliged.

Link to comment
Share on other sites

Are you saying that the LiquidArea itself floats down on large browsers or your mask1 object? The LiquidArea should stay put (set its preview = true to visually see the area just to make sure). I bet the problem is that your mask1 is drifting down because by default, LiquidArea always uses a center alignment vertically and horizontally for attached objects. Again, it helps a lot to turn preview on for the LiquidArea so that you can see exactly how/where things are aligning.

 

It's easy to make your attached object align at the top of the LiquidArea using the vAlign parameter of the attach() method, like:

 

var ls:LiquidStage = new LiquidStage(this.stage, 1000, 500, 1000, 500);
...
var la2:LiquidArea=new LiquidArea(this,35,90,930,400);
la2.attach(mask1, ScaleMode.PROPORTIONAL_INSIDE, AlignMode.CENTER, AlignMode.TOP);

 

Does that fix it for you?

Link to comment
Share on other sites

Great, thanks. The code sample was just what I needed. Cheers.

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