dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: for Loop. What is wrong withi my code?

  1. #1
    Senior Member
    Join Date
    Dec 2001
    Location
    Lisbon
    Posts
    281
    Hi this is my code:

    for (i=1;i<9;i++) {
    petalToFade="s03petal0"+i;
    _root.preload.s03flower.petalToFade._alpha=0;
    }

    it's not working. I think the petalToFade=... line is not working. What am i doing wrong?

    I want the output to be:
    s03petal01
    s03petal02
    s03petal03
    ...

    so i can make the alpha of several MC equal to 0.

    Thanks,
    Miguel

  2. #2
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food
    Posts
    3,789
    Code:
    for (var ++i; i < 9; i++) { 
         _root.preload.s03flower["s03petal0" + i]._alpha =0 ; 
    }

  3. #3
    Senior Member
    Join Date
    Dec 2001
    Location
    Lisbon
    Posts
    281

    it doesn't work

    i just tryied your code and it doesn't work.
    i even get some error when i try to preview it.

  4. #4
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food
    Posts
    3,789
    sorry...

    Code:
    for (++i; i < 9; i++) {
    	_root.preload.s03flower["s03petal0" + i]._alpha = 0;
    }

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