Jump to content
GreenSock

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

LiquidStage/LiquidWrapper query

Recommended Posts

first of all, I should point out that I've only been playing with this for a couple of hours since downloading it, so if I'm overlooking something that should be obvious, please excuse me. however...

 

it appears that anything wrapped within LiquidWrapper is appended to the end of the display list, hence is always in front of other graphics on the stage, which obviously makes it useless for scaling any background graphics. like I say, it could be operator error and maybe I'm missing something, but if there are any workarounds, I'd much appreciate it.

 

here's the code I'm using...

 

import gs.utils.*;

var wrapper:LiquidWrapper = new LiquidWrapper(OvalForBackground);

LiquidStage.init(this.stage, 550, 400);
LiquidStage.stretchObject(RectangleForBackground, LiquidStage.TOP_LEFT, LiquidStage.TOP_RIGHT, LiquidStage.BOTTOM_LEFT);
LiquidStage.stretchObject(wrapper, LiquidStage.TOP_LEFT, LiquidStage.TOP_RIGHT, LiquidStage.BOTTOM_LEFT);

 

where OvalForBackground and RectangleForBackground are movieclips on a layer beneath another movie clip on a foreground layer. but that movie clip is never seen as its hidden behind the one being scaled by LiquidWrapper. (I would attach the FLA so you can see exactly the setup, but attachment option tells me I can't upload FLAs)

 

 

I'm also having a problem with consistency in using LiquidStage to scale a movie clip that's using 9-slice scaling - the 9-slice scaling not always working as expected when resized to the stage with LiquidStage, but I'm still experimenting with that and will have to make another post when I can explain it more thoroughly. I only mention it now in case it's a known problem that someone has already solved.

 

 

thanks.

Link to comment
Share on other sites

A LiquidWrapper is just a DisplayObjectContainer, so you can put it anywhere you want in the display list. By default, yes, it adds itself to the top of the list, although you bring up a good point - it would be more intuitive to use the child's index by default. I updated the class in the link I sent you. Please download it and give it a shot.

 

Regardless, though, you can just move the LiquidWrapper around in the display list just like any other DisplayObject. For example, you could use setChildIndex().

 

As far as the Scale9 stuff, I'm not aware of any bugs with that - LiquidStage just does simple width/height property alterations which shouldn't cause any problems, but send me a broken FLA if you've got one (please zip it first and don't include LiquidStage).

Link to comment
Share on other sites

thanks a lot for the prompt and helpful reply; I'll download the update and check it out in the morning.

 

re: scale9 stuff, as I mentioned, I'm still experimenting - on some occasions it seemed okay, on others it was very definitely not working - but I'm going to continue checking it out to see exactly what I'm doing differently each time. either way, if I suss it out or not, I'll let you know.

 

thanks and goodnight from UK.

Link to comment
Share on other sites

couldn't resist checking out the revised LiquidWrapper script before turning in and all seemed well, so tried it in a bit more depth this morning and I'm pleased to report that's made all the difference and it now respects the front/back depth set manually on the stage. many thanks for such a responsive fix. now if it could just rescale to the same aspect ratio but cropped on the stage rather than letterboxed (as suggested in an email I sent you), it will be perfect. :)

 

thanks again!

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