0 Replies Latest reply on Jun 7, 2010 3:21 AM by rabinprithvi

    Attach Camera problem

    rabinprithvi Level 2

      Hi,

       

      I used this code

       

                   var cam:Camera = Camera.getCamera();
                  var vid:VideoDisplay = new VideoDisplay();//also tried this, var vid:Video = new Video();
                  vid.width = 320;
                  vid.height = 240;
                 
                  vid.attachCamera(cam);

       

      I get this error when I attach camera to videoDisplay or video object;

       

      When i comment the attach camera code, i dont get the error.

       

       

       

       

      RangeError: Error #2006: The supplied index is out of bounds.
          at flash.display::DisplayObjectContainer/getChildAt()
          at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::createContentPane()[E:\dev\3.0.x\frameworks\pr ojects\framework\src\mx\core\Container.as:4654]
          at mx.core::Container/createOrDestroyScrollbars()[E:\dev\3.0.x\frameworks\projects\framework \src\mx\core\Container.as:4400]
          at mx.core::Container/createScrollbarsIfNeeded()[E:\dev\3.0.x\frameworks\projects\framework\ src\mx\core\Container.as:4349]
          at mx.core::Container/createContentPaneAndScrollbarsIfNeeded()[E:\dev\3.0.x\frameworks\proje cts\framework\src\mx\core\Container.as:4165]
          at mx.core::Container/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\m x\core\Container.as:2689]
          at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:602]
          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:675]
          at Function/http://adobe.com/AS3/2006/builtin::apply()
          at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\sr c\mx\core\UIComponent.as:8460]
          at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src \mx\core\UIComponent.as:8403]

       

       

       

      What may be the problem?

       

      Need Help as I am very new to flex.