0 Replies Latest reply on Sep 4, 2006 8:01 AM by Mr Binitie

    Video classes instances all inherit from the last declared instance

    Mr Binitie Level 1
      I have 2 Flex components. Each contain an instance of the Video class within a UIcomponent. One of the components;
      <aYo:ShowThem x="0" y="25" width="300" height="250" id= "showthem"/>captures the a camera feed and publishes, the other;
      <aYo:SeeThem x="0" width="348" height="306" y="25" id= "seethem"/> plays back what the live stream.
      Elementary I can hear you all say.
      Here comes the twist, the <ShowThem> component has its video aspect ratio set to
      videoHolder = new UIComponent();
      v1 = new Video(80, 60);
      videoHolder.setActualSize(90, 90);
      videoHolder.addChild(v1);

      The <SeeThem>component is set as follows
      videoHolder = new UIComponent();
      v2 = new Video(200, 150);
      videoHolder.setActualSize(200, 150);
      videoHolder.addChild(v2)

      In the main mxml, we have;

      <aYo:SeeThem x="0" width="348" height="306" y="25" id= "seethem"/>
      <aYo:ShowThem x="0" y="25" width="300" height="250" id= "showthem"/>

      When published

      The video class instance within SeeThem "v1" now takes the same size of the video class instance inwithin SeeThem v2. If on the other hand you lay the tags in reverse e.g.



      <aYo:ShowThem x="0" y="25" width="300" height="250" id= "showthem"/>
      <aYo:SeeThem x="0" width="348" height="306" y="25" id= "seethem"/>



      The reverse happens i.e. The video class instance in SeeThem v2 now takes the same size of the video class instance in ShowThem v1

      In conclusion it seems that if you have 2 different components with video objects, the video size of all video objects will be determined by the size of the video class instance in the last tag. As if the video class is a singleton and the aspect ratios of the last tag with a video class instance is inherited by all instantiated video classes

      Is this so??