mx and qnx happliy playing together

I’m in the processing of updating the Meetup Search application for the BlackBerry PlayBook.  Last night I was busy trying to rearrange the search form options and realized that the mx:UIComponent was not returning width or height back in order to determine where to place the next component.  The qnx library used for the PlayBook require that an application be either completely in AS3 or use the mx:UIComponent to add the qnx fields; button, textinput, toggle switch, etc…   When developing the Meetup Search, I figured that using the mx tags, it would be easier to control the layout and possibly make it easier to convert the application from a PlayBook application to an Android application.  That doesn’t seem likely now, but I can always use the behind the scenes items to build the application, but the interface will have to be redone for each device.

Anyway, my initial thought was to create a mx:UIComponent for each item I wanted to add to the screen.  Since I wasn’t going to use all qnx components, this seemed logical.  Then last night I decided that I would use all qnx components and add them dynamically in order to change the text, size and position based on portrait or landscape layout.  When I discovered that the mx:UIComponent wasn’t returning height or width, I pondered if I could just use one mx:UIComponent and add all the qnx items to that.  Well, that’s exactly what I can do.   All components are added and can be repositioned and sized with just the one.  Hopefully this will keep down the application size and cause less problems.  Of course, it doesn’t make for a obvious layout design.


// Create Topic Picker
 topicsPicker = new Picker();
 topicsPicker.width = 300;
 topicsPicker.setListWidth(0,300);
 topicsPicker.addEventListener(Event.SELECT, setTopicText);

<s:Group id="optionsGroup">
 <mx:UIComponent id="optionsHolder" styleName="menuAppLabel" />
 </s:Group>

About DeanLogic
Dean has been playing around with programming ever since his family got an IBM PC back in the early 80's. Things have changed since BASICA and Dean has dabbled in HTML, JavaScript, Action Script, Flex, Flash, PHP, C#, C++, J2ME and SQL. On this site Dean likes to share his adventures in coding. And since programming isn't enough of a time killer, Dean has also picked up the hobby of short film creation.

About DeanLogic

Dean has been playing around with programming ever since his family got an IBM PC back in the early 80's. Things have changed since BASICA and Dean has dabbled in HTML, JavaScript, Action Script, Flex, Flash, PHP, C#, C++, J2ME and SQL. On this site Dean likes to share his adventures in coding. And since programming isn't enough of a time killer, Dean has also picked up the hobby of short film creation.