0 Replies Latest reply on Mar 5, 2007 6:29 AM by Newsgroup_User

    createClassObject and load event

    Level 7

      I am using Flash v8 and Windows XP.

      In some old code I have I used the load event to trigger action after
      setting up/creating an object using createClassObject. I did this in an
      older version of Flash (v7, I think). After this I've had a reinstallation
      of my PC and had to set up some settings again. Anyway, now the compilation
      doesn't work anymore (not when compiling for v8 or v7), and I am uncertain
      if it is my use of the load event which is incorrect or what.

      What I get is no compilation error, but the load event is never triggered,
      here is a rough outline of my code:

      var CObj = new Object();
      CObj.load = function(eventObject){
      ... do some things when object has been created ...
      Content.CBox._visible = true; // make object visible
      someTargetPath.onDone(); // call an onDone function with
      other operations to take place when object is done
      // with setup
      // create a ComboBox and hide it until it has been properly setup
      Content.createClassObject(ComboBox, "CBox",
      Content.getNextHighestDepth(), {_visible:false});
      Content.CBox.addEventListener("load", CObj);

      So, is this an ok way of using the load event function,
      - if so, then any idea why it doesn't work?
      - and if not, then what would be a good way to trigger some code to take
      place when the object has been created and is ready to be performed
      operations on?