problem with array
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: problem with array

  1. #1

    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.
    chris richmond

  2. #2
    Join Date
    Aug 2003
    How about this? It uses more current syntax, don't know if that's a problem with older players.

     total = monthArray.length 
     for ( var i = 0 ; i < total ; i++ ){
    	 mcName = monthArray[i] + "_mc"  ;
    	 this[ mcName ]._visible =  false ;

    Maybe this helps?

  3. #3
    Senior Member
    Join Date
    Apr 2000
    Northern Ireland
    Try this:
    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

  4. #4

    thanx very much

    both solutions work

    much appreciated

    chris richmond

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center