What I am tryring to do is add a link to a "spotlight on" forum, using the code above, but I don't know how to make the code above call and open a new window to an external link.
You have to also look at the Actionscript associated with this, can you post the relevant code? They have to work together, and I don't think this can be done with just XML, unless the Actionscript already has a method setup.
Also, do you have a link so we can see what you mean?
__________________
jeremy - gnomeontherun Educated questions often get educated answers, and simple questions often get simple answers.
Well, I'm new to all the Flash/XML stuff (mostly have done only html for the past few years.) Not really sure the exact place the Actionscript is located. I mean, I have a bunch of AS in the Flash file as well as a bunch of mosesSupposes Fuse files.
The only problem is the maker of the template doesn't offer any support, and all the people on that websites forum want to charge an arm and a leg just to tell me how to add a link. I mean, I'd pay the money for an entire site redesign, but to pay the same money for the alteration just to add a link?
Anyway, I'll post what I can and maybe it will make sence:
System.useCodepage = true;
//Start Load Config function
loadConfig ();
var logoSmall;//Logo Small - Transparent PNG max size 160x75px
var websiteColor;//Hexadecinal
var fullScreenActive;//true/false
var BackgroundActive;//true/false
var BackgroundMenuActive;//true/false
var BackgroundDefault;//file.swf String
//Fullscreen button visible start state
nav_menu.btn_fullscreen._visible = false;
loaderBackground._visible = true;
//LOAD CONFIG FILE -----------------------------------------------------------------------------------
function loadConfig () {
var config:XML = new XML ();
config.ignoreWhite = true;
config.onLoad = function (success) {
if (success) {
var root:XMLNode = this.firstChild;
//Set config variables
logoSmall = root.childNodes[0].childNodes[0].nodeValue;// Logo Small
websiteColor = root.childNodes[1].childNodes[0].nodeValue;// Website Color
fullScreenActive = root.childNodes[2].childNodes[0].nodeValue;// Fullscreen Button Active
BackgroundActive = root.childNodes[3].childNodes[0].nodeValue;// Backgrounds Active
BackgroundMenuActive = root.childNodes[4].childNodes[0].nodeValue;// Background Menu Active
BackgroundDefault = root.childNodes[5].childNodes[0].nodeValue;// Background Default SWF
audioConsoleVisible = root.childNodes[6].childNodes[0].nodeValue;
defaultHomepage = root.childNodes[7].childNodes[0].nodeValue;
loader.percentTxt._tint = websiteColor
balloonClose.txt._tint = websiteColor
audioPlaylist.playlist._tint = websiteColor
nav_menu.audioConsole.openPlaylist.balloon.closeLabel.closeTxt._tint = websiteColor;
nav_menu.audioConsole.openPlaylist.balloon.openLabel.openTxt._tint = websiteColor;
nav_menu.audioConsole.volumeDragger.line._tint = websiteColor;
//Set fullscreen button active if configured in the config file -----
if (fullScreenActive == "true") {
nav_menu.btn_fullscreen._visible = true;
}
//-------------------------------------------------------------------
//Load Small logo in the stage
loadLogo (logoSmall,nav_menu.logo_small,"ini");
//-------------------------------------------------------------------
//Load Background If Active
if (BackgroundActive == "true") {
//Set default background, send default parameter
setEliteBackground (BackgroundDefault);
//Check if backgrounds menu is active
if (BackgroundMenuActive == "true") {
//Build backgrounds menu
loadBackgroundsMenu ();
}
}
//
if(audioConsoleVisible == "true"){
nav_menu.audioConsole.startAudioConsole();
}
else{
nav_menu.audioConsole._visible = false;
}
loadMovieClip (defaultHomepage,content_container);
}
};
//Path to the config file
config.load ("xml/elite_website_config.xml");
}
//Function to set the background swf
function setEliteBackground (bkg:String) {
ZigoEngine.doTween (bkg_container,'_alpha',0,1,"easeOutExpo",0,function(){
loadBackgroundClip (bkg,bkg_container,"ini");
});
}
//LOAD AND PLACE BACKGROUND CONFIGURATION MENU -----------------------------------------------------------------------
function loadBackgroundsMenu () {
var backgroundsMenu:XML = new XML ();
backgroundsMenu.ignoreWhite = true;
backgroundsMenu.onLoad = function (success) {
if (success) {
var root:XMLNode = this.firstChild;
//Cicle through all backgounds available in the XML file
for (i = 0; i < root.childNodes.length; i++) {
var bkgThumbnail:String = root.childNodes[i].attributes.tmb;
var bkgSwf:String = root.childNodes[i].childNodes[0].nodeValue;
//Attach background thumbnail
nav_menu.bkg_container_1.attachMovie ("bgk_menu_container","bgk_menu_container" + i,i);
//Set the right position for each background in XML
nav_menu.bkg_container_1["bgk_menu_container" + i]._x = -i * 20;
//Add images to the backgrounds thumbnails
loadMovie ("backgrounds/" + bkgThumbnail, nav_menu.bkg_container_1["bgk_menu_container" + i].bgk_thumbnail);
//Create new instance of the button
nav_menu.bkg_container_1["bgk_menu_container" + i].btn.newInstance = bkgSwf;
//Add the event on release to the button
nav_menu.bkg_container_1["bgk_menu_container" + i].btn.onRelease = function () {
//Load bavkground stored in the button instance
setEliteBackground (this.newInstance);
};
}
}
};
backgroundsMenu.load ("xml/elite_backgrounds.xml");
}
//LOAD AND PLACE SMALL LOGO ------------------------------------------------------------------------------------------
//The small logo is configured on the XML config file.
//NOTE: The big logo on the homepage is a external SWF file.
function loadLogo (externalTarget:String, targetRoot:MovieClip, action:String) {
var mcLoader:MovieClipLoader = new MovieClipLoader ();
var listenerLoad:Object = new Object ();
listenerLoad.onLoadStart = function (target:MovieClip) {
targetRoot._alpha = 0;
isLoading = true;
};
//On Load Complete
listenerLoad.onLoadInit = function (target:MovieClip):Void {
if (action == "ini") {
ZigoEngine.doTween (targetRoot,'_alpha',100,3,"easeOutExpo");
}
target.onRelease = function(){
ZigoEngine.doTween (content_container,'_alpha',0,0.5,"easeOutExpo",0,function () {
loadMovieClip (defaultHomepage,content_container);
clearMainMenu ();
});
}
//Center position of the small logo considering an area of 160x75px
target._x = 160 / 2 - target._width / 2;
target._y = 75 / 2 - target._height / 2 - 100;
isLoading = false;
};
mcLoader.addListener (listenerLoad);
mcLoader.loadClip (externalTarget,targetRoot);
}
//--------------------------------------------------------------------------------------
//Function used to load external SWF Background files and call the loaderBackground MC -------------------------------------------
function loadBackgroundClip (externalTarget:String, targetRoot:MovieClip) {
var mcLoader:MovieClipLoader = new MovieClipLoader ();
var listenerLoad:Object = new Object ();
listenerLoad.onLoadStart = function (target:MovieClip) {
loaderBackground._width = 0;
loaderBackground._visible = true;
bkg_container._alpha = 0
};
//Loading Progress
listenerLoad.onLoadProgress = function (target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
sizeBar = Math.round (bytesLoaded / bytesTotal * Stage.width);
loaderBackground._width = sizeBar
};
//On Load Complete
listenerLoad.onLoadComplete = function (target:MovieClip):Void {
loaderBackground._visible = false;
bkg_container._alpha = 0
ZigoEngine.doTween (bkg_container,'_alpha',100,1,"easeOutExpo");
};
mcLoader.addListener (listenerLoad);
mcLoader.loadClip (externalTarget,targetRoot);
}
//--------------------------------------------------------------------------------------
The file is not designed to handle just a normal link at the bottom. Strange I know, but it was not part of the designers concept.
So it would take me a little while to write the code and figure it out (with the FLA) so it would take some time. However, you could also make a new SWF to be loaded in that slot, which inside the FLA there is a link to the page. I know its an extra click, but I think that is the easiest way without really tackling the code.
__________________
jeremy - gnomeontherun Educated questions often get educated answers, and simple questions often get simple answers.
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary https://alexvincent.us/blog