0 Replies Latest reply on Nov 29, 2012 3:43 AM by gauravk.pandey

    Spark List problem

    gauravk.pandey Level 1

      Dear All,

       

      I am using Flex 4.5 to build AIR application . I used Sprak list with vertical layout with a itemRendere. I have situation to implement drag -drop between item in list. My entire code works perfectly . However once i have items more then 100 the Sprak List and start drag my code throw below error:

       

      ArgumentError: Error #2015: Invalid BitmapData.

                at flash.display::BitmapData/ctor()

                at flash.display::BitmapData()

                at mx.managers::NativeDragManagerImpl/initiateDrag()[E:\dev\hero_private\frameworks\projects \airframework\src\mx\managers\NativeDragManagerImpl.as:386]

                at flash.events::EventDispatcher/dispatchEventFunction()

                at flash.events::EventDispatcher/dispatchEvent()

                at mx.core::UIComponent/dispatchEvent()[E:\dev\hero_private\frameworks\projects\framework\sr c\mx\core\UIComponent.as:13128]

                at mx.managers::LayoutManager/validateClient()[E:\dev\hero_private\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:1093]

                at mx.managers::NativeDragManagerImpl/doDrag()[E:\dev\hero_private\frameworks\projects\airfr amework\src\mx\managers\NativeDragManagerImpl.as:363]

                at mx.managers::DragManager$/doDrag()[E:\dev\hero_private\frameworks\projects\framework\src\ mx\managers\DragManager.as:303]

                at spark.components::List/dragStartHandler()[E:\dev\hero_private\frameworks\projects\spark\s rc\spark\components\List.as:1635]

                at flash.events::EventDispatcher/dispatchEventFunction()

       

       

       

       

       

      Surprisingly this error can not be reproduce if item is precisly below 100 like 76, 98...,99 . crash occurs only after 100 elements.

       

      The code sniplet which i using for enabling drag drop is:

       

       

       

      <!-- parent contener of List -->

                          <mx:HBox x="0" y="128" width="806" height="377" backgroundColor="#FFFFFF"

                                               borderColor="#757575" borderStyle="solid" borderVisible="true" paddingLeft="5"

                                               horizontalScrollPolicy="off" verticalScrollBarStyleName="myScrollBar"

                                               verticalScrollPolicy="auto">

       

      <!-- For showing busy indicator untill data is ppapulated in list using RPC call -->

                                    <s:Group id="biContainer" width="796" height="348" includeInLayout="false" visible="false">

                                <s:BusyIndicator id="biLPList" verticalCenter="0" horizontalCenter="0"/>

                                    </s:Group>

       

      <!---List component -->

       

                                    <s:List id="dgResource" itemRenderer="view.itemRenderer.resources.LessonPlanResourceItemRenderer"

                                                        dataProvider="{_resourceList}"  

                                                        dragEnabled="true" dropEnabled="true"   dragMoveEnabled="true" borderVisible="false" borderAlpha="0" useVirtualLayout="false">

                                              <s:layout>       

                                                        <s:VerticalLayout gap="0">

                                                        </s:VerticalLayout>

                                              </s:layout>

                                    </s:List>

                          </mx:HBox>

       

       

      Please help or suggest.

       

      Regards,

      Gaurav