1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
| import mx.transitions.Tween;
import mx.transitions.easing.*;
_global.slidingMenu = this;
big_width = 396;
big_height = 425;
small_width = 60;
small_height = 88;
time_for_animation = 60;
box1.id = 1;
box2.id = 2;
box3.id = 3;
box4.id = 4;
box5.id = 5;
box1.onRelease = function() {
slidingMenu.moveBoxes(this.id);
// getURL("../../../../index.php/fr/le-bimensuel","_self");
};
box2.onRelease = function() {
slidingMenu.moveBoxes(this.id);
// getURL("../../../../index.php/fr/fil-rouge","_self");
};
box3.onRelease = function() {
slidingMenu.moveBoxes(this.id);
// getURL("../../../../index.php/fr/dossiers","_self");
};
box4.onRelease = function() {
slidingMenu.moveBoxes(this.id);
// getURL("../../../../index.php/fr/les-clubs","_self");
};
box5.onRelease = function() {
slidingMenu.moveBoxes(this.id);
// getURL("../../../../index.php/fr/conseil-a-seminaire","_self");
};
box5._visible=false;
//box1.id = 1;
//box2.id = 2;
//box3.id = 3;
//box4.id = 4;
//box5.id = 5;
for (var i:Number = 1; i<6; i++) {
this["box"+i].onRollOver = function() {
slidingMenu.RollOverBoxes(this.id);
};
this["box"+i].onRollOut = this["box"+i].onReleaseOutside=function () {
slidingMenu.RollOutBoxes(this.id);
};
}
slidingMenu.RollOverBoxes = function(boxNumber:Number) {
if (_root.link<>boxNumber) {
var cBox:MovieClip = eval('box'+boxNumber);
cBox.gotoAndPlay("s1");
}
};
slidingMenu.RollOutBoxes = function(boxNumber:Number) {
if (_root.link<>boxNumber) {
var cBox:MovieClip = eval('box'+boxNumber);
cBox.gotoAndPlay("s2");
}
};
slidingMenu.moveBoxes = function(boxNumber:Number) {
if (_root.link<>boxNumber) {
s = new Sound();
s.attachSound("p");
s.start(0, 1);
k = 1;
eval('box'+_root.link).gotoAndPlay("s2");
for (var i:Number = 1; i<7; i++) {
var cBox:MovieClip = eval('box'+i);
if (i == boxNumber) {
_root.link_prev = _root.link;
_root.link = boxNumber;
}
if (i == boxNumber) {
//new Tween(cBox, "_width", Strong.easeOut, cBox._width, big_width, time_for_animation, false);
//new Tween(cBox, "_height", Strong.easeOut, cBox._height, big_width, time_for_animation, false);
new Tween(cBox, "_x", Elastic.easeOut, cBox._x, 0, time_for_animation, false);
} else {
//new Tween(cBox, "_width", Strong.easeOut, cBox._width, small_width, time_for_animation, false);
//new Tween(cBox, "_height", Strong.easeOut, cBox._height, small_height + Math.random()*100, time_for_animation, false);
// new Tween(cBox, "_x", Strong.easeOut, cBox._x, (k-1)*46-137, time_for_animation, false);
new Tween(cBox, "_x", Strong.easeOut, cBox._x, (k-1)*46-137, time_for_animation, false);
k++;
}
//trace(_root.pages2._x)
new Tween(_root.pages2, "_x", Strong.easeOut, _root.pages2._x, 1150-_root.link*550, time_for_animation-10, false);
if(_root.link==1) {
new Tween(_root.pages2, "_x", Strong.easeOut, _root.pages2._x, 1150-_root.link*550, time_for_animation-10, false);
}
}
}
};
// Functions
slidingMenu.moveBoxes2 = function(boxNumber:Number) {
if (boxNumber) {
slidingMenu.boxesOrder = slidingMenu.boxesOrder.remove(boxNumber);
slidingMenu.boxesOrder = slidingMenu.boxesOrder.insert(0, boxNumber);
}
for (var i:Number = 0; i<slidingMenu.boxesOrder.length; i++) {
var cBox:MovieClip = eval('box'+slidingMenu.boxesOrder[i]);
new Tween(cBox, "_x", Strong.easeOut, cBox._x, slidingMenu.pointsX[i], 40, false);
new Tween(cBox, "_width", Strong.easeOut, cBox._width, big_width, 40, false);
cBox._y = slidingMenu.pointsY[i];
}
};
//slidingMenu.moveBoxes(); |