# \[F9/AS2\] Load dynamic text from an array into an embedded swf

**URL:** https://forum.kirupa.com/t/f9-as2-load-dynamic-text-from-an-array-into-an-embedded-swf/278897
**Category:** flash
**Created:** [January 7, 2009, 5:43am UTC](https://forum.kirupa.com/t/f9-as2-load-dynamic-text-from-an-array-into-an-embedded-swf/278897 "2009-01-07T05:43:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mikeyray](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@mikeyray](https://forum.kirupa.com/u/mikeyray)
#### Post date: [January 7, 2009, 5:43am UTC](https://forum.kirupa.com/t/f9-as2-load-dynamic-text-from-an-array-into-an-embedded-swf/278897/1 "2009-01-07T05:43:51Z")

</div>

I have my main stage, and into this main stage I am embedding another .swf file (multiple instances on a map). I would like to be able to load dynamic text from an array (addressA) on the main stage into the embedded .swf - can this be done?

Here is what I have tried, and failed with:

1. Creating a dynamic text box on the embedded .swf, giving it an instance name of markeraddy\_txt, and writing AS in that .swf for markeraddy\_txt.text = addressA\*;  
\*2) Creating a dynamic text box on the embedded .swf, giving it an instance name of markeraddy\_txt, creating a variable on the main stage of var embed = {url:‘embed.swf’};, and writing AS in the main stage for embed.markeraddy\_txt.text = addressA.
2. Creating a dynamic text box on the embedded .swf, giving it an instance name of markeraddy\_txt, and writing AS in that .swf for markeraddy\_txt.text = addressA\*\*;\*

```auto
addressA = [];
function parseXML(){
    addressA.push(this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue);      
}

function addMarkers(xml:XML):Void {
    var address = xml.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
    for (i=0; i<addressA.length; i++) {
        myMap.addMarkerByAddress(CustomSWFMarker, addressA*,{url:"marker2.swf", ref:i, useClip:false});
        trace(addressA*);

* //here is where I have tried inserting my code to load the multiple values
        //from the array into each individual marker2.swf clip, as it is placed for each 
        //instance of addressA**
****** }
}

```

I’m lost - when I run a trace, as you see above, I get the right addresses showing up, but for some reason I cannot load them into markeraddy\_txt in the embedded .swf.

Can anyone help?
