Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6319409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:48:08+00:00 2026-05-24T15:48:08+00:00

How to pass array value from .as to the comboBox of .mxml code? I

  • 0

How to pass array value from .as to the comboBox of .mxml code?
I am calling a .as script in .mxml code. I have <mx:ComboBox> for which thr dataprovider is an array value coming from the same .as file. How to bind this to combobox?
My both Codes are as follows:

// 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 < 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
        {

        }

and .mxml code is:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script source="Asset/folder.as" />
    <mx:Button x="10" y="10" label="My Button" width="122" height="31" id="myButton" click="folder()"/>
    <mx:ComboBox x="10" y="49" id="cbobx" dataProvider="{fls}"  ></mx:ComboBox>

</mx:Application>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:48:09+00:00Added an answer on May 24, 2026 at 3:48 pm

    The Array class is a top level Object and does not implement IEventDispatcher, which is required for binding. Try using an ArrayCollection instead.

    Update: To add items to an ArrayCollection you can either use the addItem() method, or you can use the push() method of the Array that ArrayCollection wraps in the property source. However, whenever you make direct changes to the source Array, you need to call the refresh() method.

    myArr.source.push(myFileReference);
    myArr.refresh();
    

    The addItem() method is preferred.

    Update 2: mx:ComboBox has a property labelField which determines what field from the items in the dataProvider to use. In order to display the name of a FileReference object, the following should do it:

    <mx:ComboBox dataProvider="{fls}" labelField="name"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to pass a value from the id attribute in my php
I need to pass an array from JavaScript to a page method in C#.
How do I pass an array I have created on the server side onto
how do i pass php array's to ruby script as an argument so that
I want to pass an array of objects from my QtScript to C++ but
I want to pass an array of key-value pairs as an argument to a
You can't use Enumerable#map to look up the same value from each element an
I want to pass an array from my Android application to my SOAP webservice
In MVC, is it possible to pass an array of string (List<string>) from C#
I am in a situation where I am trying to pass a value from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.