Function variable not passed down? Please help!

Hello All,

Hopefully a simple one, but your help is always appreciated!

My code seems to produce an error (7 times - same code)

“1120: Access of undefined property xmlMarker.”

This appears on all occasions where the variable ‘xmlMarker’ is called outside of the function (‘showData’) where it was first produced.

stop();
var placesXML:XML = 
<places>
    <place name= "Bengkulu">
        <frame>63</frame>
        <Data><![CDATA[<p align="center"><font color=”#CBB9AB”>Indonesia :<font color="#000000">Bengkulu<br>place in <b>Sumatra</b><br><a href="http://www.google.com"><u>click here for Google</u></a></p>]]></Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Yogyakarta">
        <frame>62</frame>
        <Data>This is a delightful place in Java</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Banda_Aceh">
        <frame>64</frame>
        <Data>This is a delightful place in Northern Sumatra</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Singapore_City">
        <frame>65</frame>
        <Data>This is a delightful place in East Timor</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Dili">
        <frame>66</frame>
        <Data>This is a delightful place in East Timor</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Jakarta">
        <frame>67</frame>
        <Data>This is a delightful place in Java</Data>
        <marker>myMarker_mc2</marker>
    </place>
    <place name= "Taipei">
        <frame>68</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Manila">
        <frame>69</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Hanoi">
        <frame>70</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Vientiane">
        <frame>71</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Phnom_penh">
        <frame>72</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Napyidaw">
        <frame>73</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Bangkok">
        <frame>74</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Kuala_lumpar">
        <frame>75</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Bandar_seri_sagawan">
        <frame>76</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "solo">
        <frame>77</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
    <place name= "Gili_isles">
        <frame>78</frame>
        <Data>This is a delightful place in Singapore</Data>
        <marker>myMarker_mc</marker>
    </place>
</places>

var nameBtn:Array  = [Yogyakarta, Banda_Aceh, Bengkulu, Singapore_City, Dili, Jakarta, Taipei, Manila, Hanoi, Vientiane, Phnom_penh, Napyidaw, Bangkok, Kuala_lumpar, Bandar_seri_sagawan, solo, Gili_isles]; 
var  i:int = nameBtn.length; 
    while(i){        
    i--;        
    nameBtn*.addEventListener(MouseEvent.CLICK, showData);
}    


function showData(e:MouseEvent):void{
    var xmlFrame:int = placesXML.*.(@name == e.currentTarget.name).frame;
    var xmlMarker:MovieClip = placesXML.*.(@name == e.currentTarget.name).marker;
    var xmlData:XMLList = placesXML.*.(@name == e.currentTarget.name).Data;
    gotoAndStop(xmlFrame);
    xmlMarker.myText.htmlText = xmlData.toString();
    trace(xmlData);
}

function removeMarker(event:MouseEvent):void 
{
    gotoAndStop(61);
}

xmlMarker.bt_remove.addEventListener(MouseEvent.CLICK, removeMarker);


function scrollUp (Event:MouseEvent):void {
    
    xmlMarker.myText.scrollV -= 1;
    
}

function scrollDown (Event:MouseEvent):void {
    
    xmlMarker.myText.scrollV += 1;
}


xmlMarker.bt_up.addEventListener (MouseEvent.CLICK, scrollUp)

xmlMarker.bt_dn.addEventListener (MouseEvent.CLICK, scrollDown)

I have a feeling that I shouldn’t refer to the variable as a ‘MovieClip’, but I am unsure what else to pu thee if that is where the fault lies.

On the stage there are several buttons relating to the place names attributes (works perfectly), dependent upon which button is pressed, the scene then jumps to a frame (again this works well), however within that frame there will either be ‘myMarker_mc’, or myMarker_mc2’ (this does not work!).

Any clues, or solitions would be hugely welcomed!

Cheers

Dan H