# Image from XML

**URL:** https://forum.kirupa.com/t/image-from-xml/118411
**Category:** Uncategorized
**Created:** [August 5, 2004, 5:49am UTC](https://forum.kirupa.com/t/image-from-xml/118411 "2004-08-05T05:49:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ashishchandras](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@ashishchandras](https://forum.kirupa.com/u/ashishchandras)
#### Post date: [August 5, 2004, 5:49am UTC](https://forum.kirupa.com/t/image-from-xml/118411/1 "2004-08-05T05:49:44Z")

</div>

Hi

I have a MC in which I want to load images from XML but somehow i am not getting it. Can anyone help me out.  
Here is a simple example of it…

Script on Scene (root stage):

\_root.attachMovie (“a”,“b”,1) // a is the identifer name of the MC in which I want to get image.

Script into a MC:  
myXML = new XML();  
myXML.ignoreWhite = true;  
myXML.onLoad = myOnLoad;  
myXML.load(“rd.xml”);

function myOnLoad(success){  
if(success){  
// trace(myXML)  
this.createTextField(“t”, 2, 222, 111, 300, 300);  
t.html = true;  
t.wordWrap = true;  
t.border = true;  
var m = myXML.firstChild.attributes.photo  
trace("node "+ m)  
t.htmlText= m  
stop();  
}else{  
gotoAndPlay(2);  
}  
}

// in rd XML file there is only one node:  
// \<data photo = “\<P\>Photo: \<IMG src=‘logo.jpg’\>\</P\>” /\>

Thanx in Advance  
Ashish
