Jump to content
Search Community

Custom PinPoint in LiquidStage [SOLVED]

myFlashBlog test
Moderator Tag

Recommended Posts

I'm trying to figure out how to pin the upper left corner of my image to a specific x,y coordinate on my stage, while allowing the image to grow larger as the browser window resizes.

 

Is it possible to do the following:

 

LiquidStage.pinObject(mc, x:300, y:100, false, 0, Elastic.easeOut);

 

Any help would be appreciated.

 

Thanks.

Link to comment
Share on other sites

If you want your object to stretch as the browser resizes, you'd use the stretchObject() instead of pinObject(). Assuming your object is already positioned with its top left corner where you want it and its bottom right corner where you want it (before any stage resizing occurs), you'd do:

 

LiquidStage.stretchObject(mc, LiquidStage.TOP_LEFT, LiquidStage.TOP_RIGHT, LiquidStage.BOTTOM_RIGHT);

 

Then when the stage resizes larger, it will stretch your object's width/height and keep it exactly the same distance from the bottom right corner as it started. Make sense?

Link to comment
Share on other sites

So pinObject is just used to pin an object relative to another object controlled with LiquidStage?

 

No, pinObject will pin the object relative to whatever PinPoint you define. For example, let's say you have a logo that is 100 pixels away from the TOP_RIGHT PinPoint (which just means the top right corner of the stage at the size it was when you built it in Flash). If you pin it to the TOP_RIGHT, it will always remain exactly 100 pixels away from the TOP_RIGHT even when the stage expands to a different size. Make sense? So it's very flexible. Many other classes will force your object to an absolute position, but LiquidStage allows the points to be relative.

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