Aquí te dejo el código Completo:
Código ActionScript :
//System.useCodepage = true;
import mx.transitions.Tween;
import mx.transitions.easing.*;
stop();
// Path to xml configuration
var xml_config:String = "config.xml";
// Path to xml navigation
var xml_navigation:String = "navigation.xml";
// Variables stored in config.xml
var navPadding:Number;
var emailAddress:String;
var myLogo:String;
var backgroundImage:String;
var backgroundImage2:String;
var backgroundImage3:String;
var backgroundThumb1:String;
var backgroundThumb2:String;
var backgroundThumb3:String;
var navActiveColor:String;
var navRollOverColor:String;
var contentBGColor:String;
var siteBGColor:String;
var footerInfo:String;
var site_section:String;
var animationType:String;
var multileBGs:String;
var soundOn:String;
var mySound:String;
var my_sound:Sound = new Sound();
// Variables stored in navigation.xml
var menu:Array = new Array();
var menuTypes:Array = new Array();
var menuAssets:Array = new Array();
var submenus:Array = new Array();
var menuStartPosition:Number = 0;
var submenuStartPosition:Number = 0;
var firstLoad:Boolean = true;
// CSS
txtCSS = new TextField.StyleSheet();
txtCSS.load("style.css");
// Initialize objects
function init() {
// By default, hide most objects
background_mc._alpha = 0;
navbar_mc._alpha = 0;
logo_mc._alpha = 0;
contentBG_mc._alpha = 0;
footer_mc._alpha = 0;
headerbg_mc._alpha = 0;
contentBG_mc.module_text_mc._alpha = 0;
contentBG_mc.module_contact_mc._alpha = 0;
// Find center of stage on init
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
headerbg_mc._width = Stage.width;
navbar_mc._x = Stage.width-navbar_mc._width-10;
navbar_mc._y = headerbg_mc._height-20;
contentBG_mc._x = centerX;
contentBG_mc._y = centerY;
footer_mc._y = Stage.height;
footer_mc.footerbg_mc._width = Stage.width;
footer_mc.toggleFS_mc._x = Stage.width-5;
footer_mc.multiplebgs_mc._visible = false;
footer_mc.musicControls_mc._visible = false;
backgroundColor_mc._width = Stage.width;
backgroundColor_mc._height = Stage.height;
subnavbar_mc._visible = false;
// HTML enable text module
contentBG_mc.module_text_mc.target_mc.body_txt.html = true;
contentBG_mc.module_text_mc.target_mc.body_txt.styleSheet = txtCSS;
contentBG_mc.module_text_mc.target_mc.body_txt.autoSize = "LEFT";
contentBG_mc.module_contact_mc.info_txt.styleSheet = txtCSS;
blackbox_mc._alpha = 0;
large_mc.trad_next_btn._visible = false;
large_mc.trad_prev_btn._visible = false;
gallery_preloader_mc._alpha = 0;
videoplayer_mc._visible = false;
videoplayer_mc._alpha = 0;
}
// Execute init
init();
function intro() {
// Fade everybody in order
var logoStartY:Number = logo_mc._y;
var headerBGStartY:Number = headerbg_mc._y;
var fadeBG:Tween = new Tween(background_mc, "_alpha", None.easeOut, 0, 100, 0.5, true);
fadeBG.onMotionFinished = function() {
var fadeLogoTween:Tween = new Tween(logo_mc, "_alpha", None.easeOut, 0, 100, 0.5, true);
var slideLogoYTween:Tween = new Tween(logo_mc, "_y", Strong.easeInOut, -100, logoStartY, 1, true);
var fadeHeaderTween:Tween = new Tween(headerbg_mc, "_alpha", None.easeOut, 0, 100, 0.5, true);
var slideHeaderYTween:Tween = new Tween(headerbg_mc, "_y", Strong.easeInOut, -100, headerBGStartY, 0.5, true);
slideLogoYTween.onMotionFinished = function() {
var fadeNavTween:Tween = new Tween(navbar_mc, "_alpha", None.easeOut, 0, 100, 0.5, true);
fadeNavTween.onMotionFinished = function() {
var fadeContentBG:Tween = new Tween(contentBG_mc, "_alpha", None.easeOut, 0, 100, 0.5, true);
var fadeFooter:Tween = new Tween(footer_mc, "_alpha", None.easeOut, 0, 100, 0.5, true);
var moveYFooter:Tween = new Tween(footer_mc, "_y", Strong.easeOut, Stage.height+50, Stage.height, 0.5, true);
loadAsset(menuTypes[0],menuAssets[0]);
if (soundOn == "yes") {
my_sound.onLoad = function(success:Boolean) {
if (success) {
my_sound.start(0,999);
status_txt.text = "Sound loaded";
} else {
status_txt.text = "Sound failed";
}
};
my_sound.loadSound(mySound, false);
}
};
};
};
}
// Function for resizing the browser window
function position() {
// Find new value of stage size
var W:Number = Stage.width;
var H:Number = Stage.height;
// Limit the reduction of resizing
if (Stage.width<900) {
W = 900;
}
if (Stage.height<520) {
H = 520;
}
// Find center of stage
var centerX:Number = W/2;
var centerY:Number = H/2;
headerbg_mc._width = W;
// Center bg image
backgroundColor_mc._width = W;
backgroundColor_mc._height = H;
background_mc._x = centerX;
background_mc._y = centerY;
background_mc.target_mc._x = -_global.BGW/2;
background_mc.target_mc._y = -_global.BGH/2;
gallery_preloader_mc._x = centerX;
gallery_preloader_mc._y = centerY;
var imageRatio:Number;
var imageXRatio = W/_global.BGW;
var imageYRatio = H/_global.BGH;
if (imageXRatio>imageYRatio) {
imageRatio = imageXRatio;
} else {
imageRatio = imageYRatio;
}
// Make the bg image go fullscreen
background_mc._xscale = background_mc._yscale=imageRatio*100;
// Position other objects
navbar_mc._x = W-navbar_mc._width-10;
if (showingSubmenu==false) {
navbar_mc._y = headerbg_mc._height-20;
} else {
navbar_mc._y = headerbg_mc._height-45;
}
subnavbar_mc._x = W-subnavbar_mc._width-10;
subnavbar_mc._y = headerbg_mc._height-20;
contentBG_mc._x = centerX;
contentBG_mc._y = centerY;
footer_mc._y = H;
footer_mc.footerbg_mc._width = W;
footer_mc.toggleFS_mc._x = W-5;
footer_mc.multiplebgs_mc._x = W-60;
footer_mc.musicControls_mc._x = W-205;
videoplayer_mc._x = centerX;
videoplayer_mc._y = centerY;
// If we're in gallery-traditional mode, treat the enlarged images much like the main bg image
if (site_section == "gallery-traditional" || site_section == "gallery-scrolling") {
blackbox_mc._x = 0;
blackbox_mc._y = 0;
blackbox_mc._width = W;
blackbox_mc._height = H;
large_mc._x = centerX;
large_mc._y = centerY;
large_mc.target_mc._x = -_global.LARGEBGW/2;
large_mc.target_mc._y = -_global.LARGEBGH/2;
large_mc.description_mc._y = large_mc.target_mc._y+_global.LARGEBGH+5;
var imageRatioL:Number;
var imageXRatioL = W/_global.LARGEBGW;
var imageYRatioL = H/_global.LARGEBGH;
large_mc.trad_prev_btn._x = large_mc.target_mc._x-2;
large_mc.trad_next_btn._x = large_mc.target_mc._x+_global.LARGEBGW+2;
if (imageXRatioL>imageYRatioL) {
imageRatioL = imageXRatioL;
} else {
imageRatioL = imageYRatioL;
}
if (_global.FSImages == "yes") {
large_mc._xscale = large_mc._yscale=imageRatioL*70;
}
}
}
// Load navigation
var navigationXML:XML = new XML();
navigationXML.ignoreWhite = true;
navigationXML.onLoad = function(success) {
if (success) {
// Find total # of links
var total:Number = this.firstChild.childNodes.length;
for (var i:Number = 0; i<total; i++) {
menuTypes.push(this.firstChild.childNodes[i].attributes.type);
menu.push(this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
menuAssets.push(this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue);
if (this.firstChild.childNodes[i].attributes.submenu) {
submenus.push(this.firstChild.childNodes[i].attributes.submenu);
} else {
submenus.push("");
}
var navItem_mc:MovieClip = navbar_mc.container_mc.attachMovie("navButton_mc", "nav_mc"+i, i);
navItem_mc.ID = i;
navItem_mc.navText_txt.html = true;
navItem_mc.navText_txt.autoSize = "LEFT";
navItem_mc.navText_txt.htmlText = menu[i];
navItem_mc.navText_txt._x += menuStartPosition;
// Space out the links
menuStartPosition += navItem_mc._width+navPadding;
// Color the links
var navColor = new Color(navItem_mc.navText_txt);
navColor.setRGB(navActiveColor);
// Link click event
navItem_mc.onRelease = function() {
firstLoad = false;
if (submenus[this.ID] != "") {
loadSubmenu(submenus[this.ID]);
} else {
closeSubmenu();
}
loadAsset(menuTypes[this.ID],menuAssets[this.ID]);
// Enable all other links
for (var j:Number = 0; j<total; j++) {
this._parent["nav_mc"+j].enabled = true;
var navColor = new Color(this._parent["nav_mc"+j]);
navColor.setRGB(navActiveColor);
}
var navColor = new Color(this);
navColor.setRGB(navRollOverColor);
// Disable clicked link
this.enabled = false;
};
// Link roll over event
navItem_mc.onRollOver = function() {
var navColor = new Color(this);
navColor.setRGB(navRollOverColor);
};
navItem_mc.onRollOut = navItem_mc.onReleaseOutside=function () {
var navColor = new Color(this);
navColor.setRGB(navActiveColor);
};
}
// Disable 1st link
navbar_mc.container_mc["nav_mc"+0].enabled = false;
var navColor = new Color(navbar_mc.container_mc["nav_mc"+0]);
navColor.setRGB(navRollOverColor);
position();
intro();
} else {
trace("Cannot load navigation XML");
}
};
// Clear function for each time a link is clicked
function resetAll() {
site_section = "";
clearInterval(contentBG_mc.container_mc.intervalID);
unloadMovie(contentBG_mc.container_mc);
contentBG_mc.container_mc._visible = false;
contentBG_mc.container_mc._alpha = 0;
contentBG_mc.module_text_mc._visible = false;
contentBG_mc.module_text_mc._alpha = 0;
contentBG_mc.module_contact_mc._visible = false;
contentBG_mc.module_contact_mc._alpha = 0;
}
// Load configurations
var configXML:XML = new XML();
configXML.ignoreWhite = true;
configXML.onLoad = function(success) {
if (success) {
navPadding = parseInt(this.firstChild.childNodes[0].attributes.navPadding);
emailAddress = this.firstChild.childNodes[0].attributes.emailAddress;
myLogo = this.firstChild.childNodes[0].attributes.myLogo;
// Load your logo
loadMovie(myLogo, logo_mc);
multipleBGs = this.firstChild.childNodes[0].attributes.multipleBackgrounds;
backgroundImage = this.firstChild.childNodes[0].attributes.backgroundImage1;
backgroundImage2 = this.firstChild.childNodes[0].attributes.backgroundImage2;
backgroundImage3 = this.firstChild.childNodes[0].attributes.backgroundImage3;
backgroundThumb1 = this.firstChild.childNodes[0].attributes.backgroundThumb1;
backgroundThumb2 = this.firstChild.childNodes[0].attributes.backgroundThumb2;
backgroundThumb3 = this.firstChild.childNodes[0].attributes.backgroundThumb3;
// if multiple backgrounds is enabled, show the thumbs and activate button events for them
if (multipleBGs == "yes") {
footer_mc.multiplebgs_mc._visible = true;
// Load Background Thumbnails
loadMovie(backgroundThumb1, footer_mc.multiplebgs_mc.bg1_mc.target_mc);
loadMovie(backgroundThumb2, footer_mc.multiplebgs_mc.bg2_mc.target_mc);
loadMovie(backgroundThumb3, footer_mc.multiplebgs_mc.bg3_mc.target_mc);
// Assign Actions to the thumbnails
footer_mc.multiplebgs_mc.bg1_mc.onRollOver = function() {
this._alpha = 80;
};
footer_mc.multiplebgs_mc.bg1_mc.onRollOut = footer_mc.multiplebgs_mc.bg1_mc.onReleaseOutside=function () {
this._alpha = 100;
};
footer_mc.multiplebgs_mc.bg1_mc.onRelease = function() {
smoothImageLoad(backgroundImage,background_mc.target_mc);
};
footer_mc.multiplebgs_mc.bg2_mc.onRollOver = function() {
this._alpha = 80;
};
footer_mc.multiplebgs_mc.bg2_mc.onRollOut = footer_mc.multiplebgs_mc.bg2_mc.onReleaseOutside=function () {
this._alpha = 100;
};
footer_mc.multiplebgs_mc.bg2_mc.onRelease = function() {
smoothImageLoad(backgroundImage2,background_mc.target_mc);
};
footer_mc.multiplebgs_mc.bg3_mc.onRollOver = function() {
this._alpha = 80;
};
footer_mc.multiplebgs_mc.bg3_mc.onRollOut = footer_mc.multiplebgs_mc.bg3_mc.onReleaseOutside=function () {
this._alpha = 100;
};
footer_mc.multiplebgs_mc.bg3_mc.onRelease = function() {
smoothImageLoad(backgroundImage3,background_mc.target_mc);
};
}
soundOn = this.firstChild.childNodes[0].attributes.backgroundMusic;
mySound = this.firstChild.childNodes[0].attributes.myMusic;
if (soundOn == "yes") {
footer_mc.musicControls_mc._visible = true;
}
animationType = this.firstChild.childNodes[0].attributes.animationType;
// Fade in the main background image
smoothImageLoad(backgroundImage,background_mc.target_mc);
// Give objects their respective colors
navActiveColor = this.firstChild.childNodes[0].attributes.navActiveColor;
navRollOverColor = this.firstChild.childNodes[0].attributes.navRollOverColor;
contentBGColor = this.firstChild.childNodes[0].attributes.content_BG_Color;
var bgColor = new Color(contentBG_mc.contentbackground_mc);
bgColor.setRGB(contentBGColor);
siteBGColor = this.firstChild.childNodes[0].attributes.site_BG_Color;
var mainBgColor = new Color(backgroundColor_mc);
mainBgColor.setRGB(siteBGColor);
footerInfo = this.firstChild.childNodes[1].firstChild.nodeValue;
footer_mc.footer_txt.autoSize = "LEFT";
footer_mc.footer_txt.html = true;
footer_mc.footer_txt.styleSheet = txtCSS;
footer_mc.footer_txt.htmlText = footerInfo;
navigationXML.load(xml_navigation);
} else {
trace("Cannot load config XML");
}
};
// Function for smoothing resizable bitmaps
function smoothImageLoad(imgURL, targetMovie) {
var i = 0;
do {
i++;
} while (eval("_root.smoothImageLoadTemp"+i) != undefined);
tmc = targetMovie.createEmptyMovieClip("smoothImageLoadTemp"+i, targetMovie.getNextHighestDepth());
tmc.createEmptyMovieClip("ti",tmc.getNextHighestDepth());
tmc.tm = targetMovie;
with (tmc) {
tmcl = new MovieClipLoader();
tmcl.onLoadComplete = function() {
var fadeBG:Tween = new Tween(targetMovie, "_alpha", None.easeOut, 0, 100, 1, true);
ti.onEnterFrame = function() {
pixelData = new flash.display.BitmapData(ti._width, ti._height);
_global.BGW = ti._width;
_global.BGH = ti._height;
pixelData.draw(ti);
tm.attachBitmap(pixelData,1,true,true);
tm.smoothImageLoadComplete();
_parent._parent._parent.position();
removeMovieClip(ti._parent);
};
};
tmcl.loadClip(imgURL,tmc.ti);
}
}
// Load the config xml file
configXML.load(xml_config);
// Function for showing the submenu
var showingSubmenu:Boolean = false;
function showSubmenu() {
showingSubmenu = true;
subnavbar_mc._visible = true;
subnavbar_mc._alpha = 0;
var resetNavbar:Tween = new Tween(navbar_mc, "_y", Regular.easeOut, navbar_mc._y, headerbg_mc._height-45, 0.3, true);
resetNavbar.onMotionFinished = function() {
var showSubnav:Tween = new Tween(subnavbar_mc, "_alpha", None.easeOut, 0, 100, 0.3, true);
};
}
// Loading submenu items
function loadSubmenu(mySubmenu) {
showSubmenu();
var submenuXML:XML = new XML();
submenuXML.ignoreWhite = true;
var submenuTypes:Array = new Array();
var subMenu:Array = new Array();
var submenuAssets:Array = new Array();
submenuStartPosition = 0;
submenuXML.onLoad = function(success) {
if (success) {
// Find total # of links
var total:Number = this.firstChild.childNodes.length;
for (var j:Number = 0; j<99; j++) {
removeMovieClip(subnavbar_mc.container_mc["subnav_mc"+j]);
}
for (var i:Number = 0; i<total; i++) {
submenuTypes.push(this.firstChild.childNodes[i].attributes.type);
subMenu.push(this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
submenuAssets.push(this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue);
var navItem_mc:MovieClip = subnavbar_mc.container_mc.attachMovie("subnavButton_mc", "subnav_mc"+i, i);
navItem_mc.ID = i;
navItem_mc.navText_txt.html = true;
navItem_mc.navText_txt.autoSize = "LEFT";
navItem_mc.navText_txt.htmlText = subMenu[i];
navItem_mc.navText_txt._x += submenuStartPosition;
// Space out the links
submenuStartPosition += navItem_mc._width+navPadding;
// Color the links
var navColor = new Color(navItem_mc.navText_txt);
navColor.setRGB(navActiveColor);
// Link click event
navItem_mc.onRelease = function() {
firstLoad = false;
loadAsset(submenuTypes[this.ID],submenuAssets[this.ID]);
// Enable all other links
for (var j:Number = 0; j<total; j++) {
this._parent["subnav_mc"+j].enabled = true;
var navColor = new Color(this._parent["subnav_mc"+j]);
navColor.setRGB(navActiveColor);
}
var navColor = new Color(this);
navColor.setRGB(navRollOverColor);
// Disable clicked link
this.enabled = false;
};
// Link roll over event
navItem_mc.onRollOver = function() {
var navColor = new Color(this);
navColor.setRGB(navRollOverColor);
};
navItem_mc.onRollOut = navItem_mc.onReleaseOutside=function () {
var navColor = new Color(this);
navColor.setRGB(navActiveColor);
};
}
position();
} else {
trace("Cannot load submenu XML");
}
};
submenuXML.load(mySubmenu);
}
// Closing sub menu
function closeSubmenu() {
showingSubmenu = false;
var hideSubnav:Tween = new Tween(subnavbar_mc, "_alpha", None.easeOut, 100, 0, 0.3, true);
hideSubnav.onMotionFinished = function() {
subnavbar_mc._visible = false;
var resetNavbar:Tween = new Tween(navbar_mc, "_y", Regular.easeOut, navbar_mc._y, headerbg_mc._height-20, 0.3, true);
};
}
// Link handling
function loadAsset(type, asset) {
switch (type) {
// slideshow module
case "slideshow" :
Mouse.removeListener(mouseListener);
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
}
break;
// text module
case "text" :
Mouse.removeListener(mouseListener);
if (animationType == "slide") {
contentBG_mc.module_text_mc._visible = true;
contentBG_mc.module_text_mc.target_mc._y = 0;
var txtXML:XML = new XML();
txtXML.ignoreWhite = true;
txtXML.onLoad = function(success) {
if (success) {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
contentBG_mc.module_text_mc._visible = true;
picture = txtXML.firstChild.childNodes[0].firstChild.nodeValue;
var thisText:String = txtXML.firstChild.childNodes[1].firstChild.nodeValue;
contentBG_mc.module_text_mc.target_mc.body_txt.htmlText = thisText;
contentBG_mc.module_text_mc.scrollInfo();
loadMovie(picture, contentBG_mc.module_text_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.module_text_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else {
trace("Cannot load XML");
}
};
txtXML.load(asset);
} else if (animationType == "fade") {
contentBG_mc.module_text_mc._visible = true;
contentBG_mc.module_text_mc.target_mc._y = 0;
var txtXML:XML = new XML();
txtXML.ignoreWhite = true;
txtXML.onLoad = function(success) {
if (success) {
resetAll();
contentBG_mc.module_text_mc._visible = true;
picture = txtXML.firstChild.childNodes[0].firstChild.nodeValue;
var thisText:String = txtXML.firstChild.childNodes[1].firstChild.nodeValue;
contentBG_mc.module_text_mc.target_mc.body_txt.htmlText = thisText;
contentBG_mc.module_text_mc.scrollInfo();
loadMovie(picture, contentBG_mc.module_text_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.module_text_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
} else {
trace("Cannot load XML");
}
};
txtXML.load(asset);
}
break;
// news module
case "news" :
Mouse.removeListener(mouseListener);
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
}
break;
// swf module
case "swf" :
Mouse.removeListener(mouseListener);
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
}
break;
// video gallery module
case "gallery-video" :
Mouse.removeListener(mouseListener);
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
}
break;
// mp3 player module
case "mp3player" :
Mouse.removeListener(mouseListener);
musicState = false;
footer_mc.musicControls_mc.gotoAndStop(2);
my_sound.stop();
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
}
break;
// staff module
case "staff" :
Mouse.removeListener(mouseListener);
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
}
break;
// traditional gallery module
case "gallery-traditional" :
Mouse.removeListener(mouseListener);
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
site_section = "gallery-traditional";
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
site_section = "gallery-traditional";
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.container_mc, "_alpha", Strong.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
}
break;
// scrolling gallery module
case "gallery-scrolling" :
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
site_section = "gallery-scrolling";
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.container_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
site_section = "gallery-scrolling";
contentBG_mc.container_mc._visible = true;
loadMovie(asset, contentBG_mc.container_mc);
var moveContent:Tween = new Tween(contentBG_mc.container_mc, "_alpha", Strong.easeOut, 0, 100, 0.5, true);
}
break;
// opening external links
case "url" :
getURL(asset, "_blank");
break;
// contact module
case "contact" :
Mouse.removeListener(mouseListener);
if (animationType == "slide") {
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);
} else {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, -500, -700, 0.5, true);
}
move1Content.onMotionFinished = function() {
resetAll();
contentBG_mc.module_contact_mc._visible = true;
var move2Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeOut, Stage.width+500, Stage.width/2, 0.5, true);
move2Content.onMotionFinished = function() {
var move3Content:Tween = new Tween(contentBG_mc.module_contact_mc, "_alpha", None.easeOut, contentBG_mc.container_mc._alpha, 100, 1, true);
};
};
} else if (animationType == "fade") {
resetAll();
contentBG_mc.module_contact_mc._visible = true;
var moveContent:Tween = new Tween(contentBG_mc.module_contact_mc, "_alpha", Strong.easeOut, 0, 100, 0.5, true);
}
break;
// alert user that the content type is incorrectly set (in debug mode)
default :
trace("You have incorrectly set this navigation type");
break;
}
}
// function for going fullscreen
function toggleFullScreen() {
if (Stage["displayState"] == "normal") {
Stage["displayState"] = "fullScreen";
} else {
Stage["displayState"] = "normal";
}
position();
}
footer_mc.toggleFS_mc.onRollOver = function() {
this._alpha = 80;
};
footer_mc.toggleFS_mc.onRollOut = footer_mc.toggleFS_mc.onReleaseOutside=function () {
this._alpha = 100;
};
// button executes fullscreen function
footer_mc.toggleFS_mc.onRelease = function() {
toggleFullScreen();
};
var musicState:Boolean = true;
footer_mc.musicControls_mc.onRelease = function() {
if (musicState == true) {
this.gotoAndStop(2);
my_sound.stop();
musicState = false;
} else {
this.gotoAndStop(1);
my_sound.onLoad = function(success:Boolean) {
if (success) {
my_sound.start(0,999);
status_txt.text = "Sound loaded";
} else {
status_txt.text = "Sound failed";
}
};
my_sound.loadSound(mySound, false);
musicState = true;
}
};
footer_mc.musicControls_mc.onRollOver = function() {
this._alpha = 80;
};
footer_mc.musicControls_mc.onRollOut = footer_mc.musicControls_mc.onReleaseOutside = function() {
this._alpha = 100;
};
PD: yo también quede mirándolo como... WTF!