-
problem with array
dear all
i am creating an interactive calendar in flash. I have created an array for the months as follows:
var monthArray = ["september", "october", "november", "december", "january", "february", "march", "april", "may", "june", "july", "august"];
I have some movieclips called september_mc, october_mc etc...
I am trying to set the visibility of the movieclips to 0, using the following code:
for (x=0; x<13; x++) {
setProperty ("_root." add monthArray(x) add "_mc", _visible, "0");
}
it is not working. Any ideas?
any help would be much appreciated.
-
How about this? It uses more current syntax, don't know if that's a problem with older players.
Code:
total = monthArray.length
for ( var i = 0 ; i < total ; i++ ){
mcName = monthArray[i] + "_mc" ;
this[ mcName ]._visible = false ;
Maybe this helps?
Pauline
-
Try this:
Code:
for (x = 0; x < 13; x++) {
_root[monthArray[x] + "_mc"]._visible = false;
}
Last edited by garbage; 08-13-2003 at 09:39 AM.
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
thanx very much
both solutions work
much appreciated
chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|