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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:10:01+00:00 2026-05-23T18:10:01+00:00

how can I access the value of a variable when writing XML code in

  • 0

how can I access the value of a variable when writing XML code in AS3? something like this:

var myVar:Number = 3;

var xml:XML =
    <myXML>
        <valueOfMyVar>???</valueOfMyVar>
    </myXML>

what do I have to replace ??? with?

  • 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-23T18:10:02+00:00Added an answer on May 23, 2026 at 6:10 pm

    ActionScript 3.0 now treats XML as a native data type meaning its no longer parsed as a String. That does bring with it that the old methods of inserting variable values (e.g. “”+myValue+””) no longer apply.

    Just take a look at the following snippet of code:

    var myVar:Number = 3;
    
    var xml:XML =
    <myXML>
        <valueOfMyVar>{myVar}</valueOfMyVar>
    </myXML>
    

    That’s right, the curly braces notation from MXML. One difference though, this is not an active reference to the variable. If you change the value of the variable this will not update your XML (no, not even in Flex — this is pure AS3 code but you can of course define the XML structure in MXML and take advantage of its data binding features).

    Also worth noting is that you don’t put quotes around the curly braces when you use it for an XML attribute, if you do that it’ll treat it as a String rather than eval’ing it. The XML object takes care of generating valid XML from it.

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

Sidebar

Related Questions

Groovy has a concept of GStrings. I can write code like this: def greeting
I can access a value like driver.my_friends[793659690].name but now I am using it in
I have this code function getSelectData(id) { jQuery(id).change(function () { var value=''; jQuery(id+ option:selected).each(function
I need to create a custom constraint annotation which can access the value of
Hey, I can't seem to access the returned value from a method I called
I can access my variable stored in a backing bean from my JSF2 page,
Just wondering can anyone tell me how to access the file field variable in
I would like to know if there is any way I can access an
I'd like to create a global variable in CakePHP. If I define something in
how can i access a variable that was intialsed in a function, but the

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.