1 Reply Latest reply on Apr 18, 2011 9:54 PM by Darshan Rane

    I want to load a swf from this menu xml file, into a holder mc file on the stage

    NewLookandFeel

      Hello, how can I load a swf from this xml file into a mc holder  file?

      Your help would be greatly appreciative. See code below.

       


      var myxml:XML =
      <node label="Root Node">
      <node label="Chapter 1">
      <node label="Intro" image="circleImage"/>
      <node label="Recommended Prerequisites" image="squareImage"/>
      <node label="Course Navigation and Controls" image="triangleImage"/>
      <node label="Chapter 1 Completion" image="starImage"/>
      </node>
      </node>;

       


      mytree.dataProvider = new TreeDataProvider(myxml);

       


      mytree.addEventListener(ListEvent.ITEM_CLICK, handleClick);

       


      function handleClick (ev:ListEvent) {
      // If the item has an 'image' attribute
      mytext.text = ev.item.label;
      if (ev.item.image != null) {
      // Use the 'image' attribute to get a movie clip by that name from the library
      var myClip:Class = getDefinitionByName(ev.item.image) as Class;
      removeChild(myMC);
      myMC = new myClip() as MovieClip;
      // Position the new movie clip
      myMC.x = 240;
      myMC.y = 41;
      // Add the new movie clip to the display list
      addChild(myMC);

       

      }
      }