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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:15:37+00:00 2026-05-10T20:15:37+00:00

Is there anything similar to getElementById in actionscript? I’m trying to make a prototype

  • 0

Is there anything similar to getElementById in actionscript?

I’m trying to make a prototype of a flash page wich gets it’s data from a xhtml file. I want to have both an accessible html version (for search engines, textreaders and people without flash) and a flash version (because the customer insists to use flash even though a html-css-ajax solution would do quite nicely).

What I need is a simple way of getting the text or attributes from the html with a certain id, like <h1 id='flashdataTitle'>This is the title</h1> etc. I’m guessing a few ways it might be possible:

  • Somehow use an ExternalInterface.call and do the DOM trickery in JavaScript (wich is probably what I will do, because I’m very familiar with JS and a complete newbie with flash/actionscript, unless you have a better solution)
  • Load the xhtml with the Actionscript XML class, and manually traverse the XML looking for the correct id attribute (but this is probably very slow)
  • Use XPath with the XML class in actionscript. (I’d like some hints on how to do this, if this is the reccomended way)
  • There is actually an Actionscript equivalent to getElementById to use with the XML?
  • Allthough my employer hope we don’t have to do this: I could rewrite the server side code to output the relevant texts and image urls in a flash-friendly format.

What is the most effective, easiest to implement, and robust-crossbrowser way of doing this? Any totally different ideas?

Please post any ideas even if you think the question have been answered, I’d like to explore all the different possibilities, and allso what disadvantages the proposed solutions have.

  • 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. 2026-05-10T20:15:38+00:00Added an answer on May 10, 2026 at 8:15 pm

    Since you said your input would be XHTML, you can do it with XPath:

    import mx.xpath.XPathAPI;  var elementId:String = 'flashdataTitle'; var elementPath:String = '//h1[@id'' + elementId + '']'; found_elements = XPathAPI.selectNodeList(xhtml.firstChild, elementPath);  if (found_elements.length == 1) {   trace(found_elements[0]); } 

    The code example is inspired from here, where you also can find some mode detail on XPath and ActionScript.

    AS3 has it’s own XPath Library, the general approach would be the same.

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

Sidebar

Ask A Question

Stats

  • Questions 104k
  • Answers 104k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It depends how extensive the use of .NET is in… May 11, 2026 at 8:34 pm
  • Editorial Team
    Editorial Team added an answer I would spend some time researching pass by reference vs.… May 11, 2026 at 8:34 pm
  • Editorial Team
    Editorial Team added an answer What I usually do is just create a new attribute… May 11, 2026 at 8:34 pm

Related Questions

Is there anything similar to getElementById in actionscript? I'm trying to make a prototype
I'm trying to be responsible with my DOM references in this little Flash 8/AS2
I've never really had the need to use any drag functions until now, so
Is there anything similar to an indexOf function in the NSString objects?
Is there anything similar to the following in Windows that will let me know

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.