01-19-2012 02:17 PM
Hello All,
Recently I have been working on a Swipe_Down menu for an application I am TRYING to build for the PB. At this point I should explain that without the previous support of Zezeke and Jtegen I would probably have less hair than I already do!
Its also worth mentioning, I am NOT a programmer and am embarking on this as the subject matter interests me greatly.
Ok! I now have zero errors in my application and can build it quite successfully and transfer it to my PB. But the Swipe Down menu is not working, I then went into debug and this is the error that I am getting.
VerifyError: Error #1014: Class qnx.pps:
PSChannel could not be found.
at stock/___stock_Application1_creationComplete()[F:\
at flash.events::EventDispatcher/dispatchEventFunctio
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\fr
at mx.core::UIComponent/set initialized()[E:\dev\4.y\frameworks\projects\frame
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCa
Simplyput, this would probably be clearer to me if it were written in Zulu!
Please can someone throw some light on how I overcome this and get the menu to appear on the PB?
Many thanks
Bob
Solved! Go to Solution.
01-19-2012 05:04 PM
It sounds like the qnx-air.swc is being merged into code when linking against the project.This library must be linked externally.
If you are using Flash Builder you can have it do this for you automatically by selecting
Project > Properties > ActionScript Build Packaging > BlackBerry Tablet OS > Include platform specific libraries.
You can also do this manually in Flash Builder by going to
Project > Properties > ActionScript Build Path > Library Path > qnx-air.swc and double click on Link Type and set it to External.
And if you are using the command line you want to use the "external-library-path" switch instead of "library-path"
Hope that helps
Julian
01-20-2012 06:19 AM
Hi Julian,
Thanks for your reply.
I think I may have a further problem as I dont have an option for actionscript build path in the project properties dialogue.
I think maybe I need to add an ANE to the path but then again maybe I am clutching at straws!! ![]()
Please advise what you think my next step should be.
Many thanks
Bob
01-20-2012 07:22 AM
First of all it's zezke
Are you sure that's an ActionScript Mobile Project? Because it suppose to look like the screenshot below (Flash Builder 4.6). What version are you using?
01-20-2012 09:10 AM
Hi Zezke,
I built the project as Flex Mobile project which incorporates the file Menu.as which resides in the utils folder . This is imported from the main MXML file at the line <utils:Menu id="slideMenu"/> (see code below).
In the Project Properties I have included qnx-air.swc in the library build path (see image).
The project compiles and creates a .BAR fie which I can then load to my PB but the swipe_down does not function. When i run the project on the desktop virtual playbook I get the same errors as I do when I run debug.
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:utils="utils.*" creationComplete="createMenu(event)" resize="resizeHandler(event)" splashScreenImage="@Embed('assets/images/stock_splash.png')"> <fx:Style source="Styles.css" /> <fx:Script> <![CDATA[ import mx.events.FlexEvent; import mx.events.ResizeEvent; import spark.events.ViewNavigatorEvent; import caurina.transitions.Tweener; import qnx.events.QNXApplicationEvent; import qnx.system.QNXApplication; // Registers the drop down menu for PB application protected function createMenu( event:FlexEvent ):void { QNXApplication.qnxApplication.addEventListener( QNXApplicationEvent.SWIPE_DOWN, pullDownMenu ); } private function pullDownMenu( event:QNXApplicationEvent ):void { trace( "Menu pulled down" ); Tweener.addTween(slideMenu, {y: 0, time: 0.5, transition: "linear"}); /** * add the mouse listener to hide the menu when the user clicks * outside of the menu area */ stage.addEventListener(MouseEvent.CLICK, onStageMouseClick); } // Hide menu when the screen is touched outside menu private function onStageMouseClick( e:MouseEvent ):void { /** if the user clicks outside of the menu area, hide the menu */ if (mouseY > slideMenu.height) { Tweener.addTween(slideMenu, {y: -slideMenu.height, time: .3, transition: "linear"}); stage.removeEventListener(MouseEvent.CLICK, onStageMouseClick); trace( "Menu went up" ); } } // Update the applications state based on the orientation of the device protected function resizeHandler(event:ResizeEvent):void { currentState = aspectRatio; } protected function viewnavigator1_contentCreationCompleteHandler(even t:FlexEvent):void { // TODO Auto-generated method stub } ]]> </fx:Script> <s:states> <s:State name="portrait"/> <s:State name="landscape"/> </s:states> <s:SplitViewNavigator id="splitNavigator" autoHideFirstViewNavigator="true" width="100%" height="100%" skinClass="stock.rsc.skins.TexturedApplicationSkin "> <s:ViewNavigator width="300" height="100%" firstView="stock.rsc.views.StocksListView" contentCreationComplete.portrait="viewnavigator1_c ontentCreationCompleteHandler(event)"> <s:filters.landscape> <s:DropShadowFilter distance="2" blurX="10" blurY="10" angle="45" alpha="0.5" color="#000000" /> </s:filters.landscape> </s:ViewNavigator> <s:ViewNavigator width.portrait="100%" width.landscape="{width - 300}" height="100%" firstView="stock.rsc.views.DetailsView"> <s:navigationContent.portrait> <utils:Menu id="slideMenu"/> <s:Button id="navigatorButton" styleName="normalButton" label="Stocks" click="splitNavigator.showFirstViewNavigatorInPopU p(navigatorButton)" /> </s:navigationContent.portrait> </s:ViewNavigator> </s:SplitViewNavigator> <!--<s:Image width="100%" height="100%" source="assets/images/lines.png" fillMode="repeat" mouseChildren="false" mouseEnabled="false" alpha="0.2"/> --> </s:Application>
01-20-2012 10:50 AM
Where is your method createMenu called?
01-20-2012 02:28 PM
If I understand your question its in the main MXML under the '//Registers the drop down menu for PB'
protected function createMenu( event:FlexEvent ):void
{
QNXApplication.qnxApplication.addEventListener( QNXApplicationEvent.SWIPE_DOWN, pullDownMenu );
}
private function pullDownMenu( event:QNXApplicationEvent ):void
{
trace( "Menu pulled down" );
Tweener.addTween(slideMenu, {y: 0, time: 0.5, transition: "linear"});
01-21-2012 03:41 AM
I don't know MXML, I use pure AS3. You have a method that creates a menu, but that method isn't being called anywhere if I see it correctly.