dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Simple for loop please help

  1. #1
    Senior Member
    Join Date
    Mar 2003
    Location
    New Orleans
    Posts
    191

    Simple for loop please help

    Here is my loop with syntax errors
    PHP Code:
    for(i=1i<5i++)
    {[
    "Bn" ]onRollOver=function(){ gotoAndStop("_over");
    }
    [
    "Bn" ]onPress=function(){gotoAndPlay("_down");
    }
    [
    "Bn" ]onRelease=function(){gotoAndstop("_down");
    }
    [
    "Bn" ]onRollOut=function(){gotoAndStop("_up");
    }
    [
    "Bn" ]hitArea =["hit" ]_mc;
    [
    "hit" ]_mc._visible false;
    }; 
    I've been fiddling with the code but I feel like I'm just hacking away. I've read through all my Flash books, 5 in total, and I still can't figure it out.

    This should be basic programming correct?

    thanks for the help.
    I'm only in it for the pleasure

  2. #2
    Senior Member skdzines's Avatar
    Join Date
    Sep 2003
    Posts
    301
    I'm not real sure what you are trying to accomplish but you definitely have too many { } in your for loop. You should only have one at the beginning and end of the loop.
    Code:
    for(i=1; i<5; i++){
      ["Bn" + i ]onRollOver=function(){ gotoAndStop("_over");
      ["Bn" + i ]onPress=function(){gotoAndPlay("_down");
      ["Bn" + i ]onRelease=function(){gotoAndstop("_down");
      ["Bn" + i ]onRollOut=function(){gotoAndStop("_up");
      ["Bn" + i ]hitArea =["hit" + i ]_mc;
      ["hit" + i ]_mc._visible = false;
    }

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