5 Replies Latest reply on Sep 10, 2007 5:55 AM by Greg Dove

    Long switch statement - am I illogical?

    storypeddler
      Hi

      I've attached code to show what I mean:

      In a function setAlpha, I am trying to alter the alpha level of movieclips depending on the returned value "num". ie if num = x then a corresponding movieclip will have its alpha reduced by a value also carried in the function.

      Do I have to use a case by case switch statement as below or is there an easier way to do this. It seems very labor intensive - especially as the executing code is virtually identical save for the target.

      I've explored equating the "num" value with the instance name but can't work out how to do this: something like if movieclip name is string+"num" then execute code

      I'd appreciate any help,

      db