12-18-2010 06:09 PM
JRab,
thanks for all of your help!!
here's the code I'm using (its almost exactly like the code above, so thank you to those people who wrote it):
I created a folder called "images" inside of the src folder and placed a image called blackberry.bmp inside.
package
{
import flash.display.Sprite;
import qnx.ui.display.Image;
[SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")]
public class AirHelloWorld extends Sprite
{
public function AirHelloWorld()
{
var topHeaderImage:Image = new Image();
topHeaderImage = new Image;
topHeaderImage.setImage('images/blackberry.bmp');
topHeaderImage.setPosition(10,10);
topHeaderImage.setSize(90,90);
topHeaderImage.visible = true;
addChild(topHeaderImage);
stage.nativeWindow.visible = true;
}
}
}
12-18-2010 06:10 PM
I had to specify the folder in the blackberry-airpackager command right after the path for my application icon.
12-18-2010 06:15 PM
hey durvasa,
i dont see any problems with your code except maybe this line:
topHeaderImage = new Image;
try changing it to:
topHeaderImage = new Image();
Sometimes i get weird errors when i miss the parenthesis. if that doesnt work my next theory is the format of the image you are trying to display. try using a .jpg or a .png file and see if you get similar results. good luck!
12-18-2010 06:28 PM
JRab,
I got rid of that extra line of code
topHeaderImage = new Image;
In the end, the issue was the picture format. Something (either emulator or the compiler) wasnt accepting the bmp file I was using. But once I used a jpg file, the emulator show the image just fine.
thanks again !
12-18-2010 08:02 PM
You can also embed the image and bypass the simulator reading the file by:
[Embed(source='assets/gauge.png')] private var gauge_icon : Class;
And:
my_image.setImage( new gauge_icon() );