0 Replies Latest reply on Sep 24, 2009 7:36 AM by Zolotoj

    Error in AIR

    Zolotoj Level 3

      I am getting this error:

       

      Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.

      at spark.components::Group/addChild()[E:\dev\beta1\frameworks\projects\flex4\src\spark\compo nents\Group.as:1739]

      at PrintLabels/PDFLoader()[D:\projects\sfcs\PrintLabels\src\PrintLabels.mxml:17]

      at PrintLabels/___PrintLabels_WindowedApplication1_creationComplete()[D:\projects\sfcs\Print Labels\src\PrintLabels.mxml:2]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.core::UIComponent/dispatchEvent()[E:\dev\beta1\frameworks\projects\framework\src\mx\co re\UIComponent.as:11260]

      at mx.core::UIComponent/set initialized()[E:\dev\beta1\frameworks\projects\framework\src\mx\core\UIComponent.as:1513]

      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\beta1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:759]

      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\beta1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1067]

      in this code:
      var html:HTMLLoader = new HTMLLoader();
      var urlReq:URLRequest = new URLRequest("http://www.adobe.com/");
      html.load(urlReq);
      main.addChild(html)
      <s:HGroup x="25" y="17" width="427" height="444" id="main">
      </s:HGroup>
      How do I add HTMLLoader to the AIR app then?
      Thanks