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 6047643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:22:23+00:00 2026-05-23T07:22:23+00:00

In Flex 4, I am trying to make a simple browse button update the

  • 0

In Flex 4, I am trying to make a simple browse button update the text field of an TextInput object with the file name that the browse button gets. It doesn’t have to be the full path, all I want is the file name to show up. It only shows up after hitting the browse button for a second time, not after I have selected my file the first time. Here is my code:

import flash.net.FileReference;

        private var fileReferencer:FileReference = new FileReference();
        private var excelFilter:FileFilter = new FileFilter("*.xlsx", "*.xlsx;*.xls;");
        protected var fileName:String = new String("");

        protected function BrowseButton_clickHandler(event:MouseEvent):void
        {
            fileReferencer.browse([excelFilter]);
            fileName = fileReferencer.name;
            fileInputAddress.text = fileName;
        }

So to recap, the file name is only shown in my TextInput box upon hitting the browse button a second time.

What am I doing wrong?

  • 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-23T07:22:24+00:00Added an answer on May 23, 2026 at 7:22 am

    Flash Player is completely asynchronous. So you can’t get file name right after calling fileReferencer.browse(). That’s why you have a name from the past call. To fix your code you should subscribe on select and cancel events and change the text after select event only (see the documentation).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Flex 3 with Flash 9. I'm trying to make a timer that
Im trying to make a simple HTTP URLReqest in Adobe Flex, heres the code
I'm new to Flex SDK and trying to implement a simple project using Doug
I'm trying to make a flexible, horizontal menu that will always have a total
I'm really novice with ActionScript and Flash/Flex. I'm trying to implement a multiple file
I'm trying to make a Flex Tree Component display the children of a sprite
I am trying to make tile wallpaper in flex. I did stretch or normal
I am trying to make a 'brush' tool in AS3 (pure, not Flex) which
I am using Flex 4 and AS3 and I am trying to make it
I'm currently writing an image editing application using Flex and I'm trying to make

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.