2 Replies Latest reply on Nov 27, 2006 12:31 AM by Peter Lorent

    onLoad for dynamically created MovieClip

    GydruS
      Good time, dear developers!
      Help me, please!
      How can i set onLoad and other methods for dynamically created MovieClips?

      Here is trouble i have:

      if in MovieClip (named "LibMovieName", for example) write this code

      this.onLoad = function() {trace("OnLoad");}

      then this will work only if i'll place instance of "LibMovieName" on work area by hands.

      And how can it work in run-time? So, i need to create MovieClip in run-time and this clip must have working onLoad() method.
      Code, listed below isn't work:

      Scene = _root.MainMovie;
      Scene.attachMovie("LibMovieName","daMovie",100);
      ...
      Scene.daMovie.onLoad = function() {trace("DaMovie.OnLoad");};


      String "OnLoad"(check it above) also not present in trace-log window...

      So, Help me Please!!!