Note that there are some explanatory texts on larger screens.

plurals
  1. POpassing array value from .as script to comboBox of .mxml code
    primarykey
    data
    text
    <p>How to pass <code>array</code> value from <strong>.as</strong> to the <code>comboBox</code> of <strong>.mxml</strong> code? I am calling a .as script in <strong>.mxml</strong> code. I have <code>&lt;mx:ComboBox&gt;</code> for which thr dataprovider is an <code>array</code> value coming from the same <strong>.as</strong> file. How to bind this to <code>combobox</code>? My both Codes are as follows:</p> <pre><code>// ActionScript file import flash.display.*; import flash.events.*; import flash.net.FileFilter; import flash.net.FileReference; import flash.net.FileReferenceList; import mx.controls.Alert; private var fr:FileReferenceList; private var fls:Array; private function folder():void { fr = new FileReferenceList(); fr.browse([new FileFilter("Zip Files", "*.zip")]); fr.addEventListener(Event.SELECT, listZipFiles); } private function listZipFiles(e:Event):void { Alert.show("selectHandler: " + fr.fileList.length + " files"); var file:FileReference = new FileReference; fls = new Array(); for (var i:uint = 0; i &lt; fr.fileList.length; i++) { file = FileReference(fr.fileList[i]); //Alert.show("File Name: " + fr.fileList[i]); Alert.show("File Name: " + file.name); fls.push(file); } Alert.show("fls: " + fls); gotoCmboBx(fls); } private function gotoCmboBx(arr:Array):Array { } private function getShpFiles(event:MouseEvent):void { } </code></pre> <p>and .mxml code is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&gt; &lt;mx:Script source="Asset/folder.as" /&gt; &lt;mx:Button x="10" y="10" label="My Button" width="122" height="31" id="myButton" click="folder()"/&gt; &lt;mx:ComboBox x="10" y="49" id="cbobx" dataProvider="{fls}" &gt;&lt;/mx:ComboBox&gt; &lt;/mx:Application&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload