A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Trying to create a loop

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    16
    I am using this script to load a
    set number of movies into a target location

    on release
    num=num+1
    loadmovie("movie"+num+".swf", Target)

    How could I set up the variable so that when
    "num" equals a certain number, say 56
    it knows to loop back to 1??
    I tried using the "if" action but couldn't seem to
    get it right.

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Posts
    2,943
    Syntax-wise, this might work for you:
    Code:
    on(release){
    for(num=1;num<57;num++){ 
        loadmovie("movie"+num+".swf", Target);
        }
    }
    I assume that this is just a general piece of code, because there are certain parts that won't work as it is - 'target' for example would also need to be incrementally named,


  3. #3
    Junior Member
    Join Date
    May 2002
    Posts
    16
    Yeah it was general, figured youu would all
    know what i meant!
    My target level is actually named Target.
    Thanks for the help, worked great!

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