Jump to content
Search Community

Any tip to adapt Liquid Area to stage size?

CV-Gate test
Moderator Tag

Recommended Posts

Hello, I'm trying to adapt the size of some videos to the stage size using a Liquid Area.

 

The videos fit on the stage properly, well, almost fine. The only problem is that resizing the browser in a non proportional way, some black gaps appear at bottom and right sides.

 

Constraining the browser, I can see the gaps on the opposite sides. This makes me think that the Liquid Stage is handling the position of the Liquid Area over a non desired pin.

 

I tried with strict: false, autoPinMode:false, etc...

 

Maybe it's a problem with the registration points of the videos or attaching them to the Liquid before loading, but I don't think so because the Area preview acts exactly the same.

 

Any idea?

 

Thanks in advance!

 

liquid = new LiquidStage(this.stage,stage.stageWidth,stage.stageHeight);
area = new LiquidArea(this,0,0,stage.stageWidth,stage.stageHeight,0,0);
area.attach(preloader_mc, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE, vAlign:"top", crop:true});

Link to comment
Share on other sites

Thanks a lot for your answer. The swf is 100% size and noescale. I'm using swiffit to take control of the scrollbar but nothing else.

 

I'm getting also the same behaviour in the swf movie without html.

 

Perhaps I didn't explain fine, sorry for my bad english. What I'm trying to do is this:

 

The video adapts to the stage, expanding the browser expands the video, resizing the browser resizes the video but if it's not proportional resized instead of showing gaps it crops the video, mainly on the horizontal side.

 

Is this possible using liquid stage?

 

Thanks a lot for your time.

Link to comment
Share on other sites

If I understand your question correctly, yes, you should be able to do that using a LiquidArea that fills the entire original stage size, and uses a scaleMode of PROPORTIONAL_OUTSIDE. Don't set any special scaleMode or crop or anything like that on your VideoLoader or its ContentDisplay - that would duplicate the work. Just let LiquidArea handle the resizing.

Link to comment
Share on other sites

Yes you were right! I was duplicating the proportional outside parameter. Now it fits perfect.

 

However the performance is very poor, is there any way to optimize? Perhaps I shouldn't attach the whole video loader because it has 12 videos on que. Is it possible to attach only the current video? I tried with content display and rawcontent but I only get black.

 

Thanks!

Link to comment
Share on other sites

It should be fine if you attach them all, but I would definitely recommend setting the "visible" property to false for the ones that aren't active/playing (the ContentDisplay objects). That allows Flash to ignore them when doing its graphics rendering (which is by FAR the biggest CPU drain).

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