Adobe Flex 3 Nested Radio Buttons

28. May 2009

NestedRadioButtons I’ve been working on a Flex radio button component that will allow users to select nested options.  The control accepts an XMLList as the data source for the button options, and expands to show nested buttons beneath selected options according the data passed in to it. The nest level of radio buttons is essentially infinite.

The best way to understand it is to take a look.

Live Example     View Source

For the moment, this is only a proof-of-concept version of the control. The control has 2 values to indicate selected values. One is bottomValue which holds only the value of the bottom-most selected radio button. The other is fullValue which holds a comma separated list of values beginning with the top-most value and ending with the bottom-most value.

With this version of the component, you can also pass in an initial bottomValue and the control will select all of the parent radio buttons recursively and accurately fill in the fullValue field.

Flex developers: Check out the control and let me know what you think! If there is significant interest, I’ll work on revising the component to feel more like a native Flex Framework control and add some additional features to it. It’s usable as is, but needs work to polish it up before it can used efficiently and reliably in a live Flex application.

Adobe Flex

 Popping up HTML with Flex

29. January 2009

I made a new example showing 3 ways to pop-up HTML content with Flex 3.2. You can view the example here:

Demo: http://www.brentlamborn.com/examples/popup/

Source: http://www.brentlamborn.com/examples/popup/srcview/index.html

I also posted an article over at the Flex Cookbook.

 

Adobe Flex

 Embed YouTube Videos Inside A Flex Application

23. December 2008

I recently ran across a question in a Flex forum from a visitor asking how to embed YouTube videos inside Flex . The solution is very simple. Since the YouTube player is a Flash object itself,  we can simply use the SWFLoader object to load the Youtube video into our Flex app. You just need to copy the embed code on the YouTube page for the video you want to embed in your application. It will look like this:

 

<object width="425" height="344"><param name="movie" 
value="http://www.youtube.com/v/zlfKdbWwruY&hl=en&fs=1">
</param><param name="allowFullScreen" value="true">
</param><param name="allowscriptaccess" value="always">
</param><embed src=http://www.youtube.com/v/zlfKdbWwruY&hl=en&fs=1
 type="application/x-shockwave-flash" 
allowscriptaccess="always" allowfullscreen="true" 
width="425" height="344"></embed></object> 
 
 

Then just grab the URL to the video from the embed code and use it as the source property for your SWFLoader.  I created a working sample here with view source enabled.

Adobe Flex