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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:52:28+00:00 2026-06-10T21:52:28+00:00

flex 4.6 I am wondering how to access/change an object using a var passed

  • 0

flex 4.6

I am wondering how to access/change an object using a var passed to a function, for example if I have the id vg1Text, using

Application.application.vg1Text.text = txt2chg+":"+id2chg;

works but

Application.application.id2chg.text = txt2chg+":"+id2chg;

fails with

ReferenceError: Error #1069: Property id2chg not found

thx Art

module

public function chgFuncB1(txt2chg, id2chg):void {
    Application.application.id2chg.text = txt2chg+":"+id2chg;
    }
public function myFunc() : void{
   chgFuncB1("New Text", "vg1Text");
   }

Main Application

<s:VGroup id="vg1">
    <s:Label id="vg1Text" text="Module loaded in Spark VGroup container:"/>  
</s:VGroup>
  • 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-06-10T21:52:29+00:00Added an answer on June 10, 2026 at 9:52 pm

    To make this work, you can use the array notation (hope that’s the correct name for it). In this way, the String contained in the variable id2chg can be used as a property name.

    public function chgFuncB1(txt2chg:String, id2chg:String):void {
        Application.application[id2chg].text = txt2chg+":"+id2chg;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using flex 4.1 to write an application and I was wondering how can
I'm making an App using Adobe Flex/Air. I was wondering if there is any
Using Flex and Bison, I have a grammar specification for a boolean query language,
I wondering whats the difference between url and destination using httpservice in flex. I
I am wondering if it is possible to customize Flex Chart to have grids
I was wondering how to distort a Flex object like Panel so it looks
I wrote a flex application that get the host string from the browser using
I'm wondering is there any way to automate testing of Flex applications using HP
I am creating an Adobe Flex application for the Blackberry Playbook. I was wondering
I am building an IOS application using Flex 4.6 and AIR 3.3. I do

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.