This is the Array Declaration below:
#include "lmc_tween.as"
_global.titles = ["GAMES", "BLOG", "GIRLFRIEND", "BOOKS", "SCHOOL", "FOOD","PORTFLIO","FRIENDS","DOWNLOADS","ACCOLADES","CONTACT","LINKS"];
_global.posX = ["200", "250", "300", "200", "250", "300","200", "250", "300", "200", "250", "300"];
_global.posY = ["0", "0", "0", "50", "50","50","100","100","100","150","150","150"];
Here is the duplication method below, and is where i get my first problem, the Rescale function is tooooo tedious and will require to much work when having to add the new arrays later on and then adding more to the Rescael function, I want to shorten this with a loop for the " item[a] and the delay " i can achieve this with a loop but how within the lacos method ?:
//Duplicate method puts all movieclips on stage at 0 alpha so the user doesnt see the placement
for (a=0; a<titles.length; a++) {
duplicateMovieClip("item", "item"+a, a+1);
eval("item"+a).alphaTo(0,0,null);
eval("item"+a).item_txt.text = titles[a];
eval("item"+a).tween("_x", [posX[a]], 4, "easeoutElastic");
eval("item"+a).tween("_y", [posY[a]], 4, "easeoutElastic", 0.1);
// Callback Function for lacos to tell when to rescale/alpha back to 100 percent
reScale = function(){
//How can I shorten this by just making an array and doing this in One shot ? is the only problem
item0.scaleTo(100,2,"easeoutElastic",0.2);
item0.alphaTo(100,2,"linear",0.2);
item1.scaleTo(100,2,"easeoutElastic",0.4);
item1.alphaTo(100,2,"linear",0.4);
item2.scaleTo(100,2,"easeoutElastic",0.6);
item2.alphaTo(100,2,"linear",0.6);
item3.scaleTo(100,2,"easeoutElastic",0.8);
item3.alphaTo(100,2,"linear",0.8);
item4.scaleTo(100,2,"easeoutElastic",1);
item4.alphaTo(100,2,"linear",1);
item5.scaleTo(100,2,"easeoutElastic",1.2);
item5.alphaTo(100,2,"linear",1.2);
item6.scaleTo(100,2,"easeoutElastic",1.4);
item6.alphaTo(100,2,"linear",1.4);
item7.scaleTo(100,2,"easeoutElastic",1.6);
item7.alphaTo(100,2,"linear",1.6);
item8.scaleTo(100,2,"easeoutElastic",1.8);
item8.alphaTo(100,2,"linear",1.8);
item9.scaleTo(100,2,"easeoutElastic",2);
item9.alphaTo(100,2,"linear",2);
item10.scaleTo(100,2,"easeoutElastic",2.2);
item10.alphaTo(100,2,"linear",2.2);
item11.scaleTo(100,2,"easeoutElastic",2.4);
item11.alphaTo(100,2,"linear",2.4);
item12.scaleTo(100,2,"easeoutElastic",2.6);
item12.alphaTo(100,2,"linear",2.6);
};
//Callback function is set here
eval("item"+a).scaleTo(0,0.2,"easeoutElastic",0.1,reScale);
item._visible = false;
}
Here are the clip events set for each button through a loop:
How on earth can I make flash say: " This button has been clicked so all other clicked buttons need to return to it’s normal color ? " I know i can achieve this through the Event Listner/Broadcasting but how ?
//Created Clipevents for each button with another loop
for (var i = 0; i<=titles.length; i++)
{
this["item"+i].i = i;
//Created RollOver event
this["item"+i].onRollOver = function():Void
{
trace("You have hovered over an item");
this.scaleTo(120, 1, "easeOutElastic");
}
//Created RollOut Event
this["item"+i].onRollOut = function():Void
{
trace("You Have Rolled Out on a Item");
this.scaleTo(100, 1, "easeOutElastic");
}
//Problem occurs here on OnPress, When One button turns white any other
//that has been previously pressed needs to go back normal
this["item"+i].onPress = function():Void
{
trace("You have pressed this item");
this.colorTo(0xFFFFFF, 0.5, "linear");
}
if(["item"+i].releaseOutside = true){
this.colorTo(null,0.5,"linear");
}
};
IF anyone could help me shoot me a hollar here, I rather prefer MSN so I can share the FLA and SWF with you, dont want to put it here for being lazy purposes ( which also reflects in my code ) my msn is nyong15@hotmail.com my aol is Mygameisnatrual, thanks in advanced.