Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-22-2009, 05:23 PM   PM User | #1
wr1138
New to the CF scene

 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
wr1138 is an unknown quantity at this point
Question Page Up / Page Down vertical scrolling and focus after load

Is there an "easy" way to have a flex app respond to page-up and page-down
immediately after loading (so the application class takes focus and responds typically to standard keyboard scrolling commands)? Full page flex app, not a small page feature or ad swf.
Thanks!
wr1138 is offline   Reply With Quote
Users who have thanked wr1138 for this post:
Manuela1206 (12-02-2009)
Old 12-02-2009, 10:29 AM   PM User | #2
nikos101
Senior Coder

 
nikos101's Avatar
 
Join Date: Dec 2006
Location: London
Posts: 1,004
Thanks: 58
Thanked 10 Times in 10 Posts
nikos101 is an unknown quantity at this point
How does focus relate to page-up and page-down?
__________________

nikos101 is offline   Reply With Quote
Users who have thanked nikos101 for this post:
Manuela1206 (12-02-2009)
Old 12-02-2009, 02:16 PM   PM User | #3
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
The following will work in IE & FF, but won't in any Webkit-based browsers(Chrome, Safari):
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    layout="absolute"
    width="100%" height="100%"
    applicationComplete="setFocusOnStart(event)">
    <mx:Script>
    	<![CDATA[
		private function setFocusOnStart(event:Event):void
		{
			navigateToURL(new URLRequest("javascript: document.getElementById('main').focus();"),"_self");
			focusManager.setFocus(myTextArea);
		}
    	]]>
    </mx:Script>
	<mx:TextArea id="myTextArea"
		x="100"
		y="100"
		height="500%"
		width="50">
		<mx:text>
		FILL FILL FILL FILL FILL FILL FILL FILL FILL
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		FILL FILL FILL FILL FILL FILL FILL FILL FILL 
		</mx:text>
	</mx:TextArea>
</mx:Application>
Make sure you change "main" to the name of your mxml app file.
Inigoesdr is offline   Reply With Quote
Users who have thanked Inigoesdr for this post:
Manuela1206 (12-02-2009)
Old 03-24-2010, 05:37 PM   PM User | #4
fleetwood
New to the CF scene

 
Join Date: Mar 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
fleetwood is an unknown quantity at this point
I'm doing something similar to your code, Inigo, but using ExternalInterface to make a jQuery call so I don't have to redirect. Like yours, it doesn't work in Webkit browsers though. Any idea on why that is? My guess is that since the SWF HTML Object tag isn't a form, there is no focus() method for it, so javascript ignores the call?

What's peculiar is that the mouseOver events still fire, even though the swf doesn't have focus. The keylisteners remain deaf until I click on the app.

Any thoughts or ideas?
fleetwood is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:08 PM.


Advertisement
Log in to turn off these ads.