Hey all, this is my first post. And I’ve been googling till my eyes have gone cuckoo. I’m trying to pull in an external SWF file that loads into a movieclip holder by clicking a button.
Here is the actionscript I have in the timeline:
//Create the XML Object
myXML = new XML()
myXML.ignoreWhite = true
//Load XML file
myXML.load(“seminars.xml”)
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref[“Title_txt”+i].text = nodes*.attributes.name
subnodes = nodes*.childNodes
this.ref[“Comments_txt”+i].text = subnodes[0].firstChild.toString()
this.ref[“Link_txt”+i].text = subnodes[0].firstChild.toString()
this.ref[“holder_mc”+i].loadMovie(subnodes[2].firstChild.toString())
}
} else trace(“Error loading XML document”)
}
Here is the actionscripting for the button:
on (release) {
var lo = new Object();
var mcl = new MovieClipLoader();
mcl.addListener(lo);
lo.onLoadInit = function() {
_root.mainMovie._width = 444;
_root.mainMovie._height = 270;
};
mcl.loadClip(Link_txt0, “_root.mainMovie”);
button_mc.onRelease = function() {
_root.mainMovie._width = 444;
_root.mainMovie._height = 270;
};
}
And here’s my XML code:
<?xml version=“1.0” encoding=“UTF-8”?>
<!DOCTYPE data[
<!ELEMENT title (comments, link, image)>
<!ATTLIST title name CDATA #REQUIRED>
<!ELEMENT comments (#PCDATA)>
<!ELEMENT link (#PCDATA)>
<!ELEMENT image (#PCDATA)>
]>
<data>
<title name=“Person’s Name”>
<comments>Company Name</comments>
<link>flashfile.swf</link>
<image>images/imagename_sm.jpg</image>
</title>
<title name=“Person’s Name”>
<comments>Company Name</comments>
<link>flashfile.swf</link>
<image>images/imagename_sm.jpg</image>
</title>
<title name=“Person’s Name”>
<comments>Company Name</comments>
<link>flashfile.swf</link>
<image>images/imagename_sm.jpg</image>
</title>
<title name=“Person’s Name”>
<comments>Company Name</comments>
<link>flashfile.swf</link>
<image>images/imagename_sm.jpg</image>
</title>
<title name=“Person’s Name”>
<comments>Company Name</comments>
<link>flashfile.swf</link>
<image>images/imagename_sm.jpg</image>
</title>
<title name=“Person’s Name”>
<comments>Company Name</comments>
<link>flashfile.swf</link>
<image>images/imagename_sm.jpg</image>
</title>
<title name=“Person’s Name”>
<comments>Company Name</comments>
<link>flashfile.swf</link>
<image>images/imagename_sm.jpg</image>
</title>
</data>
The text, comments & holder_mc all load fine. I just can’t get the .swf to load into the holder on a button click. (grrr)
Thanks in advance for any help.
M.