2 Replies Latest reply on Dec 26, 2007 10:04 PM by brian914

    Passing multiple arguments to a function

    brian914 Level 1
      I am having problems passing arguments to this function and I can't figure out why. I am using FuseKit and have the following.

      fContactSubFuse.push({target:artBtnPath.art_sub_0, _alpha:0, time:fadeInTime, ease:"easeOutQuad", callback:posSubMenus, args:[-2000, -2000]});

      and my function looks like this:

      function posSubMenus(yPosMenu01:Number, yPosMenu02:Number):Void {
      artBtnPath._y = yPosMenu01;
      infoBtnPath._y = yPosMenu02;
      trace("yPosMenu01 is: " + yPosMenu01 + ", and yPosMenu02 is: " + yPosMenu02);
      }

      The trace returns undefined. What am I doing wrong?

      Thanks for any help with this!
        • 1. Re: Passing multiple arguments to a function
          Level 7
          First, while there's some Fuse users here, you're better asking on
          mosessupposes.com in the forum since Fuse is a 3rd party addition... Anyway,
          that being said, you have this:

          fContactSubFuse.push({target:artBtnPath.art_sub_0, _alpha:0,
          time:fadeInTime, ease:"easeOutQuad", callback:posSubMenus,
          args:[-2000, -2000]});

          You want to change it to this:

          fContactSubFuse.push({target:artBtnPath.art_sub_0, _alpha:0,
          time:fadeInTime, ease:"easeOutQuad", func:"posSubMenus",
          args:[-2000, -2000]});

          Note, that I changed callback to func, and made the function name a string.

          --
          Dave -
          Head Developer
          http://www.blurredistinction.com
          Adobe Community Expert
          http://www.adobe.com/communities/experts/


          • 2. Re: Passing multiple arguments to a function
            brian914 Level 1
            Dave,
            thanks a lot for the help! This did work perfect.

            I did post this on the Fuse forum before I came here. I had it up for several days before posting on this forum. I do know that this forum is more general, but I just assumed that someone might know.

            I am now wondering what the difference between "callback" and "func" is. Why is it not always "func"?

            Thanks a lot!