Adobe Flex Interview Questions - Bindable Property

January 1, 2010

Assume you want to build a “Custom Component”.  The Custom Componet is a VBox with a Bordered Label.  The Label needs to have one String Variable that we can use to pass a string into.  The first part of the code looks like this:

<mx:VBox xmlns:mx=”http://www.adobe.com/2006/mxml”
borderStyle=”solid” paddingBottom=”5″ paddingLeft=”5″ paddingRight=”5″ paddingTop=”5″
horizontalAlign=”center”  verticalAlign=”middle”>

<mx:Script>
<![CDATA[
[Bindable]
public var myString:String;
]]>
</mx:Script>

How would you define the Label in order to bind myString to the Label?

A) <mx:Label text=”{myString}”/>

B) <mx:Label text=”myString”/>

C) <mx:Label text=”(myString)”/>

Answer = “A”

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>