Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
kylefowler
Posts: 525
Registered: ‎05-17-2009
My Carrier: ATT

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

guess ill have to give it a try. if only we could design our qnx item renderers in design mode. can we?
Like all of my posts
Please use plain text.
Contributor
tajddin
Posts: 34
Registered: ‎01-05-2011
My Carrier: Sprint

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

We had considered converting over to QNX, but because we want to deploy on Android as well, we've been waiting on a solution.  You may be right though, we might have to convert over to QNX.

 

I don't believe we can create the component in design view, but it shouldn't be too hard to do so in AS.

Please use plain text.
Developer
shawnblais
Posts: 438
Registered: ‎10-25-2010

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

I would think that a QNX list should run just fine on Android...it's just a pure AS3 list after all.

 

As for design mode, there's a great tool for that, actually far superioir to Design Mode, it's called Flash CS5 :smileywink:

Please use plain text.
Developer
kylefowler
Posts: 525
Registered: ‎05-17-2009
My Carrier: ATT

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

that i have. is there anywhere that shows how to use qnx in flash to do these item renderers?
Like all of my posts
Please use plain text.
Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Carrier: N/A

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

any list component that was not designed for mobile is probably using MouseEvent.MOUSE_MOVE for dragging.  MouseEvent.MOUSE_MOVE is a very expensive, often wasteful process and should be entirely avoided on mobile applications.

 

an easy work around is to stop the MouseEvent.MOUSE_MOVE event as soon as it's been triggered and call another method that doesn't continuously waste cycles.

 

here's an example that i use for clicking and dragging objects:

 

 

//Mouse Move Event Handler
private function mouseMoveEventHandler(evt:MouseEvent):void
	{
	evt.stopImmediatePropagation();
	
	removeEventListener(MouseEvent.CLICK, mouseClickEventHandler);
	removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveEventHandler);
	
	mouseMoveEventBypass();
	}
	
//Mouse Move Event Bypass
private function mouseMoveEventBypass():void
	{
	startDrag();
		
	addEventListener(MouseEvent.MOUSE_UP, mouseUpEventHandler);
	addEventListener(MouseEvent.MOUSE_OUT, mouseUpEventHandler);
	
	velocityTimer.start();
	}

 

 


PlayBook Applications:
Drop Swatch
Please use plain text.
Developer
shawnblais
Posts: 438
Registered: ‎10-25-2010

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

[ Edited ]

 


kylefowler wrote:
that i have. is there anywhere that shows how to use qnx in flash to do these item renderers?

 

Well you can import library symbols from a SWF, directly into any actionscript class. So all you need to do is create a MovieClip, ie "MyRendererAssets", then import that into your QNX renderer class, and addChild(), and there you have all the children you need for your renderer.

 

The syntax is kinda weird, but you'll get used to it.

 

//Setup the linkage as a class you can instanciate

[Embed(source="assets.swf", symbol="SomeRendererAssets")]

protected var SomeRendererAssets:Class;

 

//Instanciate assets, and add to stage

protected var assets:MovieClip = new SomeRendererAssets();

addChild(assets);

 

The only trick is to make sure that your symbol has 2 frames, then Flash will export it as a movieclip instead of a sprite, that way you can directly access any children within it.

Please use plain text.
Developer
shawnblais
Posts: 438
Registered: ‎10-25-2010

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

 


TheDarkIn1978 wrote:

any list component that was not designed for mobile is probably using MouseEvent.MOUSE_MOVE for dragging.  MouseEvent.MOUSE_MOVE is a very expensive, often wasteful process and should be entirely avoided on mobile applications.

 

an easy work around is to stop the MouseEvent.MOUSE_MOVE event as soon as it's been triggered and call another method that doesn't continuously waste cycles.

 

 


 

I don't see that you're really accomplishing here, have you benchmarked this at all??

 

I sdon't beliueve mouseMove is inherently more expensive than calling some other function... the reason mouseMove is expensive is because it can be called multiple times in a single frame, your solution only compounds the issue, as now you're making 2 fxn calls instead of one, and doing that multiple times per frame.

 

The more common solution, is to use your mouseMove handler to simply save the x/y coords to some member variables, and then use an Enter_Frame or Invalidate handler to actually apply those values to your list.  

Please use plain text.
Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Carrier: N/A

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

 


shawnblais wrote:

your solution only compounds the issue, as now you're making 2 fxn calls instead of one, and doing that multiple times per frame.


 

in my code as soon as the first MouseEvent.MOUSE_MOVE is fired, the event listener for MouseEvent.MOUSE_MOVE is removed and then the bypass function is called.  the bypass function simply activates startDrag().  


PlayBook Applications:
Drop Swatch
Please use plain text.
Developer
kylefowler
Posts: 525
Registered: ‎05-17-2009
My Carrier: ATT

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

Looks like they took the download for the Air 2.5 extension for CS5 off the adobe labs site #fail

Like all of my posts
Please use plain text.
Developer
shawnblais
Posts: 438
Registered: ‎10-25-2010

Re: Jittery Scrolling on Spark List/Scroller in New Emulator?

Ah right. Ya that works fine if you're using startDrag, but that's not really gonna cut it for a complex list. Nice simple approach though.
Please use plain text.