# Flash AS3 | Javascript | XML

**URL:** <https://forum.kirupa.com/t/flash-as3-javascript-xml/311313>\
**Category:** flash\
**Created:** [July 2, 2010, 2:19pm UTC](https://forum.kirupa.com/t/flash-as3-javascript-xml/311313 "2010-07-02T14:19:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BiGg\_RiE](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@BiGg\_RiE](https://forum.kirupa.com/u/BiGg_RiE)\
**Post date:** [July 2, 2010, 2:19pm UTC](https://forum.kirupa.com/t/flash-as3-javascript-xml/311313/1 "2010-07-02T14:19:50Z")

</div>

Hello all, it’s been awhile since I’ve posted here. Glad to see things are still going strong!

So right to it!

I’ve got a flash application that is extremely simple in presentation and (in my mind) functionality.

Essentially this thing has 2 dynamic text fields that will display text. I have a movie clip in the image of a preloader where there are 100 frames. This movieclip will go to a specific frame based on a number that is fed into a function that determines the current frame setting.

My issue is that, I need these variables (two text strings, and the number for the frame setting) to be populated based on an XML string that will be pushed to the flash via a Javascript funtion from within the containing HTML page.

This is an example of the code that will be sending the variables to flash:

```auto
window.document.flashmoviename.SetVariable("xmlstring", "here is my xml string");

```

The xml string will be formatted like this:

```auto
<values>
  <val>56</val>
  <val>25</val>
  <val>200,000</val>
</values>

```

What I’m asking is how can I listen for this in flash, and further how can I use the string in flash? Would I just use it as if it were an xml document and be able to target the different nodes? Would I need to have a different string for each variable I want to use in flash? This string will be getting updated every 3 seconds to show changes in the movie it controls. Do I need to add a timer to this? I’m thinking that if I add an eventlistener, it will throw an error because of the frequency of the updated XML string.

My first thought is that I can use externalInterface for this. But I’m not sure how.

Thanks in advance!
