Flex :: Set Focus On UI Control, Button, Etc?

Feb 8, 2011

I'm trying to set focus on a specific button when the app launches (or later based on certain events), so that the user can simply hit return to press the button. None of the following approaches work however.

protected function group1_creationCompleteHandler(event:FlexEvent):void
{
//btnBrowse.setFocus();
focusManager.setFocus(btnBrowse);
}

View 3 Replies


Similar Posts:


Flex :: Setting Focus On A Popup's TextInput Control?

Jul 27, 2010

I'm trying to have a popup window with an immediately editable TextInput. This means that the user should be able to type inside the TextInput once the popup is displayed.

The problem is that I can't focus on the textInput. What happens is that when pressing a key for the first time, no text is inserted, only after a second key is pressed does the component gain focus and the user is able to type. For instance, typing "test" once the popup opened results in "est" being displayed...

For some reason the component only gains focus when the user explicitly clicks on it or types something. Programmaticaly setting the focus does not work.

Code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns="mog.miss.component.*" xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>

[Code].....

View 3 Replies

Flex 3 - No Blue Focus Ring On Button?

Nov 3, 2010

My button doesn't have a blue focus ring around it, even though it has focus. I've got a component with a RadioButtonGroup and a Button. After a selection is made in the RadioButtonGroup, focus is switched to the Button. I added click="focusManager.setFocus(myCloseButton)" on the VBox.

After, a radioButton is selected, if the user clicks the spacebar the Button fires. So, as I understand it focus was switched to the button. But, the button doesn't get a blue focus ring surrounding it. How do I get the focus ring? I have visible="false". I turn them to visible, after some effects are finished. So, don't let that throw you.)

[code]...

View 1 Replies

Flex :: Have A Button Not Fire On Space Key If It Has Focus?

Jun 11, 2009

The behavior I'm trying to prevent is after a user clicks on a button, the button retains focus, and then if the user hits the space key, the button fires again. So I thought it could be solved either by setting the focus elsewhere, or by having the button ignore the space key. I've tried adding the following keyDown event listener on the button, but it didn't work.

private function btn_keyDown(event:KeyboardEvent):void {
// try to ignore spaces, i.e. don't click on SPACE when it has focus
if (event.keyCode == Keyboard.SPACE) {
}
}

I tried changing focus by doing the following, at the end of the function that's called when the button is clicked:

stage.focus = parent;

View 5 Replies

Flex :: Keeping Focus On A Textbox When Clicking A Button

May 31, 2011

I have a series of editable text areas in which I want to be able to add a variable on the click of a button.

If I click the button the textarea loses focus and so I cant code which textarea I need to add the variable into. Can anyone think of a way of keeping focus on the textbox, inserting the variable and then allowing the user to carry on typing.

I've been playing around with the setFocus function trying to get this to work with no success.

Here is a snippet of my code:

public function addFirstName(myText:string):void{
myText = myText + "<<firstname>>";
}
<mx:TextArea id="txt1" change="text1=txt1.text" text="{text3}" editable="true"/>

[Code].....

View 2 Replies

Actionscript 3 :: Flex TextArea Keep Focus/selection When A Button Is Clicked?

May 29, 2009

I am wondering how I would keep the focus/selection on a TextArea even when a button outside is clicked. Like how the RichTextEditor does it.

View 3 Replies

Flex :: Button Or Any Control With Two Labels?

Feb 14, 2011

How can I have two labels on a Flex button, one label on top and another on the bottom?

View 3 Replies

Actionscript 3 :: Get Button Up Even When Out Of Focus?

Jul 30, 2010

I've been working on creatbutton using a MovieClip. I'm using the following events:

this.addEventListener(MouseEvent.CLICK,OnClick);
this.addEventListener(MouseEvent.ROLL_OVER,OnButtonRollOver);
this.addEventListener(MouseEvent.ROLL_OUT,OnButtonRollOut);

[code]....

View 1 Replies

ActionScript 3.0 :: What The Focus 2 - Automatic-focus - Clicking To Be Able To Detect Key Input

Mar 8, 2011

[Code]...

when i have this line active(the red one) it gives me automatic focus, so no clicking to be able to detect key input so i got that going for me which is nice BUT when i have it active(not commented out) i get this big yellow line which goes away when i click it(seeBelow)

View 1 Replies

Flex :: Manipulate Child Control Inside A Panel Control?

Oct 12, 2009

