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
Trusted Contributor
Vibes
Posts: 215
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Add item to context menu

Hi,

I'm trying for days to get a custom item in the context menu without success.


I would like to send a text from the context menu to BBM. 

How can I add an item to the context menu? 

I tried all examples of this forum and from the docs and none of them are working for me! :smileysad:  

I guess I overlook something.

Can anybody please please upload a working Air example?
That would really save my week! :smileyhappy:

 

I'm using Flash CS6 and Air 3.1

Thank you

Please use plain text.
BlackBerry Development Advisor (Retired)
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: Add item to context menu

I haven't used the BBM ANE but you can find it with a sample here - https://github.com/blackberry/Community-APIs-for-AIR/tree/master/BlackBerry10/bbm 

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Please use plain text.
Developer
KermEd
Posts: 175
Registered: ‎05-18-2009
My Device: NA
My Carrier: NA

Re: Add item to context menu

Just use the bbm invoke share card. It's much easier. 

 

It's what I use in all my apps for that arguably necessary BFB requirement. 

 

If you still need code for it, drop a line. 

Please use plain text.
Trusted Contributor
Vibes
Posts: 215
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: Add item to context menu

That card invoking part is working for me, the problem is I would like to launch it from the context menu.

 

I'm trying to have a custom context menu entry with the BBM icon that invokes the BBM Card if selected. 

I just can't get this example to work in Flash CS6 and Air 3.1:

https://developer.blackberry.com/air/documentation/menus.html

 

Can you help me with it? That would be fantastic! :smileyhappy:

I'm really out of ideas.

Please use plain text.
Developer
KermEd
Posts: 175
Registered: ‎05-18-2009
My Device: NA
My Carrier: NA

Re: Add item to context menu

Yeah. The BBM root share card is broken - I've been told it's something to do with BBM Channels beta.

 

But if you use BBM message share it will work. Let me dig up some working code. 

Please use plain text.
Developer
KermEd
Posts: 175
Registered: ‎05-18-2009
My Device: NA
My Carrier: NA

Re: Add item to context menu

 

var ba:ByteArray = new ByteArray();

 

ba.writeUTFBytes("Fortune cookie says:  Play nice with others.");

 

 

 

var invopt:InvokeTargetOptions = new InvokeTargetOptions();

 

var request:InvokeRequest = new InvokeRequest();

 

 

 

request.mimeType = "text/plain";

 

request.targetOptions = InvokeTargetOptions.ALL;

 

request.action = "bb.action.SHARE";

 

request.target = "sys.bbm.sharehandler";

 

 

request.data = ba;

 

 

 

 

InvokeManager.invokeManager.invoke(request);

 

Please use plain text.
Trusted Contributor
Vibes
Posts: 215
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: Add item to context menu

Awesome, thanks for the example.
Do you have an idea how to invoke the SHARE dialog directly from the tab on a button?

 

Please use plain text.
Developer
KermEd
Posts: 175
Registered: ‎05-18-2009
My Device: NA
My Carrier: NA

Re: Add item to context menu

Yes, its pretty easy.

 

Just use a switch(evt.target.name) on the selection event for the ActionBar.

Please use plain text.