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
Contributor
soul2k
Posts: 29
Registered: ‎05-08-2011
My Device: Bold 9900 / Playbook
My Carrier: Rogers

BB10 Active Frames Sample

[ Edited ]

Just wanted to post RIMs active frame sample for everyone, as there was no direct link from the developer website and I had a bit of a difficult time locating it.

 

https://github.com/blackberry/Samples-for-AIR/tree/bb10/ActiveFrameSample

 

https://developer.blackberry.com/air/apis/bb10/qnx/system/QNXCover.html

 

Please use plain text.
Contributor
soul2k
Posts: 29
Registered: ‎05-08-2011
My Device: Bold 9900 / Playbook
My Carrier: Rogers

Re: BB10 Active Frames Sample

Has anyone been able to successfully use:

 

setCoverFromFile(path:smileyfrustrated:tring):void
Used to specify that a file based image is to be used as the cover image for this app.
 
When my app is minimized into the frame, it just producing a blank screen and not showing any image.  I have tried setting the cover on both the COVER_SIZE and COVER_ENTER events without any success.
 
Any ideas ?
 
 
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 Active Frames Sample

What file path are you giving? Do you have access/permission to read the file?
Please use plain text.
Contributor
soul2k
Posts: 29
Registered: ‎05-08-2011
My Device: Bold 9900 / Playbook
My Carrier: Rogers

Re: BB10 Active Frames Sample

I do seem to have permissions. The image is located in an assets folder within the project (where i am able to load all of my other assets).

 

As a test, I tried using setCoverFromWindow(nativewindow) (as per the sample) and adding the image as a child to that native window.  This works, but seems like a lot of extra work especially when there is a function to set it from a file.

 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 Active Frames Sample

If you cannot get it to work as is, I would report it as a bug. Give as much detail as possible so they can repeat the issue.
Please use plain text.
Contributor
AmonRaHR
Posts: 20
Registered: ‎06-12-2012
My Device: BlackBerry 10 Dev Alpha
My Carrier: TELE2 HR

Re: BB10 Active Frames Sample

setCoverfromFile not working for me too.

 

But there is workaround use code from example in first post and change:

 

coverbg = new Bitmap( new BitmapData( cover.width, cover.height, false, 0xFFFF0000 ) );

 to

coverbg = new Assets.COVER;

 I have in Assets class this line, you can embet that in mxml file somewhere else:

[Embed(source="assets/cover.png")] public static const COVER:Class;

 

I had to remove QNXLabel, to make it work.

 

Add this to functions onCoverEnter and oncoverExit and remove other things:

				createCover();
				QNXCover.qnxCover.setCoverFromWindow( cover );

 

 

 

BB10 Air Developer
Please use plain text.
Contributor
AmonRaHR
Posts: 20
Registered: ‎06-12-2012
My Device: BlackBerry 10 Dev Alpha
My Carrier: TELE2 HR

Re: BB10 Active Frames Sample

@jtegen:

 

QNXCover.qnxCover.setCoverFromFile(new Assets.COVER);

 or 

QNXCover.qnxCover.setCoverFromFile("assets/cover.png");

 do not work, i try all paths ../assets, /assets ... 

 

Only Black Screen when enter cover.

 

Did U report this Bug, if not please ... Thanks.

BB10 Air Developer
Please use plain text.
Developer
Ebscer
Posts: 843
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: BB10 Active Frames Sample

For a cover image I am using a Loader to load the bitmap when the app starts up, and then setting the cover bitmap once the image has been loaded. As such the Bitmap object is defined before onCoverSize() is ever called. If something has gone wrong and the bitmap is not yet set when onCoverSize() is run, then I set the bitmap to a solid color using

if(coverbg==null)
{
	coverbg = new Bitmap( new BitmapData( cover.width, cover.height, false, 0xFFAAAAAA ) );
}

 


Read my thoughts on BlackBerry Development at news.ebscer.com
Please use plain text.
Contributor
AmonRaHR
Posts: 20
Registered: ‎06-12-2012
My Device: BlackBerry 10 Dev Alpha
My Carrier: TELE2 HR

Re: BB10 Active Frames Sample

In my case onCoverSize() is never trigered becouse i'm using Flash Builder (Mobile Flex Application) and init screen on Creation Complete but just call create_cover() every time there is line that checks if cover is sreated.

BB10 Air Developer
Please use plain text.
Developer
agaripian
Posts: 131
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C
My Carrier: T

Re: BB10 Active Frames Sample


AmonRaHR wrote:

In my case onCoverSize() is never trigered becouse i'm using Flash Builder (Mobile Flex Application) and init screen on Creation Complete but just call create_cover() every time there is line that checks if cover is sreated.


@AmonRaHR 
Can you please post an example of what you changed? I am also using a flex mobile application and the event listener is not getting fired: QNXCover.qnxCover.addEventListener(QNXCoverEvent.COVER_SIZE, onCoverSize );

 

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10
Please use plain text.