Flex :: Apply Focus_out Event To More Than Just Selected Component?
Apr 14, 2011
It uses a focus_out event to detect if there is a change that needs to be committed. However I notice that a FOCUS_OUT event is only called if you click away from the textfield but inside the component. Is there any way I can listen for clicks outside the component from within the component?
addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
protected function onFocusOut(event:FocusEvent):void
{[code]....
View 2 Replies
Similar Posts:
Apr 15, 2011
I'm trying to code a drop-down control in as3, where clicking on the control's 'top-text' (a Sprite) causes a box to appear (another Sprite). The box contains a list of all items that may be selected. When 'item1' is selected the box closes and item1-text becomes the control's top-text. And so on.I also want the box to automatically close when the control loses focus, i.e. when the user clicks anywhere else on the flash movie. For this, I add an event listener on the box for FocusEvent.FOCUS_OUT.
The thing is, I want different processing to take place depending on the FocusEvent's relatedObject. To be more precise I want to do something more than just closing in the specific case where relatedObject is a child of the drop-down control itself. And just close it if not.My problem is that the relatedObject property is always coming up null no matter what gains focus. Furthermore the isRelatedObjectInaccessible property is always false so (according to the documentation) it is not a security related problem.
View 2 Replies
Mar 25, 2011
I have two panels that have a click event on them. However, both call the same function for some reason. When I have only one panel visible the animation works correctly. However if I add another to the stage on the click event both panels animate at the same time. I just dont get what I'm doing wrong. My function is looking for only the current target but apparently I must not be doing that correctly because it's animating both panels and not just the panel the I clicked. My expected result is to animate only the clicked panel.
[Code]...
View 1 Replies
Dec 2, 2009
How to get all the selected items from in this below code selectedContsList ?
<mx:DataGrid id="dg" dataProvider="{cNumbersList}" allowMultipleSelection="true" dropEnabled="true" dragMoveEnabled="true" >
<mx:columns>
[code].....
View 1 Replies
Sep 11, 2010
How can I Access Items Selected in a Component from the Main App I've got a component that has a listControl and a couple of RadioButtonGroups. I need to access the selected items in the main application. What's the best/simplest way to create and access the array of selected items. So, the user clicks the button to confirm the selections and then I need to access those selections in the main app. Is there a way I can use a public var to build the array? Another idea?
<mx:Tile direction="horizontal">
<mx:Box>
<mx:Label text="Year" fontWeight="bold"/>
<mx:List id="myYear" >
[code]....
View 2 Replies
Sep 6, 2009
How can I Access Items Selected in a Component from the Main App
I've got a component that has a listControl and a couple of RadioButtonGroups. I need to access the selected items in the main application. What's the best/simplest way to create and access the array of selected items. So, the user clicks the button to confirm the selections and then I need to access those selections in the main app. Is there a way I can use a public var to build the array? Another idea?
<mx:Tile direction="horizontal">
<mx:Box>
<mx:Label text="Year" fontWeight="bold"/>
[Code]....
View 2 Replies
Jan 23, 2011
I was wondering how I apply an edited actionscript class to a component?
I've made a few changes to the TileLayout class (spark.layout.supportClasses.LayoutBase), but am unable to apply this new layout format to my group in my application... is it treated like a different tag within the layout tag?[code]...
View 1 Replies
Oct 21, 2009
I'm setting selected element in s:List component with Actionscript, it works, but List doesn't scroll to selected item -- need to scroll with scrollbar or mouse. Is it possible to auto-scroll to selected item
View 8 Replies
Jun 2, 2010
When I set style color, it changes both the text color for the selected item/component label and the text in the dropdown menu.
color
Type: uint Format: Color CSS Inheritance: yes
Color of text in the component, including the component label. The default value is 0x0B333C.
I would really like the label to be white and the text to be black.
View 1 Replies
Mar 11, 2011
I have the following codes,
for (i=0; i<answerArray.length; i++) {
var myOptionButton1:spark.components.RadioButton = new spark.components.RadioButton();
myOptionButton1.label = answerArray.getItemAt(i).Answer_Choice;
[code].....
View 2 Replies
Sep 30, 2010
I have an AdvancedDataGrid with Hierarchical data in it. On itemClick I have to identify if the row I clicked is expanded or collapsed.
View 1 Replies
Jan 27, 2012
I am trying to understand event propagation in Flex framework and have a following doubt on it:
Scenario: I have a built-in component DropDownList on change of which I want to create a custom event refreshPreview and want to propagate it to a custom component PictureComponent.
In the custom component's mxml, I have added the Metadata directive as follows to register a refreshPreview event with the compiler
<fx:Metadata>
[Event(name="refreshPreview", type="flash.events.Event")]
</fx:Metadata>
Layout Details: In my main mxml application I have laid out DropDownList and the custom component such that both are siblings (i.e. have a common indirect parent)
e.g.
<s:Group id="contentGroup">
<s:Group id="formGroup">
<s:Form x="11"
[Code]....
I am seeing that the refreshPreview event is not getting propagated to the custom component.
I doubt this is because the built-in component is a sibling of the target (where the event got generated) and not a parent. how to make refreshPreview event propagate to custom component?
View 1 Replies
Mar 2, 2012
This is NOT duplicate of my earlier post (its is slightly different)But this is similar issue with similar error but its not the same error The error I am getting now is below while dispatching the custom event from my custom component
TypeError: Error #1034: Type Coercion failed: cannot convert events::MapEvent@a74ab51 to flash.events.MouseEvent.
dispatchEvent(new MapEvent(MapEvent.CLICKED_ON_MAP));
Note: The error in my earlier post is giving below error message
Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent
The difference here are two things, the earlier error is while converting flash event to custom event and now this one is while converting custom event to flash event and secondly, I have no clue why it is trying to convert to the mouseevent where I am just dispatching my custom event with proper listeners.
This is my custome event
package events
{
import flash.events.Event;
import ui.map.MapElement;
[code]...
View 1 Replies
Nov 6, 2009
Is there any way to disable a few columns for a particular row in flex datagrid?
I have a datagrid with about 10 or more columns, say for example a few column names are: Item Id, Item Name, Item Status and VerifiedState. Initially I want the column Verified State to be disabled.
Now When the value of the column, Item Status is Review Passed for a particular row, I want the column VerifiedState to be enabled and editable. Is that possible in Flex datagrid.
View 2 Replies
May 4, 2011
I have a repeater component with custom event. My repeater components fires custom event holding data. My need is to dispatch event so other repeater components can access data from dispatching component.
Edit: Added whole stuff here.
<!-- AttributeMapping.mxml -->
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
[Code].....
View 1 Replies
Sep 11, 2010
I'm just getting started with custom events in a custom component. And I don't quite have the hang of it, yet. I've got a component with a button in it. When it's clicked, I want to call a function in the main app.
Custom Component:
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" >
[code].....
View 1 Replies
Jun 23, 2010
I have an application in flex, it has some components out of the box and quite a few of custom components and events. I want to get all event listeners on a specific component in runtime, I know how to do it with monkey-patching the framework but I do not want to use a monkey patch nor can I rely on this in production.
View 2 Replies
Aug 10, 2010
I am working on a AS3 only project in Flex....I tried to listen ENTER event when use clicks enter/return in my textinput box....but it seems not working well...I did try using TextEvent.TEXT_INPUT and it worked fine but not Component.ENTER.
[Code]....
View 3 Replies
Feb 10, 2011
What's the call analogous to creationComplete that happens every time a component is rendered? I want to rerun a function every time the component gets rendered (it has to make an HTTP request, but the url it calls changes each time) and I can't figure out how to do it.
For context:
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
[Code].....
View 3 Replies
Mar 3, 2011
I need to call a component and pass an object. Now I am using event initialize to pass into the method of component but it seem to execute only once as follows. Is there anyway that I can make it call every time it loads.[code]
View 2 Replies
Nov 30, 2009
I am trying to determine what events I need to wait for in a test in order to ensure that my custom component has updated all of its properties. I was using VALUE_COMMIT, but for some reason that isn't working out for me. I want some easy mechanism for tracing every event dispatched from a component. Is this possible?
View 1 Replies
Feb 6, 2010
I defined a simple event class:
public class NewMoveEvent extends Event
{
public function NewMoveEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=true)
[code].....
View 1 Replies
Mar 25, 2010
enter code hereBeen really frustrating just trying to load a swf from a swfloader in Flex and then accessing it's content. I'm sure once I figure out how to do it once then it'll be fine, but I've gone thorugh a bunch of tutorials and somethings not right. Here's my flex code:and the as code:
public function initHeaderSwf():void
{
trace("INITIATIED");[code]........
Here's the problem: The swf loads, there is no problem there.i see it in my compiled swf. but the complete event doesn't fire. CreationComplete will fire, and then I try, after that, to make a event listener for loading the actual swf, that doesn't fire.I've tried it a variety of different ways with no luck.All I am trying to do is change a text field in the loaded swf.I imagine this might be a problem with the sequence of things loading or something like that, but not sure.
View 1 Replies
Apr 6, 2010
I have a CustomTextInput component based on TextInput (Spark) component. The instance of this class is placed on a popup window (TitleWindow). How can I capture the popup move (dragging the title) event inside CustomTextInput implementation?
MoveEvent.MOVE event of the CustomTextInput itself doesn't work. Of course, I can't access the parent popup window inside the component implementation, because it's a common component that can be used not only on the popup windows.
View 1 Replies
Jun 11, 2010
I have a weird issue (weird because it is specific to one component) with applicationComplete in a fairly simple application. All the UI components are declared in MXML. I can access them all in applicationComplete, but not a spark.components.TextArea component, named taStatus here; it is null in the handler.[code]...
View 1 Replies
Nov 19, 2010
I have a custom component with a couple of text input fields (among other things) that is used as the row components in a tree. I have had to write my own drag and drop handling, and have almost finished the start handler (which I did last), using mouseDown as the event to kick if off.It basically works, but when the tree is expanded enough so that a scroll bar shows, using the scroll bar drags a row of the tree at the same time ! Not the desired behaviour.Looking in the debugger, I can see that when a row of the tree is dragged the currentTarget is the tree itself, and the target is the textInput component. Looking at the parents of that component I can see my custom component (that contains the textInput) a couple of levels up.My question is, is there an easy way to determine if this target is descended from my component, so that I can initiate a drag only if that is the case ? event.target is doesn't work by the way.
View 2 Replies
Mar 9, 2011
I have an event, which I have dispatched in my main.mxml:
var evt:UserEvent = new UserEvent(UserEvent.USERINFORMATION);
evt.userVO = storeObject;
this.dispatchEvent(evt);
I can listen for it while in my navigation.mxml file, by using
this.parentApplication.addEventListener(UserEvent.USERINFORMATION, onInfo);
But in other component, I can not listen for it, even trying the same as I did in navigation.mxml.
tracing it back gives me an undefined.
the second component is in a viewstack in navigation.
View 1 Replies
May 9, 2011
I will need to execute a function in a comp1.mxml from main.mxml through event, I found it difficulty to understand and unable to get it work.[code]...
View 2 Replies
May 10, 2011
I made a movieclip in flash that dispatches a custom event: MyEvent.THE_TYPE = "the_type"in flex I have: <local:my_flash_mc the_type="do_something()"however, this is not working.in flash, my event bubbles is set to true. everything works fine in flash.in flex I am NOT using:
<fx:Metadata>
[Event(name="the_type", type="...")]
</fx:Metadata>
[code]....
View 3 Replies
Jun 17, 2011
I have a component that extends UIComponent of Flex, I want to add it a FlexMouseEvent.MOUSE_DOWN_OUTSIDE listener but it does not works. that means I can not capture the event. But when I use PopUpManager to add this component, and then add a FlexMouseEvent.MOUSE_DOWN_OUTSIDE listener, it works fine. Is FlexMouseEvent.MOUSE_DOWN_OUTSIDE only works for pop-up components?
View 1 Replies