PS2 Resizing Deliverable

2 views
Skip to first unread message

Michael Bernstein

unread,
Feb 28, 2010, 7:01:44 PM2/28/10
to Alex Jiang, 6.813
This might be useful to the rest of the class as well:

Right, the entire component should size to fill your browser window at runtime, and adapt to fill the browser window as you resize the browser.  But, don't overthink this task --- width and height attributes in Flex can be set to percentages.
- Michael

On Sun, Feb 28, 2010 at 6:23 PM, Alex Jiang <jia...@mit.edu> wrote:
Hi Michael,

I'm working on the last part of the pset with window resizing. I make everything a part of a Grid layout which looks perfectly fine. But when I try to resize the browser window (I assume this was is meant by resizing?), the interface doesn't fill out the whole window, it stays the same size. Am I using the right container? I tried searching Grid and resizing but nothing came up.

Thank you,
Alex

Lauren White

unread,
Feb 28, 2010, 7:11:10 PM2/28/10
to 68...@googlegroups.com
Dear Michael,

I have done the same as Alex and have percentages on my grid, but when
I use the percentages the grid doesn't seem to resize with the
browser, rather the browser gets scroll bars. I was trying to look on
the internet how to avoid this but haven't found anything.

I have also tried creating a resize handler for the application, but
it looks like the application is not getting resized when i size the
browser.

Sincerely,
Lauren

--
Lauren White
Department of Electrical Engineering and Computer Science
MIT Class of 2009
615-406-6865
llw...@alum.mit.edu

Tobe Nwanna

unread,
Feb 28, 2010, 7:17:57 PM2/28/10
to 68...@googlegroups.com
I just got it to work. Something to check is the xml tags at the top. The color size seems to affect resizing for some reason

Alexander M Patrikalakis

unread,
Feb 28, 2010, 7:21:02 PM2/28/10
to 68...@googlegroups.com, Lauren L White
Michael,

I also am using percentages in the custom grid instance in the application, and in the UI elements that need to be maxed out horizontally and vertically in the individual grid items, namely the search field and the dictionary list.

I tried putting the Grid simply in the Application, and I also tried putting the Grid in a Canvas, also setting the canvas' width and height to maximum percentages, and was not able to achieve the desired effect of having a resizable Grid layout.

Ideas?

Alex

Alex Jiang

unread,
Feb 28, 2010, 7:22:41 PM2/28/10
to 68...@googlegroups.com
Make sure the percentWidth and height for the entire Application is set
to 100.

Matthew S Goldstein

unread,
Feb 28, 2010, 7:23:55 PM2/28/10
to 68...@googlegroups.com, Lauren L White
It sounds like you're setting the grid to fill the entire
application/canvas, but are you setting the size of the application itself
to fill all space as well?

--matt

Alexander M Patrikalakis

unread,
Feb 28, 2010, 7:25:11 PM2/28/10
to 68...@googlegroups.com
Yes, I set width="100%" and height="100%" for the mx:Application root element as well.

Alex

Joseph Tennent

unread,
Feb 28, 2010, 7:25:36 PM2/28/10
to 68...@googlegroups.com
In my case, I went back and set height="100% and width="100%", and the
resizing isn't working for me yet either.

Alexander M Patrikalakis

unread,
Feb 28, 2010, 7:32:13 PM2/28/10
to 68...@googlegroups.com, Tobechukwu G Nwanna
Tobe

Per your suggestion below, I just removed all references to color from my application element, and the enclosed grid element, and I am still not able to elicit the desired resizing behavior.  Are you doing something else?

Alex

Aleks Tamarkin

unread,
Feb 28, 2010, 7:34:16 PM2/28/10
to 68...@googlegroups.com, Tobechukwu G Nwanna

You do not need grid to do this. Click the application window. Go to design. Remove all the nonsense numbers at the bottom (hilite and press backspace).

Alan Anderson

unread,
Feb 28, 2010, 7:38:35 PM2/28/10
to 68...@googlegroups.com, Tobechukwu G Nwanna

I was able to accomplish this by setting the grid width and height to 100%.  I set the GridRow height and width to 100%, the GridItem's width to 100% and finally the corresponding components need to have their width and height attributes set.  It's like a hierarchy where setting an attribute to 100% it will fill its parent 100%, but if the parent is set to a static size then, it won't resize.  Does that make sense?

Alan

 

From: 68...@googlegroups.com [mailto:68...@googlegroups.com] On Behalf Of Alexander M Patrikalakis
Sent: Sunday, February 28, 2010 7:32 PM
To: 68...@googlegroups.com; Tobechukwu G Nwanna
Subject: Re: PS2 Resizing Deliverable

 

Tobe

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2713 - Release Date: 02/28/10 14:34:00

Tobe Nwanna

unread,
Feb 28, 2010, 7:40:47 PM2/28/10
to Alan Anderson, 68...@googlegroups.com
Yeah, all I can say is to make sure everything you want to be able to dynamically resize, make a percentage instead of a value, the grid components AND the elements in them

Alexander M Patrikalakis

unread,
Feb 28, 2010, 7:43:34 PM2/28/10
to 68...@googlegroups.com
got it, thanks

Joseph Tennent

unread,
Feb 28, 2010, 7:49:39 PM2/28/10
to 68...@googlegroups.com
Mine works now as well, except for one tiny detail. There seems to be a
minimum width that the text box/field will shrink to. I've tried
setting minWidth to something low (1, in other words), and I still can't
get around that. Other resizing works, so can I still get full credit
even if it won't shrink all the way?

Alexander M Patrikalakis wrote:
> got it, thanks
>
> On Feb 28, 2010, at 7:40 PM, Tobe Nwanna wrote:
>
>> Yeah, all I can say is to make sure everything you want to be able to
>> dynamically resize, make a percentage instead of a value, the grid
>> components AND the elements in them
>>
>> Alan Anderson wrote:
>>>
>>> I was able to accomplish this by setting the grid width and height
>>> to 100%. I set the GridRow height and width to 100%, the GridItem's
>>> width to 100% and finally the corresponding components need to have
>>> their width and height attributes set. It's like a hierarchy where
>>> setting an attribute to 100% it will fill its parent 100%, but if
>>> the parent is set to a static size then, it won't resize. Does that
>>> make sense?
>>>
>>> Alan
>>>
>>>
>>>

>>> *From:* 68...@googlegroups.com [mailto:68...@googlegroups.com] *On
>>> Behalf Of *Alexander M Patrikalakis
>>> *Sent:* Sunday, February 28, 2010 7:32 PM
>>> *To:* 68...@googlegroups.com; Tobechukwu G Nwanna
>>> *Subject:* Re: PS2 Resizing Deliverable

Michael Bernstein

unread,
Feb 28, 2010, 8:23:45 PM2/28/10
to 68...@googlegroups.com
Joseph, if I'm understanding you correctly, that should be fine for the purposes of this assignment.  IE and Firefox don't seem to be able to get much thinner than 150 pixels or so for me anyways.

Happy coding!
- Michael
Reply all
Reply to author
Forward
0 new messages