11-19-2010 01:00 PM
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.
11-19-2010 02:14 PM
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/
11-19-2010 02:15 PM
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/ .
11-22-2010 12:38 PM
Thank you both for the responses. That library does exactly what I need. Thanks again, really helped me out.
11-22-2010 12:58 PM
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.
11-22-2010 02:13 PM
i'd stick with the caurina tweener since it was used in the examples by RIM and in the webcasts just to be safe.
11-23-2010 12:29 PM - edited 11-23-2010 12:29 PM
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.
11-23-2010 12:49 PM
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_12882
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;
}
11-23-2010 02:08 PM
Oh ok, thanks. Working with the tweener library today and it seems to work pretty well.