0 Replies Latest reply on Aug 1, 2006 7:55 AM by OhGreatOne

    Use movie clip event handler function, but not via an event

    OhGreatOne Level 1
      Let's say I have the following code:

      ----------------------------------------------
      var initObj = new Object();
      initObj.mood = "happy";
      mc = attachMovie("mcBox","instBox",100,initObj);
      mc.onPress = boxPress;

      function boxPress() {
      trace("Box mood: " + this.mood);
      }
      ----------------------------------------------

      Now, let's say there are times that I want to call boxPress() other than when the onPress event happens. In other words, I want to call boxPress() for a movie clip via my AS code, but not when an onPress event has occurred for that movie clip. Is this possible? Or is it possible to simulate or force an onPress event for a movie clip so that the handler function gets called for that movie clip?