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

  • Home
  • SEARCH
  • 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 am going to have a listview with links that get binded from the
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 have a label that displays graphics card name, make and some other information,
I have a ul list, with 10 items, and I have a label that
I have Label controls in Panel controls that need to be updated. The Panel
I have a script where I submit some fields that get entered into a
I'm new to MVVM. I have a label in my view that looks like
I have searched already but unable to find an answer that works. I simply
I have a Label, let's call it currencyFormattedLabel, the value of which was earlier

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.