ARTICLE

Transition in Flash Mobile (iPhone) Applications

Posted by Ibrahim Ersoy Articles | iPhone/iPad January 30, 2012
I've worked a bit yesterday and here bringing you an alternative solution instead of an "Add-Remove View" Plan.
Reader Level:

Last night I was doing an application using Flash Builder 4.6. I was stuck in a point about transitions in an iOS application.
 
I could have used an Add-Delete View plan but instead I tried something else. 
 
Instead I could have used Add-Delete View plan; I tried another:
 
navigator.pushView(YourViewNameWithoutExtension);

Assume we have 2 mxml pages in our application. "iMediaHomeView" and "Facebook" for example.

FaceBook.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="true" color="#FF0000" overlayControls="false" tabBarVisible="true"
title="Facebook">

  <fx:Script>
    <![CDATA[

function GetBack()
{
navigator.pushView(iMediaHomeView);
}

]]>
  </
fx:Script>

  <fx:Declarations>
    <!--
Place non-visual elements (e.g., services, value objects) here -->
  </
fx:Declarations>
  <
s:Button x="25" y="734" label="All Sites" color="#000000"/>
  <s:Button x="515" y="735" label="Exit" color="#030303"/>
  <s:Button x="289" y="734" label="Back" color="#000000" click="GetBack();"/>
</s:View>


iMediaHomeView.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="true" color="#FF0000" overlayControls="false" tabBarVisible="true"
title="iMedia">

  <fx:Script>
    <![CDATA[

function Show_Facebook()
{
navigator.pushView(Facebook);
}

]]>
  </
fx:Script>
  <
fx:Declarations>
    <!--
Place non-visual elements (e.g., services, value objects) here -->
  </
fx:Declarations>
  <
s:Image x="177" y="24" width="128" height="128" scaleMode="stretch" smooth="true"
  smoothingQuality="high" source="assets/facebook.png" click="Show_Facebook_();"/>
  <s:Button x="515" y="735" label="Exit" color="#030303"/>
</s:View>

 
Let me show you the output images:

As Default iMediaHomeView.mxml file is being displayed according to my application.

 imgr1.png

After we click on Facebook icon it links to my FaceBook view object.

imgr2.png

When I click on the Back button it again shows my homepage "iMediaHomeView".

That way I found a way to wander between views.

Hope it will be useful for you, too.

Login to add your contents and source code to this article
post comment
     

Your welcome :) Thank you for the feedback!

Posted by Ibrahim Ersoy Feb 03, 2012

Thanks for good work

Posted by Arjun Panwar Feb 01, 2012

Thank you all for your feedbacks! @Mahesh: if we had like button,i'd click on your comment :) yes until Feb 8th :) But i will write as much as possible until that time. @Abhishek: yes,normally before going to army i was interested fully in Microsoft Technologies,later i realised something and began writing in different techs for comparison.That means in the future i will write not only in Microsoft Techs.

Posted by Ibrahim Ersoy Feb 01, 2012

thanks for sharing it I hope that you shared as different article......in future

Posted by Abhishek Dubey Feb 01, 2012

Very useful article. Thanks for sharing.

Posted by Alok Harsh Feb 01, 2012
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts