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
New Developer
jaggedaz
Posts: 21
Registered: ‎11-08-2010
My Device: Not Specified

Unable to apply Move effect to QNX based components

I'm trying to apply a Move effect to a QNX Image or QNX UIComponent and get an error saying that those classes do not have a transformX property.  Here is some example code using the QNX Image class and the standard Flex/AIR Move class.

 

 

var image:Image = new Image(); 
image.setImage("<URL to an image>"); 
addChild(image); 

var move:Move = new Move(image); 
move.xBy = 10; 
move.yBy = 10; 
move.play();

 

 

I've already filed a bug here, but I was wondering if anyone has found a workaround for animating things.  I'd prefer to not replace the QNX components with standard Flex/AIR ones if I can help it.  I've tried wrapping the QNX Image within a Flex/AIR UIComponent and that threw some other error about UIComponent referencing a null object or method.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Unable to apply Move effect to QNX based components

Yes, the QNX controls seem to inherit to something that is incompatible to the native effects.

 

I had to use a 3rd party tween library that seems to do the trick.

 

http://gskinner.com/libraries/gtween/

 

 

Developer
taylortbb
Posts: 137
Registered: ‎10-26-2010
My Device: Bold 9900 + PlayBook

Re: Unable to apply Move effect to QNX based components

The base libraries include Tweener, http://code.google.com/p/tweener/ . Just do a "import caurina.transitions.Tweener;" then you can do "Tweener.addTween(image, {x:+10, y:+10, time:1});" which will adjust the x and y properties up by 10 over 1 second. You'll find the docs at http://hosted.zeh.com.br/tweener/docs/en-us/ .

--------
Taylor Byrnes
New Developer
jaggedaz
Posts: 21
Registered: ‎11-08-2010
My Device: Not Specified

Re: Unable to apply Move effect to QNX based components

Thank you both for the responses.  That library does exactly what I need.  Thanks again, really helped me out.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Unable to apply Move effect to QNX based components

Which library did you end up using?

It appers that the Google tweener is included in the BB SDK and I am currently using the gskinner library that I will probably migrate from.

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Unable to apply Move effect to QNX based components

i'd stick with the caurina tweener since it was used in the examples by RIM and in the webcasts just to be safe.

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
New Developer
jaggedaz
Posts: 21
Registered: ‎11-08-2010
My Device: Not Specified

Re: Unable to apply Move effect to QNX based components

[ Edited ]

Looks like I'm going to give the taurina tweener a try since it is baked in.

 

JRab -- where did you see examples of this in use from RIM?  I had not noticed it in the webcasts or the sample RSS Reader app they've been showing.

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Unable to apply Move effect to QNX based components

Hey jaggedaz,

 

hey sorry for the misleading post. i went back and noticed i got the webcast mixed up with the adobe max demo i saw online recently:

 

http://2010.max.adobe.com/online/2010/MAX260_1288217641375UQJD

 

in that demo, in the last 12:30 of it he goes over this app called SwipeDown and he utilizes the SWIPE_START event. What it does is trigger a hidden menu near the top of the screen and it is tweened using the caurina tweener (as you can see in the code).

 

here's the sample code where they use it:

 

 

private function mouseUp( e:MouseEvent ):void
{
	if (!swiping)
	{
		Tweener.addTween(ui, {y: 0, time: .3, transition: "linear"});
	}
	
	removeEventListener( Event.ENTER_FRAME, trackMouse );
	
	swiping = !swiping;
}

 

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
New Developer
jaggedaz
Posts: 21
Registered: ‎11-08-2010
My Device: Not Specified

Re: Unable to apply Move effect to QNX based components

Oh ok, thanks.  Working with the tweener library today and it seems to work pretty well.