2 Replies Latest reply on Jan 29, 2010 10:59 AM by shipmast3r

    IListItemRenderer & SpriteVisualElement on nightly build

    shipmast3r

      Hi everyone,

       

      I just switched from the beta 2 sdk to the nightly build, I am using flex_sdk_4.0.0.13827. I am running into problems with a list item renderer I have, it's an mxml that implements IListItemRenderer as follows:

       

      <s:Group

       

          implements="mx.controls.listClasses.IListItemRenderer"

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

          xmlns:s="library://ns.adobe.com/flex/spark"

          xmlns:mx="library://ns.adobe.com/flex/mx"

          useHandCursor="true"

          buttonMode="true"

          width="100"

          height="100">

       

       

      And then inside this group, there is

       

      <s:SpriteVisualElement id="reflectionSprite" width="100%" height="100%" scaleY="-1"

                                 cacheAsBitmap="true"

                                 mask="{reflectionGradientSprite}"/>

       

       

          <s:SpriteVisualElement id="reflectionGradientSprite" width="100%" height="100%"

                                 scaleY="-1"

                                 cacheAsBitmap="true"/>

       

      When this renderer gets called, I get the error

       

      Error: MXML element reflectionSprite.reflectionGradientSprite can only have one parent.
          at spark.components::Group/setMXMLContent()[E:\dev\4.0.0\frameworks\projects\spark\src\spark \components\Group.as:510]
          at spark.components::Group/createChildren()[E:\dev\4.0.0\frameworks\projects\spark\src\spark \components\Group.as:734]
          at mx.core::UIComponent/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\ UIComponent.as:7250]

       

       

       

      I am assuming this is because the mask is being used multiple times in the list item renderer, Is this a by-design change of behavior for using masks in Sprites?

       

       

      Thanks.