2 Replies Latest reply on Nov 15, 2007 2:37 PM by sammnm

    AttachMovie

    sammnm
      Hello all,

      Im new to actionscript but im picking it up fast as i am not new to coding, My problem im having is with remvoing genrated attached moive so when i recall the attachMovie command the old movies should be deleted.

      Im using as2 and flash8 ...

      Here is my code that generates movies depending on the array length.

      var myArray:Array = ["1","2","3"];

      var buildList:Function = function(){

      for (var i:Number = 0; i < myArray.length; ++i) {

      var name:String = "containers" + i + "_mc"; // names and creates the dynamic movieclips.
      var y:Number = i * spacing; // does the maths for setting space between clips.
      display_mc.list_mc.attachMovie("containers", name, i); // adds created movieclips to the main movieclip.
      display_mc.list_mc[name]._y = y; // sets the space for each movie clip.

      display_mc.list_mc[name].display_number_txt.text = i+1; // adds info to the movie clip a simple count for now.
      }


      Now when i recall the function as i do not know the command to delete it will add the new lot of create mc clips and keeps the old....

      I know i can call a function with a for loop to remove the clips and then remake once done so all i need is the delete line..

      Please help my first post and im losing hair and sleep hahha..
      Many thanks

      Sam M.