5 Replies Latest reply on Dec 5, 2006 1:33 PM by kglad

    Triggering javascript with actionscript

    finalcutexpress
      I have created a movie clip that, upon completion, I want to shake the browser window using the following javascript that I've embedded in my HTML ...

      function shake_xy(n) {
      if (self.moveBy) {
      for (i = 10; i > 0; i--) {
      for (j = n; j > 0; j--) {
      self.moveBy(0,i);
      self.moveBy(i,0);
      self.moveBy(0,-i);
      self.moveBy(-i,0);
      }
      }
      }
      }
      function shake_x(n) {
      if (self.moveBy) {
      for (i = 10; i > 0; i--) {
      for (j = n; j > 0; j--) {
      self.moveBy(i,0);
      self.moveBy(-i,0);
      }
      }
      }
      }
      function shake_y(n) {
      if (self.moveBy) {
      for (i = 10; i > 0; i--) {
      for (j = n; j > 0; j--) {
      self.moveBy(0,i);
      self.moveBy(0,-i);
      }
      }
      }
      }
      //-->


      What would I write in my actionscript to make this happen? I've tried getURL("javascript:shake_x(10)"), but that didn't work.

      Thanks in advance -