Problem with container
B_Saraiva Sep 13, 2009 8:56 AMHello.
I'm making a website and i'm a bit new to AS.
Hope you can welp me.
I have a modified website in my hands. Its based in xml. I have a accordion menu, one button in particular has two submenus, i've been reading the code but i'm having some problems. Well i want the container of my swf's have the same size for these tree buttons in particular. The first has the size i want, the second is a bit smaller and the third is even smaller. No problems with the rest of the menu.
Another thing i want to put fullscreen.
Thanks!!
I'm posting the code:
function loadPage(no1, no2)
{
swfAd = false;
if (__musicPlaying)
{
muteFunction(100);
} // end if
var _loc4;
if (no2 != undefined)
{
_loc4 = xml.firstChild.childNodes[1].childNodes[no1].childNodes[no2].attributes.src;
__height = Number(xml.firstChild.childNodes[1].childNodes[no1].childNodes[no2].attributes.height) + pageMargin * 2;
_root.xmlPath = null;
if (xml.firstChild.childNodes[1].childNodes[no1].childNodes[no2].attributes.xmlPath != undefined)
{
_root.xmlPath = xml.firstChild.childNodes[1].childNodes[no1].childNodes[no2].attributes.xmlPath;
} // end if
}
else
{
_loc4 = xml.firstChild.childNodes[1].childNodes[no1].attributes.src;
__height = Number(xml.firstChild.childNodes[1].childNodes[no1].attributes.height) + pageMargin * 2;
_root.xmlPath = null;
if (xml.firstChild.childNodes[1].childNodes[no1].childNodes[no2].attributes.xmlPath != undefined)
{
_root.xmlPath = xml.firstChild.childNodes[1].childNodes[no1].childNodes[no2].attributes.xmlPath;
} // end if
} // end else if
if (firstPage)
{
firstPage = false;
mcPage.mcBack._height = 50;
mcPage.mcHolder._y = Math.round((300 - __height) / 2 + pageMargin);
doOnResize();
gs.TweenMax.to(mcPage.mcHolder, 0, {autoAlpha: 0});
gs.TweenMax.to(mcPage, 5.000000E-001, {_x: 300, onComplete: loadNow, onCompleteParams: [_loc4]});
}
else
{
gs.TweenMax.to(mcPage.mcHolder, 2.000000E-001, {autoAlpha: 0, onComplete: resetPage});
gs.TweenMax.to(mcPage.mcHolder, 0, {_y: Math.round((300 - __height) / 2 + pageMargin), delay: 2.100000E-001});
gs.TweenMax.to(mcPage.mcBack, 3.000000E-001, {_height: 50, onComplete: loadNow, onCompleteParams: [_loc4], onUpdate: doOnResize, delay: 2.100000E-001});
} // end else if
} // End of the function
function resetPage()
{
removeMovieClip (mcPage.mcHolder);
mcPage.createEmptyMovieClip("mcHolder", mcPage.getNextHighestDepth());
mcPage.mcHolder._x = Math.ceil(pageMargin);
} // End of the function
function loadNow(__url)
{
pageLoader.loadClip(__url, mcPage.mcHolder);
} // End of the function
function loadBackground(path)
{
if (firstTime)
{
var _loc4 = new MovieClipLoader();
var _loc5 = new Object();
_loc5.onLoadInit = function (cPhoto)
{
mcPattern._alpha = 0;
var _loc2 = cPhoto._width;
var _loc1 = 1;
do
{
var _loc3 = new flash.display.BitmapData(_loc2, _loc2, true, 16777215);
_loc3.draw(mcPattern);
mcPattern.createEmptyMovieClip("mcPattern" + _loc1 + "1", mcPattern.getNextHighestDepth());
mcPattern.createEmptyMovieClip("mcPattern" + _loc1 + "2", mcPattern.getNextHighestDepth());
mcPattern.createEmptyMovieClip("mcPattern" + _loc1 + "3", mcPattern.getNextHighestDepth());
mcPattern["mcPattern" + _loc1 + "1"].attachBitmap(_loc3, 1);
mcPattern["mcPattern" + _loc1 + "2"].attachBitmap(_loc3, 1);
mcPattern["mcPattern" + _loc1 + "3"].attachBitmap(_loc3, 1);
mcPattern["mcPattern" + _loc1 + "1"]._x = _loc2;
mcPattern["mcPattern" + _loc1 + "2"]._y = _loc2;
mcPattern["mcPattern" + _loc1 + "3"]._x = _loc2;
mcPattern["mcPattern" + _loc1 + "3"]._y = _loc2;
_loc2 = _loc2 * 2;
++_loc1;
} while (_loc2 / 2 < 4000)
};
_loc4.addListener(_loc5);
_loc4.loadClip(xml.firstChild.firstChild.attributes.backPattern, mcPattern);
} // end if
var backLoader = new MovieClipLoader();
var _loc3 = new Object();
_loc3.onLoadProgress = function (cBack, cLoaded, cTotal)
{
if (firstTime)
{
mcPreloader.txtNumbers.text = Math.round(cLoaded * 100 / cTotal);
mcPreloader.mcMask._width = Math.round(cLoaded * 100 / cTotal) * 2;
if (cLoaded == cTotal)
{
gs.TweenMax.to(mcPreloader.mcMask, 2.000000E-001, {_width: 0});
} // end if
} // end if
};
_loc3.onLoadInit = function (cBack)
{
if (firstTime)
{
setTimeout(loadMusic, 50);
gs.TweenMax.to(mcPreview, 5.000000E-001, {autoAlpha: 50});
} // end if
var _loc2 = new flash.display.BitmapData(cBack._width, cBack._height);
_loc2.draw(cBack);
gs.TweenMax.to(mcBackground, 6.000000E-001, {colorTransform: {brightness: 0}, ease: gs.easing.CustomEase.byName("customOutEase")});
setTimeout(changeBack, 600, _loc2, backLoader);
mcBackground.__width = cBack._width;
mcBackground.__height = cBack._height;
};
backLoader.addListener(_loc3);
if (firstTime || xml.firstChild.firstChild.attributes.useOnlyOneBackground == "false")
{
backLoader.loadClip(path, mcTempBg);
} // end if
} // End of the function
function changeBack(bitmap, loader)
{
mcBackground._xscale = mcBackground._yscale = 100;
removeMovieClip (mcBackground.back);
mcBackground.createEmptyMovieClip("back", mcBackground.getNextHighestDepth());
mcBackground.back.attachBitmap(bitmap, mcBackground.back.getNextHighestDepth(), "auto", true);
loader.unloadClip(mcTempBg);
doOnResize();
gs.TweenMax.to(mcBackground, 8.000000E-001, {colorTransform: {brightness: Number(xml.firstChild.firstChild.attributes.backBrightness) / 100}, ease: gs.easing.CustomEase.byName("customOutEase")});
if (firstTime)
{
firstTime = false;
setTimeout(buildHeader, 510);
setTimeout(buildMenu, 1400);
mcPattern._alpha = Number(xml.firstChild.firstChild.attributes.backPatternOpacity);
gs.TweenMax.from(mcPattern, 3.000000E-001, {_alpha: 0});
} // end if
} // End of the function
function buildHeader()
{
var _loc1 = writeText(String(xml.firstChild.firstChild.attributes.title), txtHeader1, 25);
gs.TweenMax.to(txtHeader1, 0, {tint: Number(xml.firstChild.firstChild.attributes.titleText)});
gs.TweenMax.to(mcHeaderBack1, 0, {tint: Number(xml.firstChild.firstChild.attributes.titleColor)});
gs.TweenMax.to(mcHeaderTip1, 0, {tint: Number(xml.firstChild.firstChild.attributes.titleColor)});
gs.TweenMax.to(mcHeaderBack1, _loc1.__length / 1000 + 1.000000E-001, {_width: _loc1.__width + 100, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(mcHeaderTip1, _loc1.__length / 1000 + 1.000000E-001, {_x: _loc1.__width + 29, ease: gs.easing.CustomEase.byName("customOutEase")});
_loc1 = writeText(String(xml.firstChild.firstChild.attributes.subtitle), txtHeader2, 25);
gs.TweenMax.to(txtHeader2, 0, {tint: Number(xml.firstChild.firstChild.attributes.subtitleText)});
gs.TweenMax.to(mcHeaderBack2, 0, {tint: Number(xml.firstChild.firstChild.attributes.subtitleColor)});
gs.TweenMax.to(mcHeaderTip2, 0, {tint: Number(xml.firstChild.firstChild.attributes.subtitleColor)});
gs.TweenMax.to(mcHeaderBack2, _loc1.__length / 1000 + 1.000000E-001, {_width: _loc1.__width + 100, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(mcHeaderTip2, _loc1.__length / 1000 + 1.000000E-001, {_x: _loc1.__width + 29, ease: gs.easing.CustomEase.byName("customOutEase")});
} // End of the function
function buildMenu()
{
var _loc15 = 0;
for (var _loc3 = 0; _loc3 < xml.firstChild.childNodes[1].childNodes.length; ++_loc3)
{
mcMenu.attachMovie("button", "mcButton" + _loc3, mcMenu.getNextHighestDepth());
mcMenu["mcButton" + _loc3].background = xml.firstChild.childNodes[1].childNodes[_loc3].attributes.back;
mcMenu["mcButton" + _loc3].type = xml.firstChild.childNodes[1].childNodes[_loc3].attributes.type;
mcMenu["mcButton" + _loc3].no = _loc3;
mcMenu["mcButton" + _loc3]._y = mcMenu["mcButton" + _loc3].defY = _loc15;
_loc15 = _loc15 + (mcMenu["mcButton" + _loc3].mcBack._height + 3);
new Color(mcMenu["mcButton" + _loc3].mcBack).setRGB(_menuButton);
new Color(mcMenu["mcButton" + _loc3].mcTip).setRGB(_menuButton);
new Color(mcMenu["mcButton" + _loc3].txtButton).setRGB(_menuText);
mcMenu["mcButton" + _loc3]._title1 = String(xml.firstChild.childNodes[1].childNodes[_loc3].attributes.title1);
mcMenu["mcButton" + _loc3]._title2 = String(xml.firstChild.childNodes[1].childNodes[_loc3].attributes.title2);
mcMenu["mcButton" + _loc3].txtButton.text = mcMenu["mcButton" + _loc3]._title1;
mcMenu["mcButton" + _loc3].txtButton.autoSize = true;
mcMenu["mcButton" + _loc3].mcBack._width = mcMenu["mcButton" + _loc3].txtButton._width * 2;
mcMenu["mcButton" + _loc3].mcTip._x = mcMenu["mcButton" + _loc3].mcBack._width;
mcMenu["mcButton" + _loc3].mcHover._width = mcMenu["mcButton" + _loc3].mcBack._width + mcMenu["mcButton" + _loc3].mcTip._width;
gs.TweenMax.to(mcMenu["mcButton" + _loc3], 0, {autoAlpha: 0});
gs.TweenMax.from(mcMenu["mcButton" + _loc3], 2.000000E-001, {_y: mcMenu["mcButton" + _loc3]._y + mcMenu["mcButton" + _loc3]._height * 2, delay: _loc3 * 1.000000E-001});
gs.TweenMax.to(mcMenu["mcButton" + _loc3], 2.000000E-001, {autoAlpha: 100, delay: _loc3 * 1.000000E-001});
var _loc16 = new Object();
mcMenu["mcButton" + _loc3].mcHover.onRollOver = function ()
{
var _loc2 = this._parent;
if (_loc2 != selectedBtn)
{
var _loc3 = writeText(_loc2._title2, _loc2.txtButton, 15);
gs.TweenMax.to(_loc2.txtButton, 1.000000E-001, {tint: _menuTextRoll});
gs.TweenMax.to(_loc2.mcBack, 1.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(_loc2.mcTip, 1.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(_loc2.mcBack, _loc3.__length / 1000 + 1.000000E-001, {_width: _loc3.__width + 20, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcHover, _loc3.__length / 1000 + 1.000000E-001, {_width: _loc3.__width + _loc2.mcTip._width * 2, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcTip, _loc3.__length / 1000 + 1.000000E-001, {_x: _loc3.__width + 20, ease: gs.easing.CustomEase.byName("customOutEase")});
} // end if
};
mcMenu["mcButton" + _loc3].mcHover.onRollOut = mcMenu["mcButton" + _loc3].mcHover.onReleaseOutside = function ()
{
var _loc2 = this._parent;
if (_loc2 != selectedBtn)
{
var _loc3 = writeText(_loc2._title1, _loc2.txtButton, 15);
gs.TweenMax.to(_loc2.txtButton, 1.000000E-001, {tint: _menuText});
gs.TweenMax.to(_loc2.mcBack, 1.000000E-001, {tint: _menuButton});
gs.TweenMax.to(_loc2.mcTip, 1.000000E-001, {tint: _menuButton});
gs.TweenMax.to(_loc2.mcBack, _loc3.__length / 1000 + 1.000000E-001, {_width: _loc3.__width * 2, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcHover, _loc3.__length / 1000 + 1.000000E-001, {_width: _loc3.__width * 2 + _loc2.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcTip, _loc3.__length / 1000 + 1.000000E-001, {_x: _loc3.__width * 2, ease: gs.easing.CustomEase.byName("customOutEase")});
} // end if
};
mcMenu["mcButton" + _loc3].mcHover.onRelease = function ()
{
var _loc4 = this._parent;
if (_loc4 != selectedBtn)
{
if (_loc4.type != "link")
{
var _loc3 = 2.000000E-001;
if (selectedBtn.type == "multiple")
{
for (var _loc2 = selectedBtn.no + 1; _loc2 < xml.firstChild.childNodes[1].childNodes.length; ++_loc2)
{
gs.TweenMax.to(mcMenu["mcButton" + _loc2], 2.000000E-001, {_y: mcMenu["mcButton" + _loc2].defY});
} // end of for
for (var _loc2 = 0; _loc2 < selectedBtn.nos; ++_loc2)
{
gs.TweenMax.from(selectedBtn.mcHolder["mcButton" + _loc2], 2.000000E-001, {_y: 0, delay: _loc2 * 4.000000E-002, onComplete: positionButton, onCompleteParams: [selectedBtn.mcHolder["mcButton" + _loc2]]});
gs.TweenMax.to(selectedBtn.mcHolder["mcButton" + _loc2], 1.000000E-001, {autoAlpha: 0, delay: _loc2 * 4.000000E-002});
} // end of for
} // end if
gs.TweenMax.to(selectedBtn.txtButton, 1.000000E-001, {tint: _menuText});
gs.TweenMax.to(selectedBtn.mcBack, 1.000000E-001, {tint: _menuButton});
gs.TweenMax.to(selectedBtn.mcTip, 1.000000E-001, {tint: _menuButton});
selectedBtn = _loc4;
var _loc10 = writeText(selectedBtn._title1, _loc4.txtButton, 15);
gs.TweenMax.to(selectedBtn.mcBack, _loc10.__length / 1000 + 1.000000E-001, {_width: _loc10.__width * 2, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc4.mcHover, _loc10.__length / 1000 + 1.000000E-001, {_width: _loc10.__width * 2 + _loc4.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn.mcTip, _loc10.__length / 1000 + 1.000000E-001, {_x: _loc10.__width * 2, ease: gs.easing.CustomEase.byName("customOutEase")});
swfAd = true;
SWFAddress.setTitle(xml.firstChild.firstChild.attributes.mainTitle + " - " + xml.firstChild.childNodes[1].childNodes[selectedBtn.no].attributes.pageTitle);
SWFAddress.setValue(xml.firstChild.childNodes[1].childNodes[selectedBtn.no].attributes.pa geTitle.toLowerCase());
if (_loc4.type == "single")
{
loadBackground(_loc4.background);
loadPage(_loc4.no);
}
else if (_loc4.type == "multiple")
{
for (var _loc2 = selectedBtn.no + 1; _loc2 < xml.firstChild.childNodes[1].childNodes.length; ++_loc2)
{
gs.TweenMax.to(mcMenu["mcButton" + _loc2], 2.000000E-001, {_y: mcMenu["mcButton" + _loc2].defY + selectedBtn.mcHolder._height, delay: _loc3});
} // end of for
for (var _loc2 = 0; _loc2 < selectedBtn.nos; ++_loc2)
{
gs.TweenMax.from(selectedBtn.mcHolder["mcButton" + _loc2], 2.000000E-001, {_y: 0, delay: _loc2 * 1.000000E-001 + _loc3});
gs.TweenMax.to(selectedBtn.mcHolder["mcButton" + _loc2], 2.000000E-001, {autoAlpha: 100, delay: _loc2 * 1.000000E-001 + _loc3});
} // end of for
} // end else if
}
else
{
getURL(xml.firstChild.childNodes[1].childNodes[_loc4.no].attributes.src, "_blank");
} // end if
} // end else if
};
if (mcMenu["mcButton" + _loc3].type == "multiple")
{
mcMenu["mcButton" + _loc3].nos = xml.firstChild.childNodes[1].childNodes[_loc3].childNodes.length;
var _loc6 = 0;
for (var _loc2 = 0; _loc2 < xml.firstChild.childNodes[1].childNodes[_loc3].childNodes.length; ++_loc2)
{
mcMenu["mcButton" + _loc3].mcHolder.attachMovie("button2", "mcButton" + _loc2, mcMenu["mcButton" + _loc3].mcHolder.getNextHighestDepth());
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].type = "single";
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].back = xml.firstChild.childNodes[1].childNodes[_loc3].childNodes[_loc2].attributes.back;
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].no1 = _loc3;
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].no2 = _loc2;
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2]._y = mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].defY = _loc6;
_loc6 = _loc6 + (mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcBack._height + 2);
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].txtButton.text = xml.firstChild.childNodes[1].childNodes[_loc3].childNodes[_loc2].attributes.title;
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].txtButton.autoSize = true;
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcBack._width = mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].txtButton._width * 2;
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcTip._x = mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcBack._width;
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcHover._width = mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].txtButton._width * 2 + mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcTip._width;
new Color(mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcBack).setRGB(_menuButton);
new Color(mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcTip).setRGB(_menuButton);
new Color(mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].txtButton).setRGB(_menuText);
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].inWidth = mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcBack._width + 25;
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].outWidth = mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcBack._width;
gs.TweenMax.to(mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2], 0, {autoAlpha: 0});
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcHover.onRollOver = function ()
{
var _loc2 = this._parent;
if (_loc2 != selectedBtn2)
{
gs.TweenMax.to(_loc2.mcBack, 3.000000E-001, {_width: _loc2.inWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcHover, 3.000000E-001, {_width: _loc2.inWidth + _loc2.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcTip, 3.000000E-001, {_x: _loc2.inWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcBack, 2.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(_loc2.mcTip, 2.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(_loc2.txtButton, 2.000000E-001, {tint: _menuTextRoll});
} // end if
};
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcHover.onRollOut = function ()
{
var _loc2 = this._parent;
if (_loc2 != selectedBtn2)
{
gs.TweenMax.to(_loc2.mcBack, 3.000000E-001, {_width: _loc2.outWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcHover, 3.000000E-001, {_width: _loc2.outWidth + _loc2.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcTip, 3.000000E-001, {_x: _loc2.outWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcBack, 2.000000E-001, {tint: _menuButton});
gs.TweenMax.to(_loc2.mcTip, 2.000000E-001, {tint: _menuButton});
gs.TweenMax.to(_loc2.txtButton, 2.000000E-001, {tint: _menuText});
} // end if
};
mcMenu["mcButton" + _loc3].mcHolder["mcButton" + _loc2].mcHover.onRelease = function ()
{
var _loc2 = this._parent;
if (_loc2 != selectedBtn2)
{
swfAd = true;
SWFAddress.setTitle(xml.firstChild.firstChild.attributes.mainTitle + " - " + xml.firstChild.childNodes[1].childNodes[selectedBtn.no].attributes.pageTitle + " - " + xml.firstChild.childNodes[1].childNodes[selectedBtn.no].childNodes[_loc2.no2].attributes. pageTitle);
SWFAddress.setValue(xml.firstChild.childNodes[1].childNodes[selectedBtn.no].attributes.pa geTitle.toLowerCase() + "/" + xml.firstChild.childNodes[1].childNodes[selectedBtn.no].childNodes[_loc2.no2].attributes. pageTitle.toLowerCase());
gs.TweenMax.to(selectedBtn2.mcBack, 3.000000E-001, {_width: selectedBtn2.outWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcHover, 3.000000E-001, {_width: selectedBtn2.outWidth + selectedBtn2.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn2.mcTip, 3.000000E-001, {_x: selectedBtn2.outWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn2.mcBack, 2.000000E-001, {tint: _menuButton});
gs.TweenMax.to(selectedBtn2.mcTip, 2.000000E-001, {tint: _menuButton});
gs.TweenMax.to(selectedBtn2.txtButton, 2.000000E-001, {tint: _menuText});
selectedBtn2 = _loc2;
gs.TweenMax.to(selectedBtn2.mcBack, 3.000000E-001, {_width: selectedBtn2.inWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc2.mcHover, 3.000000E-001, {_width: selectedBtn2.inWidth + selectedBtn2.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn2.mcTip, 3.000000E-001, {_x: selectedBtn2.inWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn2.mcBack, 2.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(selectedBtn2.mcTip, 2.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(selectedBtn2.txtButton, 2.000000E-001, {tint: _menuTextRoll});
loadBackground(_loc2.back);
loadPage(_loc2.no1, _loc2.no2);
} // end if
};
} // end of for
} // end if
} // end of for
gs.TweenMax.to(btnFull, 5.000000E-001, {autoAlpha: 80});
gs.TweenMax.to(btnMute, 5.000000E-001, {autoAlpha: 80});
swfAddressThing();
menuSize = _loc15 + 3;
doOnResize();
} // End of the function
function swfAddressThing()
{
var _loc3;
if (SWFAddress.getValue().indexOf("/", 1) > 0)
{
_loc3 = SWFAddress.getValue().slice(0, SWFAddress.getValue().indexOf("/", 1));
}
else
{
_loc3 = SWFAddress.getValue();
} // end else if
for (var _loc1 = 0; _loc1 < xml.firstChild.childNodes[1].childNodes.length; ++_loc1)
{
if (_loc3.toLowerCase() == "/" + String(xml.firstChild.childNodes[1].childNodes[_loc1].attributes.pageTitle).toLowerCase() )
{
if (xml.firstChild.childNodes[1].childNodes[_loc1].attributes.type == "multiple")
{
if (selectedBtn.type != "multiple")
{
openSingle(_loc1);
} // end if
_loc3 = SWFAddress.getValue().slice(SWFAddress.getValue().indexOf("/", 1), SWFAddress.getValue().length);
for (var _loc2 = 0; _loc2 < xml.firstChild.childNodes[1].childNodes[_loc1].childNodes.length; ++_loc2)
{
if (_loc3.toLowerCase() == "/" + xml.firstChild.childNodes[1].childNodes[_loc1].childNodes[_loc2].attributes.pageTitle.toL owerCase())
{
openMultiple(_loc1, _loc2);
SWFAddress.setTitle(xml.firstChild.firstChild.attributes.mainTitle + " - " + xml.firstChild.childNodes[1].childNodes[_loc1].attributes.pageTitle + " - " + xml.firstChild.childNodes[1].childNodes[_loc1].childNodes[_loc2].attributes.pageTitle);
break;
} // end if
} // end of for
}
else
{
openSingle(_loc1);
SWFAddress.setTitle(xml.firstChild.firstChild.attributes.mainTitle + " - " + xml.firstChild.childNodes[1].childNodes[_loc1].attributes.pageTitle);
} // end else if
break;
} // end if
} // end of for
} // End of the function
function openSingle(no)
{
var _loc8 = 2.000000E-001;
if (selectedBtn.type == "multiple")
{
for (var _loc1 = selectedBtn.no + 1; _loc1 < xml.firstChild.childNodes[1].childNodes.length; ++_loc1)
{
gs.TweenMax.to(mcMenu["mcButton" + _loc1], 2.000000E-001, {_y: mcMenu["mcButton" + _loc1].defY});
} // end of for
for (var _loc1 = 0; _loc1 < selectedBtn.nos; ++_loc1)
{
gs.TweenMax.from(selectedBtn.mcHolder["mcButton" + _loc1], 2.000000E-001, {_y: 0, delay: _loc1 * 4.000000E-002, onComplete: positionButton, onCompleteParams: [selectedBtn.mcHolder["mcButton" + _loc1]]});
gs.TweenMax.to(selectedBtn.mcHolder["mcButton" + _loc1], 1.000000E-001, {autoAlpha: 0, delay: _loc1 * 4.000000E-002});
} // end of for
} // end if
gs.TweenMax.to(selectedBtn.txtButton, 1.000000E-001, {tint: _menuText});
gs.TweenMax.to(selectedBtn.mcBack, 1.000000E-001, {tint: _menuButton});
gs.TweenMax.to(selectedBtn.mcTip, 1.000000E-001, {tint: _menuButton});
selectedBtn = mcMenu["mcButton" + no];
var _loc7 = writeText(selectedBtn._title1, this2.txtButton, 15);
gs.TweenMax.to(selectedBtn.mcBack, _loc7.__length / 1000 + 1.000000E-001, {_width: _loc7.__width * 2, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn.mcHover, _loc7.__length / 1000 + 1.000000E-001, {_width: _loc7.__width * 2 + selectedBtn.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn.mcTip, _loc7.__length / 1000 + 1.000000E-001, {_x: _loc7.__width * 2, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn.txtButton, 1.000000E-001, {tint: _menuTextRoll});
gs.TweenMax.to(selectedBtn.mcBack, 1.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(selectedBtn.mcTip, 1.000000E-001, {tint: _menuButtonRoll});
if (selectedBtn.type == "single")
{
loadBackground(this2.background);
loadPage(selectedBtn.no);
}
else if (selectedBtn.type == "multiple")
{
if (firstAddress)
{
firstAddress = false;
setTimeout(delayMultiple, 1000, selectedBtn, _loc8);
}
else
{
delayMultiple(selectedBtn, _loc8);
} // end else if
} // end else if
} // End of the function
function delayMultiple(selectedBtn, multiDelay)
{
for (var _loc1 = selectedBtn.no + 1; _loc1 < xml.firstChild.childNodes[1].childNodes.length; ++_loc1)
{
gs.TweenMax.to(mcMenu["mcButton" + _loc1], 1.000000E-001, {_y: mcMenu["mcButton" + _loc1].defY + selectedBtn.mcHolder._height, delay: multiDelay});
} // end of for
for (var _loc1 = 0; _loc1 < selectedBtn.nos; ++_loc1)
{
gs.TweenMax.from(selectedBtn.mcHolder["mcButton" + _loc1], 2.000000E-001, {_y: 0, delay: _loc1 * 1.000000E-001 + multiDelay});
gs.TweenMax.to(selectedBtn.mcHolder["mcButton" + _loc1], 2.000000E-001, {autoAlpha: 100, delay: _loc1 * 1.000000E-001 + multiDelay});
} // end of for
} // End of the function
function openMultiple(no1, no2)
{
var _loc1 = mcMenu["mcButton" + no1].mcHolder["mcButton" + no2];
gs.TweenMax.to(selectedBtn2.mcBack, 3.000000E-001, {_width: selectedBtn2.outWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc1.mcHover, 3.000000E-001, {_width: selectedBtn2.outWidth + selectedBtn2.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn2.mcTip, 3.000000E-001, {_x: selectedBtn2.outWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn2.mcBack, 2.000000E-001, {tint: _menuButton});
gs.TweenMax.to(selectedBtn2.mcTip, 2.000000E-001, {tint: _menuButton});
gs.TweenMax.to(selectedBtn2.txtButton, 2.000000E-001, {tint: _menuText});
selectedBtn2 = _loc1;
gs.TweenMax.to(selectedBtn2.mcBack, 3.000000E-001, {_width: selectedBtn2.inWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(_loc1.mcHover, 3.000000E-001, {_width: selectedBtn2.inWidth + selectedBtn2.mcTip._width, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn2.mcTip, 3.000000E-001, {_x: selectedBtn2.inWidth, ease: gs.easing.CustomEase.byName("customOutEase")});
gs.TweenMax.to(selectedBtn2.mcBack, 2.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(selectedBtn2.mcTip, 2.000000E-001, {tint: _menuButtonRoll});
gs.TweenMax.to(selectedBtn2.txtButton, 2.000000E-001, {tint: _menuTextRoll});
loadBackground(_loc1.back);
loadPage(_loc1.no1, _loc1.no2);
} // End of the function
function positionButton(what)
{
what._y = what.defY;
new Color(what.mcBack).setRGB(_menuButton);
new Color(what.mcTip).setRGB(_menuButton);
new Color(what.txtButton).setRGB(_menuText);
what.mcBack._width = what.outWidth;
what.mcHover._width = what.outWidth + what.mcTip._width;
what.mcTip._x = what.outWidth;
selectedBtn2 = undefined;
} // End of the function
function writeText(what, where, how)
{
function repeatLetter()
{
where.text = where.text + letters[j];
++j;
if (j == letters.length)
{
clearInterval(where.letterInterval);
} // end if
} // End of the function
var letters = what.split("");
var j = 0;
where.autoSize = true;
where.text = what;
var _loc1 = new Object();
_loc1.__length = how * letters.length;
_loc1.__width = where._width;
where.text = "";
clearInterval(where.letterInterval);
where.letterInterval = setInterval(repeatLetter, how);
return (_loc1);
} // End of the function
function muteFunction(vol)
{
if (vol != undefined)
{
vol == 0 ? ([playingMusic = false, gs.TweenMax.to(musicVolume, 5.000000E-001, {volume: 0, onUpdate: updateVolume}), btnMute.gotoAndStop(2)]) : ([playingMusic = true, gs.TweenMax.to(musicVolume, 1, {volume: 100, onUpdate: updateVolume, delay: 3.000000E-001}), btnMute.gotoAndStop(1)]);
}
else
{
soundObj.getVolume() >= 100 ? ([__musicPlaying = false, playingMusic = false, gs.TweenMax.to(musicVolume, 1, {volume: 0, onUpdate: updateVolume}), btnMute.gotoAndStop(2)]) : ([__musicPlaying = true, gs.TweenMax.to(musicVolume, 1, {volume: 100, time: 1, onUpdate: updateVolume}), btnMute.gotoAndStop(1)]);
} // end else if
} // End of the function
function loadMusic()
{
if (xml.firstChild.firstChild.attributes.backgroundMusic != "")
{
__musicPlaying = true;
soundObj.loadSound(xml.firstChild.firstChild.attributes.backgroundMusic, true);
soundObj.onSoundComplete = function ()
{
soundObj.start(0);
};
updateVolume();
}
else
{
btnMute._x = -100;
btnFull._x = btnFull._x - 20;
} // end else if
} // End of the function
function updateVolume()
{
soundObj.setVolume(musicVolume.volume);
} // End of the function
function doOnResize()
{
mcPreview._x = Stage.width - mcPreview._width - 15;
mcPreview._y = 15;
mcMenu._y = Math.round((Stage.height - menuSize) / 2 + 50);
mcPage._y = Math.round((mcPage.mcBack._height - 300) / 2 + mcMenu._y + (menuSize - mcPage.mcBack._height) / 2);
if (firstPage)
{
mcPage._x = Math.ceil(Stage.width);
} // end if
var _loc1 = Stage.width * 100 / mcBackground.__width;
mcBackground._xscale = mcBackground._yscale = _loc1;
if (mcBackground._height < Stage.height)
{
_loc1 = Stage.height * 100 / mcBackground.__height;
mcBackground._xscale = mcBackground._yscale = _loc1;
} // end if
mcBackground._x = (Stage.width - mcBackground._width) / 2;
mcBackground._y = (Stage.height - mcBackground._height) / 2;
mcPreloader._x = Stage.width / 2;
mcPreloader._y = Stage.height / 2;
btnFull._y = btnMute._y = Stage.height - 28;
} // End of the function
var pageMargin = 7;
mcPage.mcHolder._x = pageMargin;
mcPage.mcPreloader._x = pageMargin;
var firstPage = true;
var __height;
var pageLoader = new MovieClipLoader();
var pageListener = new Object();
mcPage.mcPreloader._width = 0;
pageListener.onLoadProgress = function (cPage, cLoaded, cTotal)
{
cPage._parent.mcPreloader._width = Math.ceil(100 * cLoaded / cTotal * (Stage.width - 300 - pageMargin * 2) / 100);
};
pageListener.onLoadInit = function (cPage)
{
cPage._lockroot = true;
cPage.xmlPath = _root.xmlPath;
gs.TweenMax.to(mcPage.mcBack, 5.000000E-001, {_height: __height});
gs.TweenMax.to(cPage, 4.000000E-001, {autoAlpha: 100, delay: 5.000000E-001});
gs.TweenMax.to(cPage._parent.mcPreloader, 1.000000E-001, {_width: 0});
};
pageLoader.addListener(pageListener);
gs.plugins.TweenPlugin.activate([gs.plugins.TintPlugin, gs.plugins.ColorTransformPlugin]);
gs.easing.CustomEase.create("customOutEase", [{s: 0, cp: 8.680000E-001, e: 9.000000E-001}, {s: 9.000000E-001, cp: 9.320000E-001, e: 9.600000E-001}, {s: 9.600000E-001, cp: 9.880000E-001, e: 1}]);
var xml = new XML();
xml.ignoreWhite = true;
xml.load("home.xml");
gs.TweenMax.to(mcPreview, 0, {autoAlpha: 0});
xml.onLoad = function (succes)
{
if (succes)
{
SWFAddress.setTitle(xml.firstChild.firstChild.attributes.mainTitle);
_menuButton = Number(xml.firstChild.firstChild.attributes.menuButton);
_menuText = Number(xml.firstChild.firstChild.attributes.menuText);
_menuButtonRoll = Number(xml.firstChild.firstChild.attributes.menuButtonRoll);
_menuTextRoll = Number(xml.firstChild.firstChild.attributes.menuTextRoll);
new Color(mcPreloader.mcBack).setRGB(Number(xml.firstChild.firstChild.attributes.preloaderCol or));
new Color(mcPreloader.txtNumbers).setRGB(Number(xml.firstChild.firstChild.attributes.preloade rText));
new Color(btnFull).setRGB(Number(xml.firstChild.firstChild.attributes.footerIconsColor));
new Color(btnMute).setRGB(Number(xml.firstChild.firstChild.attributes.footerIconsColor));
setTimeout(loadBackground, 10, xml.firstChild.firstChild.attributes.back);
} // end if
};
var firstTime = true;
var menuSize = 0;
var firstAddress = true;
SWFAddress.onInit = function ()
{
};
SWFAddress.onChange = function ()
{
if (!swfAd)
{
swfAddressThing();
} // end if
};
var swfAd = true;
var selectedBtn;
var selectedBtn2;
gs.TweenMax.to(btnFull, 0, {autoAlpha: 0});
gs.TweenMax.to(btnMute, 0, {autoAlpha: 0});
btnFull.onRollOver = btnMute.onRollOver = function ()
{
gs.TweenMax.to(this, 5.000000E-001, {autoAlpha: 100});
};
btnFull.onRollOut = btnMute.onRollOut = btnFull.onReleaseOutside = btnMute.onReleaseOutside = function ()
{
gs.TweenMax.to(this, 5.000000E-001, {autoAlpha: 80});
};
muteFunction();
var playingMusic = true;
var __musicPlaying = false;
var soundObj = new Sound();
var musicVolume = new Object();
musicVolume.volume = 100;
var _menuButton;
var _menuText;
var _menuButtonRoll;
var _menuTextRoll;
mcPreloader.mcMask._width = 0;
Stage.scaleMode = "noScale";
Stage.showMenu = false;
Stage.align = "TL";
var stageListener = new Object();
stageListener.onResize = function ()
{
doOnResize();
};
Stage.addListener(stageListener);
doOnResize();