Deep Linking - Flex 3 Navigation using ViewStack

34 views
Skip to first unread message

Vinoth Kumar

unread,
Dec 31, 2013, 6:54:40 AM12/31/13
to flex_...@googlegroups.com
Hi All,
     I am new to flex application development, i would like to explain my context. we are having flex application which is fine using ViewStack. but our new requirement is to when i hit back button from browser, we should able to go back previous selected child of ViewStack. 

    in another case a selected child of viewstack can be a component. which is again having ViewStack for navigation. it should navigate me back when i hit back button. 

    I am look for solution. suggestion me how i can proceed this requirement. 

   Help me, 

With Regards 
 Vinoth Kumar.P

adi

unread,
Dec 31, 2013, 12:18:21 PM12/31/13
to flex_...@googlegroups.com

Shashank

unread,
Dec 31, 2013, 1:34:47 PM12/31/13
to flex_...@googlegroups.com
You could also try and work with BrowserManager
--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flex_india+...@googlegroups.com.
To post to this group, send email to flex_...@googlegroups.com.
Visit this group at http://groups.google.com/group/flex_india.
For more options, visit https://groups.google.com/groups/opt_out.

Ramakrishna Bhuma

unread,
Jan 1, 2014, 12:38:28 AM1/1/14
to flex_...@googlegroups.com
HI vinoth

try this



<?xml version="1.0" encoding="utf-8"?>
<mx:Application 
layout="absolute" width="400" height="300"
creationComplete="init()" >
<mx:Script>
<![CDATA[
import flash.net.navigateToURL;
import mx.events.BrowserChangeEvent;
import mx.utils.URLUtil;
import mx.managers.IBrowserManager;
import mx.managers.BrowserManager;
import com.adobe.viewsource.ViewSource;
private var browserManager:IBrowserManager;
private function init():void
{
browserManager = BrowserManager.getInstance();
browserManager.addEventListener(
BrowserChangeEvent.BROWSER_URL_CHANGE, 
parseUrl
)
browserManager.init("");
parseUrl();
var srcUrl:String = Application.application.parameters.srcUrl;
if(srcUrl)
ViewSource.addMenuItem(this, srcUrl);
}
private function parseUrl(e:BrowserChangeEvent = null):void
{
var o:Object = 
URLUtil.stringToObject(browserManager.fragment);
vs.selectedIndex = o.a;
}
private function updateUrl():void
{
browserManager.setFragment("a=" + vs.selectedIndex);
}
]]>
</mx:Script>
<mx:ApplicationControlBar dock="true" 
 horizontalAlign="center">
<mx:ToggleButtonBar dataProvider="{vs}"/>
</mx:ApplicationControlBar>
<mx:ViewStack id="vs" width="100%" height="100%"
 change="updateUrl()">
<mx:Canvas label="Area Uno" backgroundColor="#FF0000"
  width="100%" height="100%">
<mx:Label x="75" y="100" 
 fontSize="22" text="Area Uno"/>
</mx:Canvas>
<mx:Canvas label="Area Dos" backgroundColor="#00FF00"
  width="100%" height="100%">
<mx:Label x="75" y="100" 
 fontSize="22" text="Area Dos"/>
</mx:Canvas>
<mx:Canvas label="Area Tres" backgroundColor="#0000FF"
  width="100%" height="100%">
<mx:Label x="75" y="100" 
 fontSize="22" text="Area Tres"/>
</mx:Canvas>
</mx:ViewStack>
</mx:Application>



Thanks

Ramakrishna.
--
Thanks & Regards
Ramakrishna.

bala subramanyam

unread,
Jan 1, 2014, 10:55:26 AM1/1/14
to flex_...@googlegroups.com

Hi,

Try using this property on viewstack
historyManagementEnabled="false|true";

Regards
Balu


--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flex_india+...@googlegroups.com.
To post to this group, send email to flex_...@googlegroups.com.
Visit this group at http://groups.google.com/group/flex_india.
For more options, visit https://groups.google.com/groups/opt_out.



--
Baluvasireddy
Reply all
Reply to author
Forward
0 new messages