0 Replies Latest reply on May 27, 2006 9:42 AM by cadflash2

    cpu not releasing after page load

    cadflash2
      I'm a newby to flash. I need to show movie clips based on the XML data. The problem is after page is loaded with flash file, still CPU is not getting released. What am I doing wrong? After page is loaded with the flash file, I want the CPU to go its original utilization.
      Here is the sample code.
      import flash.geom.Matrix;
      import flash.geom.Point;
      import flash.display.*;
      import flash.geom.*;
      import mx.services.*;
      _root.lineStyle(1, 0x0000FF, 100);
      var mcMapContent = map_sp.content;
      var my_xml:XML = new XML();
      my_xml.ignoreWhite = true;
      var number_fmt:TextFormat = new TextFormat();
      number_fmt.font = "NumFont";
      number_fmt.size = 4;
      var fileName:String;
      if (!fileName)
      {
      fileName = "test1";
      }
      if (_global.styles.List == undefined)
      {
      _global.styles.List = new mx.styles.CSSStyleDeclaration();
      }
      _global.styles.List.setStyle("themeColor", 0x3366CC);
      _global.styles.List.setStyle("color", 0x000000);
      _global.styles.List.setStyle("backgroundColor", 0xFFFFFF);
      _global.styles.List.setStyle("borderStyle", "solid");
      _global.styles.List.setStyle("borderColor", 0x000000);
      _global.styles.List.setStyle("rolloverColor", 0x5a6970);
      _global.styles.List.setStyle("scrollTrackColor", 0xEEEEEE);
      _global.styles.List.setStyle("selectionColor", 0xCCCCCC);
      my_xml.load("XML/" + fileName + ".xml");
      my_xml.onLoad = function(success)
      {
      var currentNode:XMLNode = my_xml.firstChild.firstChild;
      var LoopI:Number;
      var tmpDepthLevel:Number;
      var X1:Number, Y1:Number, Length:Number, Width:Number;
      var Code_str:String;
      currentNode = currentNode.firstChild;
      tmpDepthLevel = mcMapContent.getNextHighestDepth();
      try
      {
      for (var child_xmlnode = currentNode; child_xmlnode != null; child_xmlnode = child_xmlnode.nextSibling, i++)
      {
      TotalVertex_int = Number(child_xmlnode.attributes.VERTEX_COUNT);
      X1 = child_xmlnode.attributes.X1;
      Y1 = child_xmlnode.attributes.Y1;
      Width = Number(child_xmlnode.attributes.WIDTH);
      Length = Number(child_xmlnode.attributes.LENGTH);
      Code_str = child_xmlnode.firstChild.nodeValue;
      var my_mc:MovieClip = mcMapContent.attachMovie("MyRect", Code_str, tmpDepthLevel, {Name:Code_str});
      tmpDepthLevel++;
      my_mc._x = X1;
      my_mc._y = Y1;
      my_mc._width = Width;
      my_mc._height = Length;
      newMainColor = new Color(my_mc.rect_mc);
      my_mc.Num_txt.setTextFormat(number_fmt);
      name_fmt.font = "NumFont";
      newMainColor.setRGB(0xFF99FF);
      my_mc.Num_txt._yscale = my_mc.Num_txt._yscale * (Width / Length);
      my_mc.Num_txt._y = (20 - my_mc.Num_txt._height);
      my_mc.Num_txt._x = 0;
      }
      }
      catch (myError:Error)
      {
      trace("error caught: " + myError);
      }
      finally
      {
      //trace("No Error");
      }
      };