Man, that was right!! It works!!
Thanks
Gustavo
On May 25, 2007, at 1:28 PM, Allandt Bik-Elliott (Receptacle) wrote:
i would guess you need to pass the current iteration (i) to the
button so that it can access it
otherwise you'll iterate through your entire loop and only pass the
final number to all of the buttons
before you set your onRelease function, try passing a copy of the
names variable to the button
buttons.names = names
and then refer to the variable in the buttons locally like this
_root.photomenus.loadMovie(this.names+"/"+this.names
+"photogallery.swf");
i think that should work
a
On 25 May 2007, at 17:39, Gustavo Duenas wrote:
Hi coders. I have created some buttons based on an array ( for you
this might sound easy but I'm crushing my head right now)
the array has some names and with a for loop, I have my buttons
with the names of the arrays attached to them
(this.mc.somethingelse.text=arraynames)
at this point everything is ok, then I create some folders based
on that names(array). Then the problems happened when I try to
order the buttons to load the folders
based on the array names and the .swf file inside them. At this
point it only loads one, what happened with the others??? i don't
know.
I'm clueless, I'd appreciate any help.
this is the code:
var menus = new Array ();
menus = [ "commercial", "children","portraits","models", "weddings"];
trace(menus.length);
for (i=0; i<menus.length; i++){
var newButtons = menus[i];
trace (newButtons);
var buttons = this.attachMovie("screenCards",newButtons,
this.getNextHighestDepth());
trace(buttons);
buttons._x=0;
buttons._x=-30*i*6
var names= buttons.titleCard.text= newButtons;
buttons.screenInside.loadMovie("botones/"+newButtons+".jpg");
//so far this point everything is ok
buttons.onRelease = function (){
_root.photomenus.loadMovie(names+"/"+names+"photogallery.swf");
//here it loads just one folder and share it with all the
buttons...why??
}
}
Regards
Gustavo Duenas
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
Gustavo Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS LLC
1225 W. Beaver St. Suite 119
Jacksonville, Fl. 32204
904 . 2650330
www.leftandrightsolutions.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com