11 Replies Latest reply on Apr 6, 2009 6:40 AM by Ned Murphy

    Need help to call a simple function from within another function?

      I created a movieclip which has a function in its one and only frame.

       

      function testx() {

      x = x+2};

       

      This movieclip is in the main timeline (in its own layer).

       

      In another layer on the timeline I have created a single keyframe with a button instance called myBtn

       

      myBtn.onRelease = function() {

      var x

      x =2

       

      testx(2);

      trace (x);

       

      };

       

      What I want to do is call the function in the movieclip frame from the button press function. However, I can't seem to reference it properly.

       

      Can anyone help me to basically call a simple function from within another function?