Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ACTIONS IN THE .FLA FILE //
- function slideOn()
- {
- if (slideNum > 14)
- {
- slideNum = 1;
- } // end if
- slideIn = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Strong.easeIn, mc._x, layoutItem0._x + 710, 1, true);
- slideIn.onMotionFinished = function ()
- {
- mc.attachMovie("slide" + slideNum, "slides", 1);
- slide = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Strong.easeOut, -Stage.width, Stage.width / 2 - mc._width / 2, 2, true);
- };
- } // End of the function
- function slideBack()
- {
- if (slideNum < 1)
- {
- slideNum = 1;
- } // end if
- slideOut = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Strong.easeIn, mc._x, layoutItem0._x - 710, 1, true);
- slideOut.onMotionFinished = function ()
- {
- mc.attachMovie("slide" + slideNum, "slides", 1);
- slide = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Strong.easeOut, 710, Stage.width / 2 - mc._width / 2, 2, true);
- };
- } // End of the function
- var pl = new PageLayout(_root);
- pl.newItem("content_mc", "L", "T", "", "", "", 710, 550);
- pl.newItem("navleft_mc", "L", "C");
- pl.newItem("navright_mc", "R", "C");
- pl.newItem("menu_mc", "C", "T");
- pl.newItem("logo_mc", "R", "T");
- Stage.scaleMode = "noScale";
- var slideNum = 1;
- var mc = layoutItem0.slides;
- var menu = layoutItem3.menu;
- layoutItem1._visible = layoutItem2._visible = false;
- startSlideX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Strong.easeOut, -Stage.width, Stage.width / 2 - mc._width / 2, 2, true);
- startSlideY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Strong.easeOut, Stage.height / 2 - mc._height / 2, Stage.height / 2 - mc._height / 2, 2, true);
- menuSlideIn = new mx.transitions.Tween(menu, "_y", mx.transitions.easing.Strong.easeOut, Stage.height, Stage.height - 100, 2, true);
- var myListener = new Object();
- myListener.onResize = function ()
- {
- slideTweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Strong.easeOut, mc._x, Stage.width / 2 - mc._width / 2, 1, true);
- slideTweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Strong.easeOut, mc._y, Stage.height / 2 - mc._height / 2, 1, true);
- menuSlideIn = new mx.transitions.Tween(menu, "_y", mx.transitions.easing.Strong.easeOut, menu._y, Stage.height - 100, 1, true);
- };
- Stage.addListener(myListener);
- menu.but1.onRelease = function ()
- {
- layoutItem1._visible = layoutItem2._visible = true;
- slideInLeft = new mx.transitions.Tween(layoutItem1, "_x", mx.transitions.easing.Strong.easeOut, -150, 0, 1, true);
- slideInRight = new mx.transitions.Tween(layoutItem2, "_x", mx.transitions.easing.Strong.easeOut, Stage.width, Stage.width - 160, 1, true);
- menuSlideOut = new mx.transitions.Tween(menu, "_y", mx.transitions.easing.Strong.easeOut, menu._y, Stage.height + 50, 1, true);
- menuSlideOut.onMotionFinished = function ()
- {
- menu._visible = false;
- };
- slideNum = 2;
- slideOn();
- };
- menu.but2.onRelease = function ()
- {
- menu.textClip._alpha = 0;
- menu.textClip.attachMovie("news", "newText", 1);
- if (menu._y == 50)
- {
- fadeIn = new mx.transitions.Tween(menu.textClip, "_alpha", mx.transitions.easing.Strong.easeIn, 0, 100, 1, true);
- }
- else
- {
- menuSlideUp = new mx.transitions.Tween(menu, "_y", mx.transitions.easing.Strong.easeOut, menu._y, 50, 1, true);
- menuSlideUp.onMotionFinished = function ()
- {
- fadeIn = new mx.transitions.Tween(menu.textClip, "_alpha", mx.transitions.easing.Strong.easeIn, 0, 100, 1, true);
- };
- } // end else if
- };
- menu.but3.onRelease = function ()
- {
- menu.textClip._alpha = 0;
- menu.textClip.attachMovie("invitation", "newText", 1);
- if (menu._y == 50)
- {
- fadeIn = new mx.transitions.Tween(menu.textClip, "_alpha", mx.transitions.easing.Strong.easeIn, 0, 100, 1, true);
- }
- else
- {
- menuSlideUp = new mx.transitions.Tween(menu, "_y", mx.transitions.easing.Strong.easeOut, menu._y, 50, 1, true);
- menuSlideUp.onMotionFinished = function ()
- {
- fadeIn = new mx.transitions.Tween(menu.textClip, "_alpha", mx.transitions.easing.Strong.easeIn, 0, 100, 1, true);
- };
- } // end else if
- };
- menu.but4.onRelease = function ()
- {
- menu.textClip._alpha = 0;
- menu.textClip.attachMovie("contact", "newText", 1);
- if (menu._y == 50)
- {
- fadeIn = new mx.transitions.Tween(menu.textClip, "_alpha", mx.transitions.easing.Strong.easeIn, 0, 100, 1, true);
- }
- else
- {
- menuSlideUp = new mx.transitions.Tween(menu, "_y", mx.transitions.easing.Strong.easeOut, menu._y, 50, 1, true);
- menuSlideUp.onMotionFinished = function ()
- {
- fadeIn = new mx.transitions.Tween(menu.textClip, "_alpha", mx.transitions.easing.Strong.easeIn, 0, 100, 1, true);
- };
- } // end else if
- };
- layoutItem2.butNext.onRelease = function ()
- {
- slideNum = slideNum + 1;
- slideOn();
- };
- layoutItem1.butClose.onRelease = function ()
- {
- slideInLeft = new mx.transitions.Tween(layoutItem1, "_x", mx.transitions.easing.Strong.easeOut, layoutItem1._x, -150, 1, true);
- slideInRight = new mx.transitions.Tween(layoutItem2, "_x", mx.transitions.easing.Strong.easeOut, layoutItem2._x, Stage.width, 1, true);
- menu._y = Stage.height;
- menu._visible = true;
- menuSlideIn = new mx.transitions.Tween(menu, "_y", mx.transitions.easing.Strong.easeOut, menu._y, Stage.height - 100, 1, true);
- menuSlideIn.onMotionFinished = function ()
- {
- layoutItem1._visible = layoutItem2._visible = false;
- };
- if (slideNum > 1)
- {
- slideNum = 1;
- slideOn();
- } // end if
- };
- // ACTIONS IN THE LayoutItem.as //
- class LayoutItem
- {
- function LayoutItem()
- {
- } // End of the function
- var offset_x = 0;
- var offset_y = 0;
- var offset_x_pct = 0;
- var offset_y_pct = 0;
- } // End of Class
- // ACTIONS IN THE Pagelayout.as //
- class PageLayout
- {
- var _pages, _target_mc;
- function PageLayout(target_mc)
- {
- _pages = new Array();
- Stage.align = "TL";
- Stage.scaleMode = "noScale";
- _target_mc = target_mc;
- _idc = 0;
- Stage.addListener(this);
- } // End of the function
- function newItem(symbolName, align_x, align_y, scale, xOffset, yOffset, width, height)
- {
- var _loc2 = new LayoutItem();
- _loc2.mc = _target_mc.attachMovie(symbolName, "layoutItem" + _idc, _idc);
- trace ("new mc is: " + _loc2.mc);
- _loc2.align_x = align_x;
- _loc2.align_y = align_y;
- _loc2.scale = scale;
- if (typeof(xOffset) == "String")
- {
- _loc2.offset_x_pct = xOffset;
- }
- else
- {
- _loc2.offset_x = xOffset;
- } // end else if
- if (typeof(yOffset) == "String")
- {
- _loc2.offset_y_pct = yOffset;
- }
- else
- {
- _loc2.offset_y = yOffset;
- } // end else if
- if (width)
- {
- _loc2.width = width;
- _loc2.wset = true;
- }
- else
- {
- _loc2.width = _loc2.mc._width;
- _loc2.wset = false;
- } // end else if
- if (height)
- {
- _loc2.height = height;
- _loc2.hset = true;
- }
- else
- {
- _loc2.height = _loc2.mc._height;
- _loc2.hset = false;
- } // end else if
- _pages.push(_loc2);
- ++_idc;
- this.onResize();
- return (_loc2);
- } // End of the function
- function add(obj)
- {
- } // End of the function
- function onResize()
- {
- var _loc4 = Stage.width;
- var _loc3 = Stage.height;
- for (var _loc7 in _pages)
- {
- var _loc2 = _pages[_loc7];
- if (_loc2.wset == false)
- {
- _loc2.width = _loc2.mc._width;
- } // end if
- if (_loc2.hset == false)
- {
- _loc2.height = _loc2.mc._height;
- } // end if
- if (_loc2.offset_x_pct)
- {
- _loc2.offset_x = _loc4 * _loc2.offset_x_pct / 100;
- } // end if
- if (_loc2.offset_y_pct)
- {
- _loc2.offset_y = _loc3 * _loc2.offset_y_pct / 100;
- } // end if
- if (isNaN(_loc2.offset_y))
- {
- _loc2.offset_y = 0;
- } // end if
- if (isNaN(_loc2.offset_x))
- {
- _loc2.offset_x = 0;
- } // end if
- switch (_loc2.scale)
- {
- case "F":
- {
- _loc2.mc._width = _loc4;
- _loc2.mc._height = _loc3;
- break;
- }
- case "FA":
- {
- var _loc5 = _loc4 / _loc3;
- var _loc6 = _loc2.mc._width / _loc2.mc._height;
- if (_loc6 > _loc5)
- {
- _loc2.mc._height = _loc3;
- _loc2.mc._xscale = _loc2.mc._yscale;
- }
- else
- {
- _loc2.mc._width = _loc4;
- _loc2.mc._yscale = _loc2.mc._xscale;
- } // end else if
- break;
- }
- default:
- {
- break;
- }
- } // End of switch
- switch (_loc2.align_x)
- {
- case "L":
- {
- _loc2.mc._x = Math.floor(0 + _loc2.offset_x);
- break;
- }
- case "C":
- {
- _loc2.mc._x = Math.floor(_loc4 / 2 - _loc2.width / 2 + _loc2.offset_x);
- break;
- }
- case "R":
- {
- _loc2.mc._x = Math.floor(_loc4 - _loc2.width + _loc2.offset_x);
- break;
- }
- default:
- {
- _loc2.mc._x = Math.floor(0 + _loc2.offset_x);
- break;
- }
- } // End of switch
- switch (_loc2.align_y)
- {
- case "T":
- {
- _loc2.mc._y = Math.floor(0 + _loc2.offset_y);
- break;
- }
- case "C":
- {
- _loc2.mc._y = Math.floor(_loc3 / 2 - _loc2.height / 2 + _loc2.offset_y);
- break;
- }
- case "B":
- {
- _loc2.mc._y = Math.floor(_loc3 - _loc2.height + _loc2.offset_y);
- break;
- }
- default:
- {
- _loc2.mc._y = Math.floor(0 + _loc2.offset_y);
- break;
- }
- } // End of switch
- } // end of for...in
- } // End of the function
- var _idc = 0;
- } // End of Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement