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 Contributor
krealian
Posts: 7
Registered: ‎04-19-2011
My Device: Torch 9800

qnx.fuse.ui.display.Image not behaving as expected

[ Edited ]

Hey guys. It's been a while since I developed an app using the Playbook SDK for Air. In my last projects I used the Image class extensively and it worked like a charm. But seeing that the old Image class is now deprecated (and I assume it's discouraged to use the old classes) I tried the new qnx.fuse.* classes. Unfortunately I can't get the new Image class to work.

 

My code looks as follows:

var img:Image = new Image();
img.setImage("img/test-img.png");
img.setPosition(50, 20);
img.visible = true;
addChild(img);

 But the image never shows. With the old Image class it worked with the same code. Do I have to make adjustments now? From the API documentation I can't figure out what I have to change.

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: qnx.fuse.ui.display.Image not behaving as expected

your code seems correct -- chances are it is an issue with the location of the image. verify that the image exists. then use the event listeners for the Image class to see if there is an IOerror and if the image is ever loaded. good luck!

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
Please use plain text.
New Contributor
krealian
Posts: 7
Registered: ‎04-19-2011
My Device: Torch 9800

Re: qnx.fuse.ui.display.Image not behaving as expected

I added an IOErrorEvent listener and an Event.COMPLETE listener. It did fire up the complete event but I didn't get an IOError. The same path also works when using the old Image class, so the image is definitely there. I really don't know what else to try.

 

In the meantime I made my own Image class using the UIComponent as a base class. Although I can continue working now I would love to know why the QNX Image class doesn't seem to work at all. I also hope there won't be any more surprises like this waiting for me in the new classes.

Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)
My Carrier: Mobile Vikings

Re: qnx.fuse.ui.display.Image not behaving as expected

I am still using the old Image class in all my projects. I just can't get the fuse variant working properly, it doesn't load the images the old one loaded perfectly fine.

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
New Contributor
krealian
Posts: 7
Registered: ‎04-19-2011
My Device: Torch 9800

Re: qnx.fuse.ui.display.Image not behaving as expected

Interesting. I was wondering if I'm the only one with the problem. Could this be a bug in the fuse Image class? If not, I'd still like to know how to use the new class.

Please use plain text.
Developer
level32
Posts: 52
Registered: ‎03-29-2012
My Device: Playbook, Dev Alpha
My Carrier: Telus

Re: qnx.fuse.ui.display.Image not behaving as expected

I'm getting the same results. Have you found a solution?
Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)
My Carrier: Mobile Vikings

Re: qnx.fuse.ui.display.Image not behaving as expected

Yep, use the old class:Shifty:

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
New Contributor
krealian
Posts: 7
Registered: ‎04-19-2011
My Device: Torch 9800

Re: qnx.fuse.ui.display.Image not behaving as expected

There is no solution, just the workaround of not using the class. I submitted a bug report yesterday. Will keep you updated.

Please use plain text.
BlackBerry Development Advisor
jdolce
Posts: 172
Registered: ‎10-25-2010
My Device: Not Specified

Re: qnx.fuse.ui.display.Image not behaving as expected

Try explicitly setting the width and height of the image. This used to happen automatically for you, but with the new layouts that gets a little tricky. Looking into a fix to make this work like it used to as it is annoying.

Please use plain text.