MovieClip's children not recognised?

Hi all,

I have 2 movieclips on stage; one called ‘myMarker_mc’, the other called ‘myMarker_mcOne’) - they both contain 4 children (bt_up, bt_dn, bt_remove ) and myText (a textfield) and they only work properly when it is the ‘myMarker_mc’ that is being called (called from the xml at the top of the file).

stop();
import flash.display.MovieClip;
import flash.text.TextField;

var placesXML:XML = 
<places>
    <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= "Bengkulu">
        <frame>63</frame>
        <Data><![CDATA[<p align="center"><font size="4"><font color="#CBB9AB"><b>INDONESIA</b><font color="#000000"> ……………. </p><br><br><font color="#6259DF"><p align="left"><font size="2"><b>ABOUT</b><br><font color="#000000">……………………….......<br><br><font color="#6259DF"><b>ATTRACTIONS</b><br><font color="#000000">Most travellers either spend their precious time elsewhere, or use this town for it’s transport connections.<br><br><font color="#6259DF"><b>TRANSPORT</b><br><font color="#161672"><i>Air: </i><font color="#000000">There is no airport here.<br><br><font color="#161672"><i>Road: </i><font color="#000000"> where (Type, Duration, Cost), where (Type, Duration, Cost)<br><br><font color="#161672"><i>Train: </i><font color="#000000">There is no station here.<br><br><font color="#4DFF00"><b>Sponsored Links</b><br><font color="#000000"><a href="http://www.offsoon.com/advertise"><u><i>Advertise</i></u></a> with us<br><br><font color="#6259DF"><b>Further Information</b><br><font color="#000000"><a href="http://www.bbc.co.uk/weather/world/country_guides/results.shtml?tt=TT002320">Click <u>here</u> to visit the BBC’s Weather page for Indonesia</a><br><br><a href="http://www.fco.gov.uk/en/travelling-and-living-overseas/travel-advice-by-country/asia-oceania/indonesia1"><u>FCO</u> – Click for British Nationals travel requirements</a><br><br><a href="http://www.who.int/countries/idn/en/"><u>World Health Organisation</u> – Click for news on Indonesia</a><br><br><a href="http://offsoon.com "> <u> Off Soon.com Home Page…</u></a><br><br><font color="#FD2424"><b>Notes</b><br><font color="#000000">   Different areas present different risks, but travellers should remain vigilant within tourist-populated areas, as these have traditionally presented themselves as targets to Terrorist Groups.<br><br>   Petty Crime such as pick-pocketing, or theft does exist and tourists remain particularly vulnerable upon public transport, whilst walking backstreets alone, and especially if high value items are displayed.<br><br>   Travellers should also be aware of localised political situations as violence has occasionally followed rallies and demonstrations.<br><br>   Travellers should also be aware of Muslim practices and be careful not to cause offence whilst visiting different parts of Indonesia – this is particularly prevalent during the month of Ramadan. <br><br>   If you plan on Driving in Indonesia, please obtain a valid international Driving Licence. <br><br>   Due to Indonesia’s geographical position, the area is particularly susceptible to flash flooding, earthquakes and volcanic activity – this often results in impassable transport routes.  <br><br><font color="#6259DF"><a ef="http//:offsoon.com/disclaimer"><u><b>Disclaimer</b></u></a></p>]]></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 Singapore</Data>
        <marker>[COLOR="Magenta"]myMarker_mcOne[/COLOR]</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>

//trace(placesXML.place.(@name=="solo").marker);
//var xmlMarkers:MovieClip = myMarker_mc; //If movieclip is followed by = myMarker_mc - it all works (without the line in the showData function) - Iwant to transfer the xml data from <marker> into the MovieClip

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);
}    
[COLOR="Magenta"]//This part above works perfectly.[/COLOR]

function showData(e:MouseEvent):void{
    
    var xmlFrame:int = placesXML.*.(@name == e.currentTarget.name).frame;
    var xmlMarker:XMLList = placesXML.*.(@name == e.currentTarget.name).marker;     
    var XMLmarkers:String = xmlMarker.toString();
    var xmlData:XMLList = placesXML.*.(@name == e.currentTarget.name).Data;
    MovieClip(getChildByName(XMLmarkers)).myText.htmlText = xmlData.toString(); //PROBLEM - 'myText' works when the 'myMarker_mc' MovieClip is called - displays 'xmlData' perfectly. But when 'myMarker_mcOne' is called - nothing is produced within myText and the output box pops up...:mad:
    
    
    gotoAndStop(xmlFrame); //works correctly
    trace(XMLmarkers);//traces correct correctly. ie when user clicks on the 'Jakarta' button on stage, output is 'myMarker_mcOne', in all other cases it outputs; 'myMarker_mc'.

[COLOR="Magenta"]//but then these buttons only work when myMarker_mc is called[/COLOR]    MovieClip(getChildByName(XMLmarkers)).bt_remove.addEventListener(MouseEvent.CLICK, removeMarker);
    MovieClip(getChildByName(XMLmarkers)).bt_up.addEventListener(MouseEvent.CLICK, scrollUp);
    MovieClip(getChildByName(XMLmarkers)).bt_dn.addEventListener(MouseEvent.CLICK, scrollDown);
    
    function removeMarker (e:MouseEvent):void{
        gotoAndStop(61);
    }
    
    function scrollUp (e:MouseEvent):void{
        MovieClip(getChildByName(XMLmarkers)).myText.scrollV -= 1;
    }
    
    function scrollDown (e:MouseEvent):void{
        MovieClip(getChildByName(XMLmarkers)).myText.scrollV += 1;
    }
    
}

When myMarker_mcOne is called the dynamic textfield, called ‘myText’ produces a blank and the output box pops up with…

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at MapMovieClipJune09TrialMarkersB_fla::MainTimeline/showData()[MapMovieClipJune09TrialMarkersB_fla.MainTimeline::frame61:126]

I don’t understand how the one movieclip works and the other isn’t recognised, when it is there before my own eyes and the name of it is traced correctly !! This now officially driving me nuts!