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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:15:18+00:00 2026-05-27T08:15:18+00:00

I have a label that get it’s value from a var when you click

  • 0

I have a label that get it’s value from a var when you click on a button. The var has already been declared:

public function clickevent
{
label.text = aVariable; 
}

Now I know that if i have a label like this:

<s:Label id="label2" text="{aVariable}"/> 

and aVariable is empty, label2’s text is Null (it doesn’t give an error, just “Null” in my situation). This is my current situation.

What I’d like to know is when I later on change the aVariable’s value to a string “hasChanged”, for example. The label2’s text should also change to “hasChanged” without the user having to push a button or anything to make this change. How can this be done?

  • 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-27T08:15:18+00:00Added an answer on May 27, 2026 at 8:15 am

    I’m not 100% sure I understand your question but if your variable is declared as “bindable”, no matter if your script change its value or a button, your text propertie of the label will follow as it is binded.

    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" 
        xmlns:mx="library://ns.adobe.com/flex/mx">
    
        <fx:Script>
            <![CDATA[
                [Bindable]
                private var aVariable:String;
    
                protected function button1_clickHandler(event:MouseEvent):void
                {
                    aVariable = "My new value";
                }
            ]]>
        </fx:Script>
    
        <s:layout>
            <s:VerticalLayout/>
        </s:layout>
    
        <s:Label text="{aVariable}"/>
    
        <s:Button label="Click me" click="button1_clickHandler(event)"/>
    
    </s:WindowedApplication>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a label that is using a repeater to get information form a
I have a Task object that has a collection of Label objects ... in
In other words, I have a UserControl that has, for example, a label on
I have Labels inside a Canvas, I need to get the label that intersects
I have a gtk.Notebook and i want get text of label from current gtk.noteBook
I am going to have a listview with links that get binded from the
I have a label that is sometimes empty. How do I set up a
I have a label on a splash screen that is displayed for 4 seconds.
I've got a multiline textBox that I would like to have a label on
i have this crazy label for each time i create a migration that use

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.