Googolflex!!
  • Home
  • About
  • Contracting

Recent Posts

  • Sprint’s new “Simply ‘Almost’ Everything®” Plans
  • CSS Changes in Flex 4
  • Dotted Underline LinkButton (Flex)

About The Author : jwd

This is John Dusbabek's tech blog. John is a software engineer and Flex developer in Provo, UT, where he lives with his lovely wife and four sons.

Recent Comments

  • Nikos on Flex: Binding to an Interface
  • Iain Hosking on Apache mod_proxy_balancer: No Protocol handler was valid

Archive for June, 2008

Jun
10

Scrolling VBox

Posted by: jwd | Comments (1)

If you give a Flex VBox a fixed height and then fill it with children that exceed that height, the vertical scroll policy kicks in and the VBox scrolls.  I try to design my applications to look good on different resolutions and in different window sizes, which means I rarely set a fixed height for my VBoxes, opting for percentage heights instead.  The problem I encounter is that it’s nearly impossible to get a variable height VBox to scroll.  It will always expand to hold all its children, forcing the application (or other parent) to scroll on its behalf.

One of my coworkers was struggling to get his application to behave correctly in this respect, and so I set to creating a vbox that can be set to a percentage height and width, and will also scroll rather than expand the boundaries of the application.

I was able to accomplish this by simply nesting a VBox within a Canvas.  Then I overrode the following methods:

  • addChild
  • removeChild
  • removeAllChildren
  • addChildAt
  • removeChildAt

so that when adding children to the component, they would be added to the VBox, not the Canvas. 

I had to be careful, because the VBox had to be added to the Canvas somehow (do you see the circular reference problem?)– I just did a check to see if the child was the VBox.  If it was I added it as a child of the Canvas using a call to super.addChild().
Now when I set the height to 50%, the Canvas will remain staunch at 50% and the VBox will scroll once it reaches the borders of the Canvas.

This might be sufficient for use within Actionscript, but I also wanted to be able to add children using MXML.  This will be easier to see in the code, but what I did was create an array of children and make it the default property of the ScrollableVBox.  I also overrode the commitProperties method to check if the children array had changed, and if so I iterated through the children and made them children of the VBox.  I accomplished this detection by using a Boolean flag and the set method of the children array.  This procedure is described in the Flex documentation here, look for subheading "Implementing the commitProperties() method.

Download the ScrollableVBox source here.

Categories : Actionscript, Flex 2, Flex 3, Scalability
Comments (1)
Jun
10

Incompatible Stickers

Posted by: jwd | Comments (0)

Anyone who has ever ordered a computer online (particularly from HP’s site) should be able to relate to this… As you use the drop down boxes to select the features you want for your computer the web app keeps a diligent eye open for any conflicts among your selections.  Although a truly user friendly site would not even display a conflicting choice, much less choose it… let’s overlook that and just  say that it’s a helpful feature inasmuch as it points out hardware incompatibilities and the like.

There were two instances when I’ve found this helpful feature to be a bit too helpful.  The first happened nearly a year ago when the HP laptops were JUST starting to become available with 4GB of RAM.  (Side note: my wife says I can’t get a new laptop until I graduate, which I’ve been on the brink of for the past year or so.  So I frequently window shop for laptops).  I selected the 4GB of RAM, and was notified that I had to choose a 64 bit operating system.  I knew this was not the case (you can have 4GB installed on a 32-bit OS… it might not all be available, but it won’t break the system), regardless, I had specifically chosen not to upgrade to the more expensive 64-bit OS because I had 64-bit OSs available to me already.

I decided to call HP sales and ask them about it, and they told me flatly that it couldn’t be done.  The cost of the 4GB RAM upgrade was $700, which I pointed out to them, but they still insisted that they couldn’t sell me a computer with 4GB of RAM and a 32-bit OS.  About 4 months later, I discovered that the system did not bark about that particular conflict anymore.  I thought maybe somebody got a clue – that is until I started looking at their business laptops (which I became converted to because you can get the WUXGA screens with them, and not the home/office line… I’m not even about to call them and ask them why they can’t put one of them on their home/office computers as Dell seems to have no problem doing it).

Here you can actually choose your stickers.  However, as the system will point out, there is a conflict between Windows XP and the Vista sticker, and vice versa.  You can get Vista with the XP downgrade, which is compatible with the Vista sticker… otherwise you’ll have to select the XP sticker.  Make sure you have a compatible processor too, if you want the Core 2 Duo sticker.

incompatible-label

I did recently get a Dell, which is less picky about stickers, and as an experiment I took the Vista sticker off of it and put it on my HP laptop running Windows XP… and sure enought it still works.  I don’t dare try sticking the Intel Core 2 Quad sticker on it though, my laptop is a few years old.

Categories : OS's
Comments (0)

Search

Feedburner

Subscribe to

Get the latest updates delivered via email

Calendar

June 2008
M T W T F S S
« May   Jul »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Archives

  • July 2010 (1)
  • June 2010 (2)
  • May 2010 (1)
  • February 2010 (11)
  • January 2010 (3)
  • December 2009 (5)
  • November 2009 (1)
  • August 2009 (8)
  • July 2009 (8)
  • May 2009 (4)
  • April 2009 (1)
  • March 2009 (6)
  • January 2009 (1)
  • November 2008 (4)
  • October 2008 (5)
  • September 2008 (1)
  • August 2008 (5)
  • July 2008 (1)
  • June 2008 (2)
  • May 2008 (8)
  • April 2008 (5)
  • March 2008 (2)
  • February 2008 (3)
  • January 2008 (1)
  • December 2007 (6)
  • November 2007 (9)
  • October 2007 (1)
  • September 2007 (2)

Categories

Tag Cloud

adobe apache Architecture book review C++ centos client server architecture Custom Components database Design error message fedora flash catalyst flex Flex 3 Flex 4 fms iis 6 Interaction Design load balancing master-master master-slave mod_proxy_balancer Monkey Patching MySQL no protocol p2p peer to peer Perl PHP Red5 regex replication self registration selinux Shell Scripting shortcut manager skins socket policy file sockets states stored procedures stratus tools workflow

Coworkers

  • Casey Jackman
  • Sean Murphy

Family

  • Emily & CJ
  • Family Blog
  • Gary Dusbabek

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

RSS FlexExamples

  • Styling the text selection format on a Spark TextArea control in Flex 4
  • Setting the scale mode on a Spark Image control in Flex Hero
  • Setting the fill mode on a Spark Image control in Flex Hero
  • Setting a bitmap image fill on a Spark Form container in Flex Hero
  • Setting a bitmap image fill on a Spark FormHeading control in Flex Hero

Spam Blocked

847 spam comments
blocked by
Akismet

Sponsored Links

JUICE Chat

BYU Adobe Users Group


Copyright © 2010 All Rights Reserved
Flexx Theme by iThemes
Powered by WordPress