Hi
I am creating a project in Flash 8 using XML here is the actions script and XML code.
Action Script
//FLASH FRAMER NAVIGATION MENU 1
//www.flashframer.com
//Store Button Position
var yPosition:Number = 0;
//Declare New XML Object
var myXML:XML = new XML();
//Set Flash to ignore the XML file's white space
myXML.ignoreWhite = true;
//Declare new Array to store the links from the XML file
var links:Array = new Array();
//Declare new Array to store the names from the XML file
var names:Array = new Array();
//Set XML onLoad function
myXML.onLoad = function(){
//Set varible to store the XML childNodes
//This allows you to get the number of buttons in the XML file.
//You'll use this tell flash how many times to loop the for loop.
var linkname:Array = this.firstChild.childNodes;
//Set a for loop
for(i=0;i<linkname.length;i++){
//Push the button name into the names Array
names.push(linkname*.attributes.NAME);
//Push the button link into the links Array
links.push(linkname*.attributes.LINK);
//Attach the button Movie Clip from the libray give it an instance name and place it on the next highest level
_root.attachMovie("button","btn"+i,_root.getNextHighestDepth());
//Set the y position of the buttons
_root["btn"+i]._y = yPosition;
//Increace the varible yPosition 15 pixel each time the loop runs to place each button under each other
yPosition = yPosition + 25
//Place the button name from names Array into the blackTxt text box
_root["btn"+(i)].blackTxt.Txt.text = (names*);
//Place the button name from names Array into the whiteTxt text box
_root["btn"+(i)].whiteTxt.Txt.text = (names*);
//Assign the btnOver function to the button onRollOver state.
_root["btn"+(i)].onRollOver = btnOver;
//Assign the btnOut function to the button onRollOut state.
_root["btn"+(i)].onRollOut = btnOut;
//Assign the btnRelease function to the button onRelease state.
_root["btn"+(i)].onRelease = btnRelease;
}
}
//Load the XML file
myXML.load("links.xml");
//Button Over function
function btnOver(){
//This referse to the current button the mouse is over
//Go To And Play frame 2 of the current button the mouse is over
this.gotoAndPlay(2);
}
//Button Out function
function btnOut(){
//Go To And Play frame 16 of the current button the mouse rolls out from
this.gotoAndPlay(16);
}
//Button Release function
function btnRelease(){
//Set a varible named currentBtn equal to the instance name of the current button the mouse clicked on
var currentBtn:String = this._name;
//Set a varible named currentIndex equal to the varible currentBtn and the characters between 3rd letter and 5th of that string.
//This will return a number between 0 and the total number of buttons
var currentIndex:String = currentBtn.substring(3,5);
//Get the URL from the links Array
//Use the currentIndex varible as the index number
//getURL(links[currentIndex]);
fscommand("exec",(links[currentIndex]));
}
XML Code
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--FLASH FRAMER NAVIGATION MENU 1-->
<NAVBAR>
<BUTTON NAME='HOME' LINK='iconworkshop.exe' />
<BUTTON NAME='ABOUT' LINK='http://flashframer.com/about/' />
<BUTTON NAME='LICENSE' LINK='http://flashframer.com/license/' />
<BUTTON NAME='SUBMIT' LINK='http://flashframer.com/submit/' />
<BUTTON NAME='GALLERY' LINK='http://www.flashframer.com' />
<BUTTON NAME='BUY' LINK='http://www.flashframer.com' />
<BUTTON NAME='ADVERTISE' LINK='http://www.flashframer.com' />
<BUTTON NAME='STATS' LINK='http://www.flashframer.com' />
<BUTTON NAME='PARTNERS' LINK='http://www.flashframer.com' />
<BUTTON NAME='CONTACT' LINK='http://www.flashframer.com' />
<BUTTON NAME='FAIZAN' LINK='http://www.flashframer.com' />
</NAVBAR>
Now the problem is with fscommand “exec”, my code " fscommand(“exec”,(links[currentIndex]));" it fetches exec command “<BUTTON NAME=‘HOME’ LINK=‘iconworkshop.exe’ />”… **It runs fine when i call it from the root folder. BUT when I try to define the sub folder path it absolutely doesn’t work.
[COLOR=Red]Can someone tell me what’s wrong I am doing ?
[/COLOR]**