Solved! Go to Solution.
Keith,
Sure you can it is just a couple of quick changes to code.
In the index.mxml add a script block:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:viewer="com.esri.viewer.*" xmlns:managers="com.esri.viewer.managers.*" pageTitle="Blah Blah" creationComplete="init()"> <fx:Script> <![CDATA[ protected function init():void { navigateToURL(new URLRequest("javascript: document.getElementById('index').focus();"), "_self"); } ]]> </fx:Script>
This give the flash application itself focus from the browser. Then in the init function of my widget I want to have focus I just add this line:
txtSearch.setFocus();
You can see this working on my site http://gis.calhouncounty.org/ParcelViewer2.5/
as you are able to type in the parcel search widget without clicking (once the TOC is done loading).
Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
Keith,
Sure you can it is just a couple of quick changes to code.
In the index.mxml add a script block:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:viewer="com.esri.viewer.*" xmlns:managers="com.esri.viewer.managers.*" pageTitle="Blah Blah" creationComplete="init()"> <fx:Script> <![CDATA[ protected function init():void { navigateToURL(new URLRequest("javascript: document.getElementById('index').focus();"), "_self"); } ]]> </fx:Script>
This give the flash application itself focus from the browser. Then in the init function of my widget I want to have focus I just add this line:
txtSearch.setFocus();
You can see this working on my site http://gis.calhouncounty.org/ParcelViewer2.5/
as you are able to type in the parcel search widget without clicking (once the TOC is done loading).
Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
What file is the splash screen kept in?
Chris,
The widget is called Splash and the widget file is SplashWidget.mxml