flex 에서 getUrl() 와 같은 기능을 사용하려면~~
LinkBar control
A LinkBar control defines a horizontal or vertical row of LinkButton controls that designate a series of link destinations. You typically use a LinkBar control to control the active child container of a ViewStack container, or to create a standalone set of links.
The following shows an example of a LinkBar control that defines a set of links:
A LinkBar control has the following default properties:
Property |
Default value |
---|---|
Preferred size |
A width wide enough to contain all label text, plus any padding and separators, and the height of the tallest child. |
Control resizing rules |
LinkBar controls do not resize by default. Specify percentage sizes if you want your LinkBar to resize based on the size of its parent container. |
Padding |
2 pixels for the |
Subtopics
Creating a LinkBar control
One of the most common uses of a LinkBar control is to control the active child of a ViewStack container. For an example, see ViewStack navigator container.
You can also use a LinkBar control on its own to create a set of links in your application. In the following example, you define a itemClick
handler for the LinkBar control to respond to user input, and use the dataProvider
property of the LinkBar to specify its label text. Use the following example code to create the LinkBar control shown in the previous image:
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:LinkBar borderStyle="solid"
itemClick="navigateToURL(new URLRequest('http://www.adobe.com/' +
String(event.label).toLowerCase()), '_blank');""> <mx:dataProvider> <mx:Array> <mx:String>Flash</mx:String> <mx:String>Director</mx:String> <mx:String>Dreamweaver</mx:String> <mx:String>ColdFusion</mx:String> </mx:Array> </mx:dataProvider> </mx:LinkBar> </mx:Application>
In this example, you use the <mx:dataProvider>
and <mx:Array>
tags to define the label text. The event object passed to the itemClick
handler contains the label selected by the user. The handler for the itemClick
event constructs an HTTP request to the Adobe website based on the label, and opens that page in a new browser window.
You can also bind data to the <mx:dataProvider>
tag to populate the LinkBar control, as the following example shows:
Revised 9/25/06: Added [Bindable] metadata tag.
<mx:Script> <![CDATA[ [Bindable] private var linkData:Array = ["Flash", "Director", "Dreamweaver", "ColdFusion"]; ]]> </mx:Script> <mx:LinkBar horizontalAlign="right" borderStyle="solid"
itemClick="navigateToURL(new URLRequest('http://www.adobe.com/' +
String(event.label).toLowerCase()), '_blank')"> <mx:dataProvider> {linkData} </mx:dataProvider> </mx:LinkBar>
In this example, you define the data for the LinkBar control as a variable in ActionScript, and then you bind that variable to the <mx:dataProvider>
tag. You could also bind to the <mx:dataProvider>
tag from a Flex data model, from a web service response, or from any other type of data model.
![]() | ||||
![]() |
![]() |
![]() | ||
![]() |
![]() |
Popup | ![]() |
![]() |
![]() |
![]() |
![]() | ||
![]() |
Flex 2
Comments
juan.mendez said on Nov 10, 2006 at 11:28 AM : thx1138 said on Dec 29, 2007 at 2:17 PM :