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
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

BB10: Image not sizing for embeded image or firing event when complete

Image class under BB10 is not resizing when being set to an embedded image.  You have to manually call setActualSize to view the image.

 

Adding:

this.thumb.addEventListener(Event.COMPLETE, ThumbLoaded );
this.thumb.setImage( new share_icon() );
this.addChild( this.thumb );

 Does not work, the Event.COMPLETE never gets fired.

 

I have to do this to get it to work like normal Flash and earlier SDKs:

this.thumb.setImage( new share_icon() );
setTimeout( ThumbLoaded, 10, null );
this.addChild( this.thumb );

 And:

////////////////////////////////////////////////////////////////////
private function ThumbLoaded( event :Event ) : void
{
	this.thumb.width = this.thumb.bitmapData.width;
	this.thumb.height = this.thumb.bitmapData.height;
}

 

 

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

Re: BB10: Image not sizing for embeded image or firing event when complete

If you want embedded images to be shown in BB10 without doing a work around of timeout updates, please vote for:

https://www.blackberry.com/jira/browse/BBTEN-59