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

Web and WebWorks Development

Reply
New Contributor
Posts: 4
Registered: ‎04-06-2011
My Device: Curve 8520
My Carrier: Tmobile

Images not appearing in compiled WebWorks App

I have made a html/javascript memory game that shows a jpeg file when the card is selected. It works great when viewing through a web-browser (Chrome-Firefox).  However, after I compile everything into the .bar file and load it into the Playbook, I can see the game setup, but when I click a card it only shows the background color. I've tried using PNG images, removing all background colors and css pages and nothing seems to change. Does anybody have any suggestions that I can try? Thanks in advance for your assistance.

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Images not appearing in compiled WebWorks App

Is your JPEG also packaged locally or is it remote?

 

Can you post up your CSS showing how you are displaying and positioning the image?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: Images not appearing in compiled WebWorks App

I have noticed the following and I think this must be some obscure simulator bug:

 

If your images are in the root directory they will NOT show up when using <IMG> tags.

If you put them in some subdirectory and use:

 

 

<img src="subdirectory/image.png">

 

 

everything works fine. It makes no sense or whatsoever but for me this makes every image show up fine.

 

Maybe someone from RIM can look into this and confirm my findings.

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

New Contributor
Posts: 4
Registered: ‎04-06-2011
My Device: Curve 8520
My Carrier: Tmobile

Re: Images not appearing in compiled WebWorks App

As part of troubleshooting I have since removed the css page. So the CSS page is not playing into the placement of the image files. They are local, stored in an image folder.

New Contributor
Posts: 4
Registered: ‎04-06-2011
My Device: Curve 8520
My Carrier: Tmobile

Re: Images not appearing in compiled WebWorks App

On the initial loading of the HTML file the images are being loaded through a, <img src=>, however, as the app progresses the rest of the images are being placed through a javascript file. That is something to consider, though, to see if my javascript is using the <IMG> tag or if I need to have it use the <img src=>.  All the images for the app are being stored in an image folder, so they're not on the local root space. Thanks for the ideas!

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Images not appearing in compiled WebWorks App

It could be an issue in the beta simulator.. have you tried an alternative like changing the background image of a div instead of the src path of the image?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
Posts: 4
Registered: ‎04-06-2011
My Device: Curve 8520
My Carrier: Tmobile

Re: Images not appearing in compiled WebWorks App

Just so there's a better understanding, my background images and such all appear fine. What I have is a memory game, so when you initialize the program you are presented with the backs of the cards, one image.png file. Then you click the card to turn it over and see the image underneath. This is when the simulator shows the image as the same color of the background, not showing anything about the image. Through a web browser, the game works great. The simulator is where I'm getting some grief trying to make it sure. I'm using a table to create the grid of cards. Any thoughts?