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
Highlighted
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

What files to include to use the invocation framework?

Hi,

 

I can't get theBB10  invocation framework to work.

(I'm using Flash CS 5.5 and Air 3.1 on Windows)

 

What  files (.as, .swc) do I need to include to use the invocation framework and do they need to be in a specific folder structure? 

 

I get an error pointing to the first line of the class InvokeEvent.as  package mx.rpc.events. 

It's just pointing to the line without further informations.

 

Thanks

Vibes

 

 

Developer
Posts: 223
Registered: ‎04-26-2012
My Device: Z10
My Carrier: Vodafone

Re: What files to include to use the invocation framework?

Change package to the good one:

 

import qnx.events.InvokeEvent;

 

You are getting default as3 invokeevent and that does not work here Smiley Happy

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: What files to include to use the invocation framework?

[ Edited ]

Sorry I don't understand what you mean.

This is my code: 

 

[code]

import qnx.events.InvokeEvent;
import qnx.invoke.*;


//NOTE: THIS MUST BE THE FIRST THING SET IN YOUR APPLICATION CONSTRUCTOR
InvokeManager.invokeManager.addEventListener(InvokeEvent.INVOKE, onInvoke );


function onInvoke( event:InvokeEvent ):void
{
if( InvokeManager.invokeManager.startupMode == InvokeStartupMode.INVOKE )
{
//invoked as an application/target.
var mydata:InvokeRequest = InvokeManager.invokeManager.startupRequest;

}
else if( InvokeManager.invokeManager.startupMode == InvokeStartupMode.VIEWER )
{
//invoked as a viewer
var myotherdata:InvokeViewerRequest = InvokeManager.invokeManager.startupViewerRequest;

}
else
{

//launched by the pressing on the icon on the home screen.
}
}
//

[/code]

 

Thanks

Developer
Posts: 223
Registered: ‎04-26-2012
My Device: Z10
My Carrier: Vodafone

Re: What files to include to use the invocation framework?

And where are you getting error?

This is different from your main error on mx.rpc.events.

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: What files to include to use the invocation framework?

The error points to the class InvokeEvent.as at line one: package mx.rpc.events

 

There is no additional information.

What files do I need to add to use the invocation framework and do they need to be in a specific fodler? 

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

Re: What files to include to use the invocation framework?

Wrong package. Use the one in "qnx.events".
Developer
Posts: 223
Registered: ‎04-26-2012
My Device: Z10
My Carrier: Vodafone

Re: What files to include to use the invocation framework?

I can not see an error like yours.

I have created a new project with this code and added QNXDevice.ane and works without errors.

 

package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import qnx.events.InvokeEvent;
	import qnx.invoke.*;
	
	public class TestProject extends Sprite
	{
		public function TestProject()
		{
			super();
			
			// support autoOrients
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			InvokeManager.invokeManager.addEventListener(InvokeEvent.INVOKE, onInvoke );
		}

		
		function onInvoke( event:InvokeEvent ):void
		{
			if( InvokeManager.invokeManager.startupMode == InvokeStartupMode.INVOKE )
			{
				//invoked as an application/target.
				var mydata:InvokeRequest = InvokeManager.invokeManager.startupRequest;
				
			}
			else if( InvokeManager.invokeManager.startupMode == InvokeStartupMode.VIEWER )
			{
				//invoked as a viewer
				var myotherdata:InvokeViewerRequest = InvokeManager.invokeManager.startupViewerRequest;
				
			}
			else
			{
				
				//launched by the pressing on the icon on the home screen.
			}
		}
	}
}

 

mx.rpc.events.InvokeEvent is the default invoke event on as3. You might have included it at any point and it's conflicing with QNX one. Have you searched for mx.rpc.events within your project?

 

 

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: What files to include to use the invocation framework?

Now I'm getting this error:

 

Scene 1, Layer 'as blackberry invoke', Frame 1,

Line 7 1172: Definition qnx.events:InvokeEvent could not be found.

 


Do I need to add more .swc files than jsut the QNXDevice.swc?
What "link type" do I need to use? "external" or "merge into code"?

 

Thanks

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

Re: What files to include to use the invocation framework?

You need the device ANE to be included in the package.
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: What files to include to use the invocation framework?

Can I use  the ANE with Flash CS5.5?

I renamed it from ANE to SWC and included it. Does that work?