PDA

View Full Version : DataGrid dragEnabled="true" lag time


RR_QQ
04-02-2008, 11:04 PM
Has ANYONE ever experienced this? I'm really confused as to why this is happening. I have the following data grid as test code in my mxml app:


<mx:DataGrid x="44" y="55" dragEnabled="true">
<mx:ArrayCollection>
<mx:Object>
<mx:Artist>Pavement</mx:Artist>
<mx:Price>11.99</mx:Price>
<mx:Album>Slanted and Enchanted</mx:Album>
</mx:Object>
<mx:Object>
<mx:Artist>Pavement</mx:Artist>
<mx:Album>Brighten the Corners</mx:Album>
<mx:Price>11.99</mx:Price>
</mx:Object>
</mx:ArrayCollection>
</mx:DataGrid>


Builder launches the app fine in both the stand alone Flash player or in FireFox (depending on my compilir settings). However when I load the app from within my main website page the draggable rows within the DataGrid on the FIRST click drag after the app has loaded is extremely slow/lagging when it comes to animating the click/drag when I click and hold a row with the mouse. I even commented all my AS3 code out to ensure that there wasnt any logic that was causing the lag and this ONLY happens when I load the app from the target web page. I also tested the app by placing it by itself in its own html template but still the drag occurs - WHY?

After I click and drag any row for first time its slow but if I let go of the mouse and then decided to click and drag again the slowdown is now gone. I thought it might be that it was loading something and thats why it caused the slowdown but like I said I even commented all AS3 to ensure that there was no program execution slowing down the dragging.

Can anyone chime in with any thoughts?

drkstr
04-03-2008, 12:06 AM
I was not able to reproduce the problem with Flex Builder 2 or Flex Builder 3. Which are you using?

Do you get the same results if you go here?

http://www.openbaseinteractive.com/testproject/

All I did was copy and paste your code. If you are seeing the same result at that link, try updating your flash player.

Regards,
~Aaron

RR_QQ
04-03-2008, 01:30 AM
OK! so I figured out the problem. The problem was not Flex AT ALL. The problem is the "wmode" set to "transparent" in HTML. If I dont set that there are no rendering/animation issues. If I do the lag occurs but only with the very first time I attempt to click/drag. After it's fine.

MXML:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="initApplication()"
backgroundAlpha="0" themeColor="#99CC33">


This is the problem code in HTML:

<object width="100%" height="680">
<param name="movie" value="http://localhost/web/flex/swf/Orders/OrderUpdate.swf">
<param name="wmode" value="transparent">
<embed src="http://localhost/web/flex/swf/Orders/OrderUpdate.swf" width="100%" height="680" wmode="transparent">
</embed>
</object>


This code works fine:

<object width="100%" height="680">
<param name="movie" value="http://localhost/web/flex/swf/Orders/OrderUpdate.swf">
<embed src="http://localhost/web/flex/swf/Orders/OrderUpdate.swf" width="100%" height="680">
</embed>
</object>


Is there any way to get around this?? Or is a transparent background in my Flex app just overkill? I read somewhere that its extra processing when rendering a transparent BG.

Do you have experience in this subject??