Navigation between Screens in Mobile Flex Project 4.5

Flex 4.5 (mobile development with Flex):
Navigation between Screens in Mobile Flex Project


Output:









Use the Simple method  "navigator.pushView()" to navigate between Screens.Pass next screen view as the parameter in the method .

Main.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.HomeView" applicationDPI="160">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:ViewNavigatorApplication>






HomeView.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
actionBarVisible="false" tabBarVisible="true" title="HomeView">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Button x="37" y="94" width="229" height="43" label="next"
 click="navigator.pushView(second)"/>   
</s:View>


second.mxml:


<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
actionBarVisible="false" title="LastView">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Label x="94" y="156" width="122" height="20" color="#EE0A60" fontWeight="bold"
text="Second Screen"/>
</s:View>








Comments

Popular posts from this blog

MVC Adding 2 Numbers Program

Relative Layout in android UI Design

Button Clicking -Perform Action in android