El tema particular es que quiero que uno de esos nombres (item) del menu no me abra ningun submenu de la pagina sino que me redirija a otra pagina web. He intentado muchas cosas con el XML pero creo que el problema es que falta algo en al codigo del flash.
A continuacion les pongo el codigo XML y el codigo actionscript del menu. Muchas gracias por adelantado.
EL LINK QUE QUIERO HACER QUE NO SEA MENU ES EL DEDICADO A BLOG
Código XML :
<?xml version="1.0" encoding="UTF-8"?> <organicTemplate> <templateSettings initialSection = "INICIO" frameSpace = "50" useMP3Player = "1" mp3PlayerAutoPlay = "1" menuBarColor = "0x000000" menuTextColorNormal = "0xFFFFFF" menuTextColorRollOver = "0x22ACED" > </templateSettings> <menuItems> <menuItem menuItemName="INICIO" contentPath="secciones/inicio/Content1.swf" backgroundPath="fondos/01.jpg"></menuItem> <menuItem menuItemName="LA EMPRESA" contentPath="secciones/la empresa/Content3.swf" backgroundPath="fondos/02.jpg"></menuItem> <menuItem menuItemName="ESTUDIO" contentPath="secciones/conocenos/Content2.swf" backgroundPath="fondos/03.jpg"></menuItem> <menuItem menuItemName="SERVICIOS" contentPath="secciones/servicios/Content4.swf" backgroundPath="fondos/04.jpg"></menuItem> <menuItem menuItemName="ARQUITECTURA"> <menuItem menuItemName="REFERENCIAS" contentPath="galerias/Arquitectura/referencias/referencias.xml" backgroundPath="fondos/01.jpg"></menuItem> <menuItem menuItemName="INFOGRAFIAS" contentPath="galerias/Arquitectura/infografias/infografias.xml" backgroundPath="fondos/02.jpg"></menuItem> <menuItem menuItemName="CONCURSOS" contentPath="galerias/Arquitectura/concursos/concursos.xml" backgroundPath="fondos/03.jpg"></menuItem> <menuItem menuItemName="PREMIOS" contentPath="galerias/Arquitectura/premios/premios.xml" backgroundPath="fondos/04.jpg"></menuItem> <menuItem menuItemName="PROYECTOS" contentPath="galerias/Arquitectura/proyectos/proyectos.xml" backgroundPath="fondos/05.jpg"></menuItem> </menuItem> <menuItem menuItemName="NATURALEZA"> <menuItem menuItemName="EVENTOS" contentPath="galerias/Naturaleza/eventos/eventos.xml" backgroundPath="fondos/06.jpg"></menuItem> <menuItem menuItemName="VIAJES" contentPath="galerias/Naturaleza/viajes/viajes.xml" backgroundPath="fondos/07.jpg"></menuItem> </menuItem> <menuItem menuItemName="VIDEO-GALERIA" contentPath="galerias/Galeria de Video/galeria de video.xml" backgroundPath="fondos/02.jpg"></menuItem> <Item Name="BLOG" url="http://www.as.com" backgroundPath="fondos/05.jpg" /> <menuItem menuItemName="CONTACTO" contentPath="secciones/contacto/Contact.swf" backgroundPath="fondos/05.jpg"></menuItem> </menuItems> </organicTemplate>
Y AQUI EL ACTIONSCRIPT
Código ActionScript :
// Actions for Image Viewer
imageLoaderMC._alpha = 0;
imageLoaderMC._lockroot = true;
descriptionMC._alpha = 0;
nextButtonMC.button.enabled = false;
previousButtonMC.button.enabled = false;
nextButtonMC._alpha = 0;
previousButtonMC._alpha = 0;
closeButtonMC._alpha = 0;
closeButtonMC.button.enabled = false;
urlButtonMC._alpha = 0;
urlButtonMC.button.enabled = false;
var nextButtonRollOver = false;
var previousButtonRollOver = false;
var closeButtonRollOver = false;
var urlButtonRollOver = false;
var imagePath;
var backgroundURL;
var imageURL;
var menuItemCall = true;
var videoWidth;
var videoHeight;
var videoAutoPlay;
var videoBufferTime;
var videoVolume;
this._visible = false;
var mcLoader:MovieClipLoader = new MovieClipLoader();
//listener for the imageLoaderMC
var imgListener:Object = new Object();
imgListener.onLoadProgress = function(target_mc:MovieClip , bytesLoaded:Number, bytesTotal:Number) {
var loaded = Math.round((bytesLoaded*100)/bytesTotal);
_root.generalPreloaderMC.blackBarMC.tween( "_width", (loaded*_root.generalPreloaderMC.whiteBarMC._width) / 100 -10, 0.25,"linear");
}
imgListener.onLoadComplete = function(target_mc:MovieClip){
target_mc.myContentPath = imagePath.substr(0,imagePath.lastIndexOf("/")+1);
}
imgListener.onLoadInit = function(target_mc:MovieClip){
target_mc.initContent();
if(imagePath.substr(imagePath.lastIndexOf("/")+1) == "FLV Player.swf"){
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean){
if (success){
target_mc.myFLV.contentPath = target_mc.myContentPath + this.videoName;
target_mc.myFLV.skin = target_mc.myContentPath + "ClearOverAll.swf";
target_mc.myFLV.width = this.videoWidth;
target_mc.myFLV.height = this.videoHeight;
target_mc.myFLV.autoPlay = Boolean(Number(this.videoAutoPlay));
target_mc.myFLV.bufferTime = Number(this.videoBufferTime);
target_mc.myFLV.volume = this.videoVolume;
_root.menuMC.playerMC.PauseSong("video");
doRest();
} else {
trace("Error loading/parsing LoadVars.");
}
}
my_lv.load(target_mc.myContentPath + "Content.txt");
}else if(imagePath.substr(imagePath.lastIndexOf(".")+1).toLowerCase() == "flv"){
target_mc.myFLV.skin = "FLV Player/ClearOverAll.swf"
target_mc.myFLV.width = videoWidth;
target_mc.myFLV.height = videoHeight;
target_mc.myFLV.autoPlay = videoAutoPlay;
target_mc.myFLV.bufferTime = videoBufferTime;
target_mc.myFLV.volume = videoVolume;
target_mc.myFLV.contentPath = imagePath;
_root.menuMC.playerMC.PauseSong("video");
doRest();
}else{
if(_root.menuMC.playerMC.compareState()){
_root.menuMC.playerMC.PlaySong();
}
doRest();
}
function doRest(){
_root.generalPreloaderMC.hidePreloader();
if(menuItemCall == true){
if((_root.windowMC._width-_root.frameSpace) == (Math.round(target_mc._width/2)*2) and (_root.windowMC._height-_root.frameSpace) == (Math.round(target_mc._height/2)*2) ){
showImage();
_root.menuMC.enableAllButtons();
}else{
_root.windowMC.zoomTo(target_mc._width + _root.frameSpace,target_mc._height + _root.frameSpace);
_root.windowMC.windowCaller = "showImage";
}
}else{
if((_root.windowMC._width-_root.galleryMC.frameSpace) == (Math.round(target_mc._width/2)*2) and (_root.windowMC._height-_root.galleryMC.frameSpace) == (Math.round(target_mc._height/2)*2) ){
showImage();
_root.menuMC.enableAllButtons();
}else{
_root.windowMC.zoomTo(target_mc._width + _root.galleryMC.frameSpace,target_mc._height + _root.galleryMC.frameSpace);
_root.windowMC.windowCaller = "showImage";
}
}
}
}
imgListener.onLoadError = function(target_mc:MovieClip){
trace("hubo un error");
_root.menuMC.enableAllButtons();
}
function showImage(){
_root.galleryCentered();
_root.imageViewerMC._visible = true;
imageLoaderMC.tween("_alpha",100,.5,"linear",0,mouseInsideImage);
_root.backgroundMC.changeBackgroundImage(backgroundURL);
trace("menuItemCall :" + menuItemCall );
if(menuItemCall == false){
if(imagePath.substr(imagePath.lastIndexOf(".")+1).toLowerCase() == "flv"){
button._width = videoWidth;
button._height = imageLoaderMC._height;
closeButtonMC._x = imageLoaderMC._x + Math.round(videoWidth/2) ;
closeButtonMC._y = imageLoaderMC._y;
if(imageURL == "" or imageURL == undefined){
closeButtonMC._x = imageLoaderMC._x + Math.round(videoWidth/2)- Math.round(closeButtonMC._width/2);
urlButtonMC._visible = false;
}else{
urlButtonMC._visible = true;
urlButtonMC._x = imageLoaderMC._x + Math.round(videoWidth/2)- closeButtonMC._width;
urlButtonMC._y = imageLoaderMC._y;
}
if(descriptionMC._visible == true){
descriptionMC.textBox._width = videoWidth-10;
descriptionMC.textBox._x = 5;
descriptionMC.textBox.autoSize = true;
descriptionMC.rectangleMC._width = videoWidth;
descriptionMC.rectangleMC._height = descriptionMC.textBox.textHeight + 8;
descriptionMC._y = imageLoaderMC._height - descriptionMC._height - 55;
nextButtonMC._x = videoWidth;
nextButtonMC._y = Math.round((imageLoaderMC._height- descriptionMC._height -55)/2 - nextButtonMC._height/2);
previousButtonMC._x = imageLoaderMC._x;
previousButtonMC._y = Math.round((imageLoaderMC._height- descriptionMC._height -55)/2 - previousButtonMC._height/2);
}else{
nextButtonMC._x = videoWidth;
nextButtonMC._y = Math.round((imageLoaderMC._height -55)/2 - nextButtonMC._height/2);
previousButtonMC._x = imageLoaderMC._x;
previousButtonMC._y = Math.round((imageLoaderMC._height -55)/2 - previousButtonMC._height/2);
}
}else{
trace("estoy dentro");
button._width = imageLoaderMC._width;
button._height = imageLoaderMC._height;
closeButtonMC._x = imageLoaderMC._x + Math.round(imageLoaderMC._width/2) ;
closeButtonMC._y = imageLoaderMC._y;
if(imageURL == "" or imageURL == undefined){
closeButtonMC._x = imageLoaderMC._x + Math.round(imageLoaderMC._width/2)- Math.round(closeButtonMC._width/2);
urlButtonMC._visible = false;
}else{
urlButtonMC._visible = true;
urlButtonMC._x = imageLoaderMC._x + Math.round(imageLoaderMC._width/2)- closeButtonMC._width;
urlButtonMC._y = imageLoaderMC._y;
}
if(descriptionMC._visible == true){
descriptionMC.textBox._width = imageLoaderMC._width-10;
descriptionMC.textBox._x = 5;
descriptionMC.textBox.autoSize = true;
descriptionMC.rectangleMC._width = imageLoaderMC._width;
descriptionMC.rectangleMC._height = descriptionMC.textBox.textHeight + 8;
descriptionMC._y = imageLoaderMC._height - descriptionMC._height;
nextButtonMC._x = imageLoaderMC._width;
nextButtonMC._y = Math.round((imageLoaderMC._height- descriptionMC._height)/2 - nextButtonMC._height/2);
previousButtonMC._x = imageLoaderMC._x;
previousButtonMC._y = Math.round((imageLoaderMC._height- descriptionMC._height)/2 - previousButtonMC._height/2);
}else{
nextButtonMC._x = imageLoaderMC._width;
nextButtonMC._y = Math.round((imageLoaderMC._height)/2 - nextButtonMC._height/2);
previousButtonMC._x = imageLoaderMC._x;
previousButtonMC._y = Math.round((imageLoaderMC._height)/2 - previousButtonMC._height/2);
}
}
}
}
function disableButtons(){
nextButtonMC.button.enabled = false;
previousButtonMC.button.enabled = false;
closeButtonMC.button.enabled = false;
urlButtonMC.button.enabled = false;
nextButtonRollOver = false;
previousButtonRollOver = false;
closeButtonRollOver = false;
urlButtonRollOver = false;
descriptionMC.tween("_alpha",0,.25,"linear");
nextButtonMC.tween("_alpha",0,.25,"linear");
previousButtonMC.tween("_alpha",0,.25,"linear");
closeButtonMC.tween("_alpha",0,.25,"linear");
urlButtonMC.tween("_alpha",0,.25,"linear");
}
function hideImage(param){
disableButtons();
imageLoaderMC.tween("_alpha",0,.5,"linear",0,function(){
mcLoader.unloadClip(imageLoaderMC);
if(_root.menuMC.playerMC.compareState()){
_root.menuMC.playerMC.PlaySong();
}
if(param == "zoomToGallery"){
_root.windowMC.windowCaller = "zoomToGallery";
_root.windowMC.zoomTo(_root.galleryMC.galleryWidth,_root.galleryMC.galleryHeight);
}
if(param == "backToGallery"){
_root.windowMC.windowCaller = "backToGallery";
_root.windowMC.zoomTo(_root.galleryMC.galleryWidth,_root.galleryMC.galleryHeight);
}
});
}
function changeImage(){
disableButtons();
imageLoaderMC.tween("_alpha",0,.5,"linear",0,function(){
_root.imageViewerMC._visible = false;
setTitleAndDescription(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].title, _root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].description);
setImageURL(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].url);
setBackgroundURL(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].backgroundPath);
if(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].videoPath != undefined){
loadImage(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].videoPath);
setVideoWidth(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].videoWidth);
setVideoHeight(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].videoHeight);
setVideoAutoPlay(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].videoAutoPlay);
setVideoBufferTime(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].videoBufferTime);
setVideoVolume(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].videoVolume);
}else{
loadImage(_root.galleryMC.imageInfoArray[_root.galleryMC.selectedImage].imagePath);
}
});
}
function loadImage(url){
imagePath = url;
_root.generalPreloaderMC.resetPreloader();
_root.preloaderCentered();
_root.generalPreloaderMC.showPreloader();
mcLoader.addListener(imgListener);
if(imagePath.substr(imagePath.lastIndexOf(".")+1).toLowerCase() == "flv"){
mcLoader.loadClip("FLV Player/FLV Player.swf", imageLoaderMC);
}else{
mcLoader.loadClip(url, imageLoaderMC);
}
}
function loadSWF(url){
menuItemCall = true;
if(imageLoaderMC._alpha > 0){
disableButtons();
imageLoaderMC.tween("_alpha",0,.5,"linear",0,function(){
mcLoader.unloadClip(imageLoaderMC);
loadImage(url);
});
}else{
loadImage(url);
}
}
function setTitleAndDescription(titleText, descriptionText){
//descriptionMC.textBox.html = true;
var titleFormat:TextFormat = new TextFormat();
titleFormat.font = "uni 05_63";
var descriptionFormat:TextFormat = new TextFormat();
descriptionFormat.leading = 1;
descriptionFormat.align = "justify";
if((titleText == "" or titleText == undefined) and (descriptionText == "" or descriptionText == undefined)){
descriptionMC._visible = false;
}else{
descriptionMC._visible = true;
if((titleText == "" or titleText == undefined) and (descriptionText != "" or descriptionText != undefined)){
descriptionMC.textBox.text = descriptionText;
descriptionMC.textBox.setTextFormat(descriptionFormat);
}else if((titleText != "" or titleText != undefined) and (descriptionText == "" or descriptionText == undefined)){;
descriptionMC.textBox.text = titleText;
descriptionMC.textBox.setTextFormat(titleFormat);
}else if((titleText != "" or titleText != undefined) and (descriptionText != "" or descriptionText != undefined)){
descriptionMC.textBox.text = titleText + "\n\n" + descriptionText;
descriptionMC.textBox.setTextFormat(0,titleText.length,titleFormat);
descriptionMC.textBox.setTextFormat(titleText.length,descriptionMC.textBox.length,descriptionFormat);
}
}
//descriptionMC.textBox.htmlText = descriptionMC.textBox.htmlText + "Yellow: <a href='http://www.google.com' target='_blank'>MORE INFO</a>"
}
function setImageURL(url){
imageURL = url;
}
function setBackgroundURL(url){
backgroundURL = url;
}
function setVideoWidth(vWidth){
videoWidth = vWidth;
}
function setVideoHeight(vHeight){
videoHeight = vHeight;
}
function setVideoAutoPlay(vAutoPlay){
videoAutoPlay = vAutoPlay;
}
function setVideoBufferTime(vBufferTime){
videoBufferTime = vBufferTime;
}
function setVideoVolume(vVolume){
videoVolume = vVolume;
}
function mouseInsideImage(){
if(button.hitTest(_root._xmouse,_root._ymouse,false)== true and imageLoaderMC._alpha == 100 and menuItemCall == false){
if(descriptionMC._alpha < 100){
descriptionMC.tween("_alpha",100,.25,"linear");
}
if(nextButtonMC._alpha < 75 and nextButtonRollOver == false){
if(_root.galleryMC.selectedImage+1 < _root.galleryMC.totalImages){
nextButtonMC.button.enabled = true;
nextButtonMC.tween("_alpha",75,.25,"linear");
}
}
if(previousButtonMC._alpha < 75 and previousButtonRollOver == false){
if(_root.galleryMC.selectedImage > 0){
previousButtonMC.button.enabled = true;
previousButtonMC.tween("_alpha",75,.25,"linear");
}
}
if(closeButtonMC._alpha < 75 and closeButtonRollOver == false){
closeButtonMC.button.enabled = true;
closeButtonMC.tween("_alpha",75,.25,"linear");
}
if(urlButtonMC._alpha < 75 and urlButtonRollOver == false){
urlButtonMC.button.enabled = true;
urlButtonMC.tween("_alpha",75,.25,"linear");
}
}else{
if(descriptionMC._alpha > 0 and imageLoaderMC._alpha == 100){
disableButtons();
}
}
}
button.onMouseMove = mouseInsideImage;
nextButtonMC.button.onRollOver = function(){
nextButtonRollOver = true;
this._parent.tween("_alpha",100,.25,"linear");
}
previousButtonMC.button.onRollOver = function(){
previousButtonRollOver = true;
this._parent.tween("_alpha",100,.25,"linear");
}
closeButtonMC.button.onRollOver = function(){
closeButtonRollOver = true;
this._parent.tween("_alpha",100,.25,"linear");
}
urlButtonMC.button.onRollOver = function(){
urlButtonRollOver = true;
this._parent.tween("_alpha",100,.25,"linear");
}
nextButtonMC.button.onRollOut = function(){
nextButtonRollOver = false;
this._parent.tween("_alpha",75,.25,"linear");
}
previousButtonMC.button.onRollOut = function(){
previousButtonRollOver = false;
this._parent.tween("_alpha",75,.25,"linear");
}
closeButtonMC.button.onRollOut = function(){
closeButtonRollOver = false;
this._parent.tween("_alpha",75,.25,"linear");
}
urlButtonMC.button.onRollOut = function(){
urlButtonRollOver = false;
this._parent.tween("_alpha",75,.25,"linear");
}
nextButtonMC.button.onReleaseOutside = function(){
nextButtonRollOver = false;
this._parent.tween("_alpha",75,.25,"linear");
}
previousButtonMC.button.onReleaseOutside = function(){
previousButtonRollOver = false;
this._parent.tween("_alpha",75,.25,"linear");
}
closeButtonMC.button.onReleaseOutside = function(){
closeButtonRollOver = false;
this._parent.tween("_alpha",75,.25,"linear");
}
urlButtonMC.button.onReleaseOutside = function(){
urlButtonRollOver = false;
this._parent.tween("_alpha",75,.25,"linear");
}
nextButtonMC.button.onRelease = function(){
changeImage();
_root.galleryMC.selectedImage ++;
}
previousButtonMC.button.onRelease = function(){
changeImage();
_root.galleryMC.selectedImage--;
}
closeButtonMC.button.onRelease = function(){
hideImage("backToGallery");
}
urlButtonMC.button.onRelease = function(){
getURL(imageURL,"_blank");
} 