I am trying to manipulate (move up and down, enable/disable and launch a form) child controls inside a panel control. However I am unable to get the id of the child control on which the click event occurs. To illustrate, I am trying to create similar functionality as is available. I am trying to create the up-down buttons that you see in the image at http:[url].......

View 2 Replies

F8 :: Cursor Keys To Change Button Focus?

Nov 18, 2006

I'm trying to create a fairly simple interface where the user can theoretically move up and down four vertical menu buttons with the cursor keys, selecting the option they prefer with the enter key. Obviously this requires focusing on a different button every time they move up or down, but I'm damned if I can figure out how to do this

View 1 Replies

ActionScript 3.0 :: Finding Out When A TextField Has Focus And When It Loses Focus?

Jul 13, 2009

Does anyone know how to do this in AS3?

View 3 Replies

ActionScript 3.0 :: TLF Focus - Set The Keyboard Focus For A TLFTextField And Cursor?

Sep 14, 2010

can I set the keyboard focus for a TLFTextField? I tried stage.focus = myTLF but there is no cursor...

View 2 Replies

Flash :: Control Flex Application From Embedded Control?

Mar 21, 2010

I have a flex application and have embedded a flash (SWF) file into it using <mx:SWFLoader>. There is an "Exit" button on the Flash file. I want to be able to handle the button click event on the flex application.

So when that button in the flash file is clicked, I want to perform an action in the parent flex application.

View 2 Replies

Flex :: Menu Control - Click A Button And A Menu Is Displayed. Click That Button A Second Time And Hide That Menu?

Jun 20, 2010

Basically, I have a button and on click it displays a menu. I want to click that menu a second time and the menu closes. Currently, every time you click the button, the menu reopens. I pasted the Flex livedoc example below. If you click the button, the menu keeps reopening.Now, I rigged it up by setting a var to open and closed, so when clicking the button it does a check. However, if you click away from the screen, the HIDE event gets dispatched, and the menu closes. This messed up the open close var being set.

How could I make this Flex example below show the menu on button click, and then on a second button click, it closes the menu? Take into affect that if you click away from the menu, it closes it.Also, I played around with the MOUSE_DOWN_OUTSIDE event for the button and set the preventDefault, and the FlexMouseEvent event.cancelable is set to false.Changing to a PopUpMenuButton is not an option. I have to much skinning involved.Here is the Flex example:

