Execute
Save
Share
Share link
share
share
share
Team
Public Teams
Comments
0
Created By:
Guest
Title:
Title
Description
Edit
Copy Link
Login
Email *
Password *
Login
OR
Create Account
Screen Name *
Email *
Password *
Retype Password *
Team Access Code
Register
Public CodeBins
HELP
--Select Theme--
Ambiance
Blackboard
Cobalt
Eclipse
Elegant
Erlang-Dark
Lesser-Dark
Monokai
Neat
Night
Rubyblue
Vibrant-Ink
Xq-Dark
New CodeBin
CodeBins Versions
08/20/2015- V.8
08/20/2015- V.7
08/20/2015- V.6
08/20/2015- V.5
08/20/2015- V.4
07/23/2015- V.3
07/23/2014- V.2
08/27/2013- V.1
Compare Versions
Recent CodeBins
View All CodeBins
<? xml version = "1.0" encoding = "utf-8" ?> < s: Application xmlns: fx = "http://ns.adobe.com/mxml/2009" xmlns: s = "library://ns.adobe.com/flex/spark" xmlns: mx = "library://ns.adobe.com/flex/mx" xmlns: components = "components.*" minWidth = "955" minHeight = "600" viewSourceURL = "srcview/index.html" > < fx: Declarations > <!-- Place non-visual elements (e.g., services, value objects) here --> < /fx:Declarations> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var testDP:ArrayCollection=new ArrayCollection([{label:"Mike",value:"mike"},{label:"Tim",value:"tim"},{label:"Brian",value:"brian"},{label:"Tom",value:"tom"},{label:"Dick",value:"dick"},{label:"Harry",value:"harry"},{label:"Huey",value:"huey"},{label:"Dewey",value:"Dewey"},{label:"Louie",value:"louie"}]); [Bindable] private var testSI:Vector.<int>=Vector.<int>([1,2]); protected function button1_clickHandler(event:MouseEvent):void { trace('stop'); dropDown.enabled = !dropDown.enabled; } protected function fix(event:MouseEvent):void { dropDown.list.invalidateDisplayList(); } private function changeDataProvider():void{ dropDown.clearSelections(); var dp:ArrayCollection=new ArrayCollection(); for each(var obj:Object in testDP){ if(Math.random()>.5)dp.addItem(obj); } dropDown.dataProvider=dp; } private function selectRandomIndices():void{ var indices:Vector.<int>=new Vector.<int>(); for(var i:uint=0;i<dropDown.dataProvider.length;i++){ if(Math.random()>.5)indices.push(i); } dropDown.selectedIndices=indices; } private function selectRandomSelectedItems():void{ var items:Vector.<Object>=new Vector.<Object>(); for(var i:uint=0;i<dropDown.dataProvider.length;i++){ if(Math.random()>.5)items.push(dropDown.dataProvider.getItemAt(i)); } dropDown.selectedItems=items; } protected function getItems(event:MouseEvent):void { trace(dropDown.selectedItems); for(var i:int=0; i < dropDown.selectedItems.length; i++){ trace(dropDown.selectedItems[i].label); } } protected function getindices(event:MouseEvent):void { log.text += '\nSelected Indices ---------------'; trace(dropDown.selectedIndices); for (var i:int = 0; i < dropDown.selectedIndices.length; i++) { log.text += '\n' + String(dropDown.selectedIndices[i]) ; } if(dropDown.selectedIndices.length == 0) log.text += '\nNothing selected'; } ]]> </fx: Script > < s: layout > < s: VerticalLayout paddingLeft = "50" paddingTop = "50" gap = "50" / > < /s:layout> <s:Label width="300" text="Select multiple items to your hearts delight! Be sure to open the dropdown using tabbing, and select items with up down arrows and the shift key." / > < s: HGroup > < s: Button label = "selectAll" click = "{dropDown.selectAll()}" / > < s: Button label = "clearSelections" click = "{dropDown.clearSelections()}" / > < s: Button label = "changeDataProvider" click = "{changeDataProvider()}" / > < s: Button label = "selectRandomIndices" click = "{selectRandomIndices()}" / > < s: Button label = "selectRandomSelectedItems" click = "{selectRandomSelectedItems()}" / > < s: Button label = "inspect" click = "button1_clickHandler(event)" / > < s: Button label = "get items" click = "getItems(event)" / > < s: Button label = "get indices" click = "getindices(event)" / > < s: Button label = "fix" click = "fix(event)" / > < /s:HGroup> <components:MultiselectDropDownListOrig id="dropDown" dataProvider="{testDP}" listHeight="150" selectedIndices="{testSI}" width="200"/ > < s: TextArea id = "log" width = "500" height = "500" / > < /s:Application>
Bottom of Page
In Head
On Load
On Ready
Setting
Validate
Copy
Format
Setting
Validate
Copy
Format
No Doc Type
HTML5
HTML 4.01 Transitional
HTML 4.01 Strict
HTML 4.01 Frameset
XHTML 1.1
XHTML 1.0 Transitional
XHTML 1.0 Strict
XHTML 1.0 Frameset
Copy
Format
Download
×
Code Description
×
Difference of Versions
HTML
CSS
JS
×
JS Error
×
CSS Error
Errors
Warnings
×
JavaScript Setting
JS Libraries:
Chrome Frame 1.0.3
Dojo 1.8.0
Dojo 1.7.3
Dojo 1.7.2
Ext Core 3.1.0
jQuery 1.8.0
jQuery 1.7.2
jQuery 1.6.0
jQuery 1.5.0
jQuery 1.4.4
jQuery 1.4.0
jQuery-min 1.7.2
jQueryUI-min 1.8.21
MooTools more-1.4.0.1-full
MooTools core-1.4.5-full
MooTools core-1.4.1-full
Prototype 1.7.1.0
script.aculo.us 1.9.0
SWFObject 2.2
Twitter Bootstrap 2.0.4
WebFont Loader 1.0.28
yui 3.5.1
User Libraries:
Upload File
JavaScript URL(s):
×
CSS Setting
CSS Libraries:
jQueryUI 1.8.21
Twitter Bootstrap 2.0.4
User Libraries:
Upload File
CSS URL(s):