phoenix_suresh
10-31-2006, 08:04 AM
Hi all,
Im creating a CD Autorun using Flash 8 + XML. where I will have 2 links which I have provided inside XML and that will reflect in flash projector.
The idea behind this is, in future if I want to change the name of the first link I can do that by changing the XML file itself rather than doing that inside flash.
Well I successfully got link and content from XML using the following code inside my fla
==============================code inside my Fla==========================
headlineXML = new XML();
headlineXML.onLoad = myLoad;
headlineXML.load("suresh.xml");
function myLoad(ok) {
if (ok == true) {
Publish(this.firstChild);
}
}
function Publish(HeadlineXMLNode) {
if (HeadlineXMLNode.nodeName.toUpperCase() == "BROADCAST") {
content = "";
story = HeadlineXMLNode.firstChild;
while (story != null) {
if (story.nodeName.toUpperCase() == "STORY") {
lead = "";
body = ""; f
URL = "";
element = story.firstChild;
while (element != null) {
if (element.nodeName.toUpperCase() == "LEAD") {
lead = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "BODY") {
body = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "URL") {
URL = element.firstChild.nodeValue;
}
element = element.nextSibling;
}
content += "<font size='+2' color='#3366cc'><a href='"+URL+"'>"+lead+"</a></font><br>"+body+"<br><br>";
txt.htmltext=content;
}
story = story.nextSibling;
}
}
}
==================End of code inside my fla====================
=============my XML===============
<broadcast>
<story>
<lead>Execute exe1</lead>
<body>Some content about exe1</body>
<URL>exe1.exe</URL>
</story>
<story>
<lead>Execute exe2</lead>
<body>Some content about exe2</body>
<URL>exe2.exe</URL>
</story>
</broadcast>
============end of my XML ============
My problem is whenever I click the "Execute exe1" link instead of executing the exe file I'm getting a save dialogue box from the browser.
I thought of rectifying this problem using the FScommand like this
"fscommand(exec, URL = element.firstChild.nodeValue);"
which is not executing. Can someone help me fixing up this issue?
Thanks in advance,
M. Suresh
Im creating a CD Autorun using Flash 8 + XML. where I will have 2 links which I have provided inside XML and that will reflect in flash projector.
The idea behind this is, in future if I want to change the name of the first link I can do that by changing the XML file itself rather than doing that inside flash.
Well I successfully got link and content from XML using the following code inside my fla
==============================code inside my Fla==========================
headlineXML = new XML();
headlineXML.onLoad = myLoad;
headlineXML.load("suresh.xml");
function myLoad(ok) {
if (ok == true) {
Publish(this.firstChild);
}
}
function Publish(HeadlineXMLNode) {
if (HeadlineXMLNode.nodeName.toUpperCase() == "BROADCAST") {
content = "";
story = HeadlineXMLNode.firstChild;
while (story != null) {
if (story.nodeName.toUpperCase() == "STORY") {
lead = "";
body = ""; f
URL = "";
element = story.firstChild;
while (element != null) {
if (element.nodeName.toUpperCase() == "LEAD") {
lead = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "BODY") {
body = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "URL") {
URL = element.firstChild.nodeValue;
}
element = element.nextSibling;
}
content += "<font size='+2' color='#3366cc'><a href='"+URL+"'>"+lead+"</a></font><br>"+body+"<br><br>";
txt.htmltext=content;
}
story = story.nextSibling;
}
}
}
==================End of code inside my fla====================
=============my XML===============
<broadcast>
<story>
<lead>Execute exe1</lead>
<body>Some content about exe1</body>
<URL>exe1.exe</URL>
</story>
<story>
<lead>Execute exe2</lead>
<body>Some content about exe2</body>
<URL>exe2.exe</URL>
</story>
</broadcast>
============end of my XML ============
My problem is whenever I click the "Execute exe1" link instead of executing the exe file I'm getting a save dialogue box from the browser.
I thought of rectifying this problem using the FScommand like this
"fscommand(exec, URL = element.firstChild.nodeValue);"
which is not executing. Can someone help me fixing up this issue?
Thanks in advance,
M. Suresh