<mx:Script>
<![CDATA[
// Import the Menu control.
import mx.controls.Menu;

[code]....

View 1 Replies

Flex :: Make Flex Grab The Focus Of The Mousewheel?

Aug 7, 2009

The entire box at the top is a Flex application. The box on the left with the list of pinball machines is a VBox. As you can see, if you try to scroll with your mousewheel, it doesnt respond. The reason this is shut off is because I found that if it's turned on, when you scroll up/down, the whole page goes with it. So if you scroll down four or five times, the application goes out of sight.I tried finding a solution to this when I programmed this last year but wasnt able to find any answers.if there's a way to make Flex grab the focus of the mousewheel and not let the browser move as well?

View 4 Replies

Actionscript 3 :: Flex Alert Control: Activating The "default" Button On Enter/space Key-press?

Dec 17, 2009

No matter what I try, I can't seem to fire the click event on the "default" button in an Alert control in a Flex 3.4 application.

[Code]...

View 1 Replies

Flex :: How Does Focus Works

Feb 17, 2011

I try to figure out how does focus mechanism work in Flex. Here comes the example of what I mean:Let's assume that we have a simple web application, which contains custom component that extends Canvas and implements mx.managers.IFocusManagerComponent. This component overrides focusInHandler and focusOutHandler methods and shows some feedback on how they are called (thinner or thicker border). This custom component also contains some Text.[code]

If you click once on a violet canvas it receives focus (focusInHandler is called), then if you click again the focus is lost (focusOutHandler called) - why?Of you click on a Text the Canvas receives focus (focusInHandler called) and keeps it when being clicked wherever on the area (focusOutHandler nevet called) - why?

View 1 Replies

Flex :: New Grid Row With Focus?

May 26, 2011

I am trying to make an editable DataGrid to insert a new row when user presses TAB in the last column of last row.y Grid:

<mx:DataGrid id="myGrid"
dataProvider="{initDG}" editable="true"
itemFocusOut="onItemFocusOut(event)">

[code]....

View 2 Replies

ActionScript 2.0 :: Create A Keyboard Shortcut Using A The Control Button Plus A Key Button?

Dec 28, 2005

Is there any way to create a keyboard shortcut using a the control button plus a key button. For example, if I want to print the screen, I would press control + p.

View 5 Replies

Flex - Unable To Get Focus On Canvas?

Dec 13, 2009

I am creating a canvas in actionscript like :

private var cvs_preview:Canvas = null;

[Code]....

So on the focus change i want to run the "end_preview_on_focus_change()" but this is not working. As per my understanding, i think the canvas not getting any focus in the first place. I was trying to use focusManager.setFocus to do that after the canvas's creation complete. but even that is giving me an error.

[Code]...

View 3 Replies

Flex :: Set Focus And Selection On A TextField?

Jan 16, 2011

I am trying to programmatically pass focus to a newly created TextField, but for some reason setSelection and setFocus do not work. For example, see my test code below:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="_init()">
<mx:Button click="{tf.setSelection(1,2)}" />[code]....

The only setSelection that does anything is the 0,3 one on MOUSE_DOWN. I assume this all has something to do with the text field receiving focus with the mouse click,

View 2 Replies

Flex :: Focus Border For DateField

Mar 31, 2011

Is there a way to Set a a focus border on a datefield when it is selected and change the border to some other colour when we lose focus from the datefield.

View 1 Replies

Flex - Cannot Focus Children Of SkinnableContainer?

May 25, 2011

I have a custom component extends from skinnableContainer and only has two NumericSteppers.I explicitly set focus to my component like myComponent.setFocus(). It sets focus to first stepper which is correct, but when I press TAB to move focus to next stepper it moves focus to the next Component.

I set tabEnabled = true and tabChildren=true of the component, still no luck. How could I set focus to next stepper on pressing TAB?

View 1 Replies

Flex :: Focus - Getting FocusedIndex In A Buttonbar?

Nov 7, 2011

I've been looking around on how to get the focusedIndex property of a ButtonBar when there's a mouseOver/Out event, but haven't found nothing useful.EDIT 1Assuming we have this button bar:I'd like to know, when rolling over, the target button.Putting a break point in a function that listens to the mouseover event, this is what I see in the debug view:

View 1 Replies

ActionScript 3.0 :: Keyboard Focus Not The Same As Focus?

Mar 16, 2009

I have a TextField called textField on the first frame of the main timeline, and this simple code.

Code:
import flash.events.KeyboardEvent;
import flash.events.FocusEvent;

[code]......

View 2 Replies

Flex :: AIR Set Focus On Textinput On Application Load?

Dec 22, 2009

On my application I have a login form. On application start, I want the focus/selected one is set on the user id textinput. I tried normal setFocus method and didnt worked. How can i make it work?

View 1 Replies

Flex :: Trigger Mouseevent When The Focus Is On TextInput?

Jul 29, 2010

In flex, I am using the following:

mx:TextInput mouseOver="tester(event)"

It works fine. My pointer goes over the textInput and it calls the function. But when I click inside the textInput to enter some text( focus is on the textInput) and then move the mouse (not taking mouse pointer outside of the boundary of textinput), the mouseover event is not trigerred.

If I use click event, then even if I am entering text ( or the focus is on the textinput) and then click, it will call the function.

How can I call the tester function on mouseover when the focus is on textInput?

View 1 Replies

Flex :: Using Tab Focus Manager In A Title Window?

Sep 7, 2010

I'm struggling to get around an error that is constantly thrown in my application when I press the tab key.

I have a modal dialog box that contains a form with 3 form items. Whenever I press the tab button flex throws an error saying

"ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller."

I've tried setting up a focus manager in the initilize handler of my title window to no avail

private function init(e:FlexEvent):void
{
focus=new FocusManager(myform);
focus.setFocus(firsttextfield);

[Code]....

View 2 Replies

Flex :: Set The DG In Focus From Stage KeyDown Handler?

Feb 25, 2011

My app has a datagrid as well as many other UIComponents (buttons, menus, etc). I have a general stage KeyDown handler as well as a specific one for the datagrid. The behavior I'm trying to implement is turning out to be trickier than I thought: basically, when using the keyboard arrows I would like the datagrid to always hear about such commands, even if it's not in focus.

Possible approaches I thought of:have the DG be in focus at all times: seems stupid / tricky - basically would need to remember to give focus back to DG after any interaction with the rest of the UI, which obviously doesn't scale.try to set the DG in focus from stage KeyDown handler: seems like the timing doesn't work since the DG gets focus too late to "hear" the event.from the stage keydown handler, check if the DG is not in focus, and if so pass it the event. This seems to make sense in theory, but I'm not sure how to do this properly since my stage keyDown handler uses capture, and thus seems to catch the same event over and over.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved