09-29-2012 09:10 AM
hi all,
i manage to port sample WeatherGuesser from FDT to Mobile AS Application and it works.
But How to port that into Flex Mobile application.
I'd like to use native look of action bar, back and all of that.
is there any chance to accomplish that.
Thanks,
Vedran
Solved! Go to Solution.
09-29-2012 12:05 PM
10-26-2012 09:49 AM
11-10-2012 02:44 PM
Hi Jtegen
How do you wrap a QNX control into a flex control? thanks
11-10-2012 02:59 PM
11-13-2012 06:52 AM
Like This:
<fx:Script>
<![CDATA[
import qnx.fuse.ui.progress.ActivityIndicator;
private var myActivity:ActivityIndicator = new ActivityIndicator();
private function init():void {
myActivity.width = 150;
activity.addChild(myActivity);
myActivity.animate(true);
}
]]>
</fx:Script>
<mx:UIComponent id="activity" top="50" left="150"/>
11-19-2012 05:42 PM
Were you able to configure the Action Bar to like the Native BB10 navigation bar/ buttons etc?
I would like to do this using the Flex Mobile Application as well - I need to use MXML components with QNX.. I cant seem to add MXML components to the Weather Guesser sample witch is strictly an actions sctript mobile project.
11-19-2012 06:45 PM
You can do it like this:
imports and variables:
import qnx.fuse.ui.actionbar.ActionBar; import qnx.fuse.ui.core.Action; import qnx.fuse.ui.core.TabAction; import qnx.fuse.ui.events.ActionEvent; import qnx.fuse.ui.core.MultiSelectAction;
import mx.core.UIComponent; // Create Action Bar private var appActionBar:ActionBar = new ActionBar();
then on creationComplete call some function for me is init():
//Set component var ab:UIComponent = new UIComponent(); ab.left = ab.right = ab.bottom = 0; ab.height=140; // Add event listeners appActionBar.addEventListener(ActionEvent.ACTION_SELECTED, ActionSelected ); // ActionPar Preferences appActionBar.removeAll(); appActionBar.reserveActionSpace(true); appActionBar.showTabsFirstOnBar( false ); appActionBar.enableBackButtonDrag = true; // Populate action bar appActionBar.backButton = new Action( 'Back', null, {id:'back'} ); //appActionBar.addAction(new MultiSelectAction("MultiSelect", new Assets.BTT_LOGIN(), {id:'brisi'} ) ); appActionBar.addAction( new Action( 'Login' , new Assets.BTT_LOGIN(), {id:'login'} )); appActionBar.addAction( new Action( 'SingUp', new Assets.BTT_SIGNUP, {id:'singup'} )); appActionBar.addAction( new Action( 'Account', new Assets.BTT_SIGNUP, {id:'account'} )); appActionBar.addAction( new Action( 'Information', new Assets.BTT_INFO, {id:'info'} )); //Add ActionBar on component AND place on stage. ab.addChild(appActionBar); this.addElement(ab);
you need some function to handle clicks (see event listener above):
private function ActionSelected(e:ActionEvent):void {
/***
* by Vedran Tomičić
* Rijeka, 26.10.2012
*
* Ova funkcija služi za hvatanje akcija kada se tapne po action Bar-u
* Koristimo Switch funkciju.
*
*
* */
if(e.action.data!=null) {
switch(e.action.data.id){
case "back": {
navigator.popView();
break;
}
case "login": {
navigator.pushView(Login);
break;
}
case "singup": {
navigator.pushView(SignUp);
break;
}
case "account": {
navigator.pushView(Account);
break;
}
case "info": {
navigator.pushView(Info);
break;
}
}
}
} thats it, you will have action bar on your mxml file.
backButton drag not work here but tab button drag works ok .
11-20-2012 11:11 PM
Wow I can't thank you enough!! Thats a great start for me!
I still could not get get the BackButtonDrag working. You indicated that wont work in your post.. Do you have any examples on how you got this working?
appActionBar.enableBackButtonDrag = true; Flash Builder cant find (enableBackButtonDrag on ActionBar)
Also there isnt much documentation on this!
Thanks again for all the help!!
11-21-2012 07:47 AM