1 Reply Latest reply on Apr 1, 2012 11:37 AM by Shongrunden

    This is very simple question. Parent-Child Relationshiop

    havefreetime Level 1

      Hi~ All.

      I think this is not too difficult. But I'm newbie to Flex


      I don't understand relationship of Parent-Child, and what's different .addElement,  .addChild.


      I made some code.

      ------------------------------------------------------------------------------------------ -------------------------------------

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"



            width="481" height="442" minWidth="955" minHeight="600" creationComplete="initApp()">



         private var _cam:Camera;

         private var _vid:Video;


         private function initApp():void{

          _cam = Camera.getCamera();

          _vid = new Video();




         private function createMyVideo():void{







        <!-- Place non-visual elements (e.g., services, value objects) here -->


      <s:Button x="36" y="71" label="Create My Video" click="createMyVideo()"/>

      <s:VGroup x="192" y="71" width="200" height="200" id="view">






      When I click the button, I wanna show my live video.


      But I got a error message.


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



      What's my mistake?


      Thanks in advance.





      ps. Sorry for my English.