This content has been marked as final.
Show 7 replies
-
1. Re: liquid layouts not quite working... help!
breez11 Aug 12, 2007 9:58 PM (in response to RGracia)Stage.width;
Stage.height; -
2. Re: liquid layouts not quite working... help!
breez11 Aug 12, 2007 10:00 PM (in response to breez11)check out how I do it
-
3. Re: liquid layouts not quite working... help!
RGracia Aug 13, 2007 5:59 AM (in response to RGracia)Thanks breez11 but if I do what you suggest, the bg photo will eventually distort when the user resizes the stage to anything other than a 4:3 aspect ratio. I need ActionScript that will make sure the aspect ratio of the bg mc always remains correct while making sure there are no white areas on the screen, so always covered by the bg mc. -
4. Re: liquid layouts not quite working... help!
RGracia Aug 13, 2007 8:10 AM (in response to RGracia)I think a more complex issue here is that pixel based measurements when dealing with 4:3 aspect images is not as easily translated on the screen. I am sure the screen resolution is playing a big part in the way the player detects the stage size. -
5. Re: liquid layouts not quite working... help!
Rothrock Aug 13, 2007 8:41 AM (in response to RGracia)first breez1 – in AS2 you are correct, that is how to get properties of the Stage object. In AS3, it has changed.
Next for RGracia, here is a neat trick that will make your code a bit easier to read and follow – at least it made things easier for me. It is called the ternary operator and it allows you to do a conditional and then assignments all in one step. So you can do something like:
bg.width = (sw > sh) ? sw : sh * 1.33
That basically reads as, if sw is larger than sh assign the value sw to bg.width otherwise assign sh times 1.33 to bg.width. Basically if the part in parens is true then the value before the colon is assigned and if the part in parens is not true then the part after parens. Neat, huh?
Over all the basic set up here seems more or less correct. I'm wondering if the problem comes from the tweens? I don't see anyplace where you are stopping and deleting the old tweens. Remember the RESIZE event happens a bunch of times when you resize the window. Not just at the end of the movement – at least I think that is what happens. So you might be assigning crazy multiple tweens? Just a thought, you might just want to try it without the tweens first to get it jumping to size, then try and make the tweening work.
I don't think screen resolution is playing any part in the the way the player detects the stage size. The stage size is the size it is. I do remember when I was doing something like this using AS2 and there was a bug with the way Firefox (or was it Safari) sent the resizing events when I would change just the height of the browser window. If I was just adjusting the height of the window, no event was fired. As soon as a I adjusted the width, BANG, they would both jump to the correct values. Perhaps that is what you are experiencing?
Can you provide a link to the page?
-
6. liquid layouts not quite working... help!
RGracia Aug 13, 2007 9:36 AM (in response to RGracia)I think you are right:
I should try removing the tweens to see what behavior I get.
[ Over all the basic set up here seems more or less correct. I'm wondering if the problem comes from the tweens? I don't see anyplace where you are stopping and deleting the old tweens. Remember the RESIZE event happens a bunch of times when you resize the window. Not just at the end of the movement – at least I think that is what happens. So you might be assigning crazy multiple tweens? Just a thought, you might just want to try it without the tweens first to get it jumping to size, then try and make the tweening work.]
Here's a link to the test file I am working with. Make sure you resize at least once to see the effect:
http://rgracia.com/liquid/ -
7. liquid layouts not quite working... help!
RGracia Aug 26, 2007 2:22 PM (in response to breez11)Well here's how I ended up fixing it. This is the AS3 version.


