Jump to content
GreenSock

Jume79

LiquidStage and Liquid Area design concepts...

Recommended Posts

Hi there,

 

I purchased the Greensock club membership mainly because I have to develop liquid size SWFs. Therefor the LiquidStage and LiquidArea seemed perfect. But working with this now for 1 week I don't fully understand the concept of these two. What I primary need is to have re-sizable SWF, where all display objects re-scale if I scale the main movie within limits of that SWF.

 

That works great but I have few questions:

 

1. I have a main SWF file which loads other exterlan SFWs in run-time (as3 with use of SWFLoader). Those are added to display list. So if I resize main SWF, the content in loaded SWFs resize too. Now I am doing it like this: I have LiquidStage and LiquidArea defined in the main SWF and I attach external SWFs to it:

_externalSwf = _swfLoader.rawContent;	
addChild(_externalSwf as Sprite);
_area.attach(_externalSwf as Sprite);

 

Then in external SWFs I load some external images and videos. In them I also use LiquidStage and LiquidArea again in the same way when adding these images and videos... This all works, but I wonder If this is the right concept? Or can I use LiquidStage and LiquidArea only in main SWF and all the content in loaded SWFs will be resized properly if I resize main SWF?

 

2. If I attach any display object which has Z property set to > or < then 0 then the attach method fails, saying can not use property of null object, or something like this?

 

Thank you,

Jume

Link to comment
Share on other sites

1) Yes, that sounds perfectly valid. Although if it's easier for you, it's fine to just use the SWFLoader's content (the ContentDisplay object) and attach() it immediately. The only catch is that if you're attaching it to a LiquidArea, you should define a width/height in the SWFLoader so that the ContentDisplay has a width/height - otherwise, LiquidArea wouldn't be able to know how much to scale it to fit.

 

2) Yeah, Flash implements 3D stuff in a rather odd way which causes that issue. When you set ANY 3D property, Flash nulls the transform.matrix and creates a transform.matrix3D on the object. LiquidArea (and AutoFitArea) must tap into the transform.matrix in order to properly stretch rotated objects. So LiquidArea and AutoFitArea aren't built for 3D objects which kinda makes sense since LiquidArea and AutoFitArea are simple Shape objects which are 2D.

 

Thanks for joining the club! Hope you're enjoying the bonus stuff.

Link to comment
Share on other sites

Hi Greensock,

 

thanks on your reply. What about LiquidStage and LiquidArea. Do I really need both or can I use only LiquidArea for my purpose. I don't need pinpointed things, all I want is my images, videos and other static content re-sizes. Does the LiquidArea work without a liquid stage?

Link to comment
Share on other sites

Yep, LiquidArea relies on LiquidStage - you cannot have a LiquidArea without first setting up a LiquidStage. Otherwise it couldn't know when to resize itself and where its corners need to be pinned, etc.

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