Jump to content
Search Community

LiquidStage inconsistency

eigenface test
Moderator Tag

Recommended Posts

The layout I've put together with LiquidStage renders differently depending on whether I open the swf by compiling with CS3, double-clicking on the compiled swf, or opening it with Firefox.

 

I have an image, a horizontal grey bar behind the image, and a white background box. I want the image to scale with a constant aspect ratio as the stage is resized. I have a horizontal grey bar sitting behind the image at the same y-value as the image with the same height as the image, which I want to stretch vertically so it's always the same height as the image, whatever that height may be as the image scales. I also want the grey bar to stretch horizontally so it reaches all the way across the stage, whatever width the stage may have. The white box should always stretch to fill the entire stage. Here's my code:

 

stage.tabChildren = false;

stage.showDefaultContextMenu = false;

stage.scaleMode = StageScaleMode.NO_SCALE;

 

LiquidStage.init(stage, 1260, 735, 0, 0);

 

var wrapper:LiquidWrapper = new LiquidWrapper(image, NaN, NaN, LiquidWrapper.ALIGN_TOP, LiquidWrapper.ALIGN_LEFT);

LiquidStage.stretchObject(wrapper, LiquidStage.TOP_LEFT, LiquidStage.TOP_RIGHT, LiquidStage.BOTTOM_LEFT);

 

var pinPoint:PinPoint = new PinPoint(image.width, image.height, image);

LiquidStage.stretchObject(greyBar, LiquidStage.TOP_LEFT, LiquidStage.TOP_RIGHT, pinPoint);

 

LiquidStage.stretchObject(whiteBox, LiquidStage.TOP_LEFT, LiquidStage.TOP_RIGHT, LiquidStage.BOTTOM_LEFT);

 

This works correctly when I compile from CS4, but when I double click on the swf, the grey bar is always slightly taller than the image, and when I open with Firefox, the grey bar is a lot taller than the image. Is there a way to keep the bar the same height as the image no matter how I open the swf?

Link to comment
Share on other sites

It's tough to troubleshoot without seeing the FLA - it looks like the problem might be due to the fact that your custom PinPoint has no parent defined, so it uses the main stage as its reference point. If you have your image at coordinates other than 0,0, that would explain why the PinPoint isn't where you'd expect. Could you please e-mail me a sample FLA that demonstrates the issue?

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