17 Replies Latest reply on Jan 11, 2010 3:07 PM by Limon26

    function with 2 variables to load .swf file

    Limon26 Level 1

      I'm working on a function that checks for 2 things to pull up the correct .swf file

       

      I have to check for 2 things

      ·         _global.theYear

      ·         _global.theDate

       

       

      Is there a different way I could write this function to say something like:

       

      checkAll(_global.theYear, _global.theDate) = function(){

           loadMovie(_global.theYear,_global.theDate”.swf”, 1);

      }

       

      So when a button is pressed, it runs the function above and fills in the variable

      Names in the .swf name, does that make any sense, am I on the right track?

       

       

      Because all the .swf file names are all consistent such as 2009_18.swf, 2007_5.swf…etc…

       

      the only problem i see is there are 2 sets of buttons, one when you press it sets the _global.theYear variable

      and the other sets the _global.theDate variable.

       

      so would one button look like this:

       

      mybtn.onPress=function(){

        checkAll(2008,_global.theDate);

      }

       

      and the _global.theDate would be set with what the current var is set at as?