Flex :: Custom Components / Events And Scope

Apr 15, 2012

I'm trapping keyboard events on the stage and dispatching custom events through a framework (Mate, though I don't know that this is an important issue), but I'm pretty confused by the scope. The structure is:application (traps keyboard events and dispatches custom event mainPanel (receives dispatched events but mainCalendar (a child element) is null on debugging. Obviously if I try to call a public method on mainCalendar it errors out, even though it's a child of mainPanel. However, mainCalendar is NOT null IF I use FlexGlobals.topLevelApplication.mainPanel.mainCalendar. Outerdocument and parentDocument do not expose mainCalendar either, BTW mainCalendar (a custom component inside mainPanel with public methods. Creation policy is 'all' and it's visible and exists long before I trap any keystrokes at the top level)Could someone take a minute and explain why the mainCalendar is out of scope when mainPanel receives a custom event, even though mainCalendar is a child of mainPanel. Is there a better way to manage the events so I don't have to always address the component via the topLevelApplication?

View 1 Replies


Similar Posts:


Flex :: Bubbling Events Within Custom Components In Flex?

Jan 11, 2010

I am using a custom component within another custom component in a flex mxml application file.Is it possible to bubble events from an inner component to the outer component and handle events in the outer component?

View 3 Replies

ActionScript 3 :: Events Between Spark And Custom Components

Nov 30, 2010

We are building an interface for a game. The interface has a tabbed menu at the bottom of the screen, with each tab displaying different aspects of an object (called a node). When you click on one of these parts, it becomes the focus, and we download it's details in XML, including all it's sub-nodes and parent nodes and then update the tab display accordingly, or at least that's what we'd like to happen.

What we have:
MainInterface.mxml
<s:Application...
<fx:Script>
<![CDATA[
public var currentNode:Node = new Node();
[Code] .....

We tried adding an event listener for "selectNode" to the dashBoard:SkinnableContainer you see see above, but it didn't seem to want to take. We suspect this is because dashBoard is from a spark component and the dispatcher for "selectNode" is on of our own custom components, but we weren't sure... in any case that's what the code assist seemed to indicate as we had to write it in by hand. We're not sure how to pick up the Events in FlashBuilder 4's debugger, so we're having trouble working out where it's going wrong.

Basically, when someone clicks on the label of a child or parent node (that is displayed by the itemRenderer), we want a URLRequest sent to our website, with the url specific to the node clicked on. We then want a URLLoader listening for the return which will update public variable 'currentNode' when xmlDownloaded is called by the loader. If you could clarify how the click event should be dispatched, what should be listening for it then sending the URLRequest and where the URLLoader that is listening for the xml data to return should be that would solve our problems.

View 1 Replies

Flash :: Flex Dynamically Created Components Added To Custom Components

Sep 8, 2009

I am created a dynamically adding a VBox, that contains two images. Into a Custom Component that is derived from UIComponent. The problem is the Vbox that contains the two image is only a really tiny size. I would like the VBox stretch to the size of the two images. This is how I am creating the Vbox....

[Code]...

View 1 Replies

Flex - Invisible Components And Events?

Nov 29, 2010

I have Flex 4 application in which I have one component as top layer which displays something like tooltips, basically user sees "presentation" which explains usage and meaning of the tools "below", sliders, checkboxes, text fields etc. I made this "presentation" using sequences so first tooltip is visible, then becomes invisible, second is visible etc.

I tried to disable mouseChildren, mouseEnabled and other possible parameters which would disable those tooltips from preventing user clicking on some button or checkbox. Obviously those components which render tooltips even tough invisible, are still "clickable".

View 1 Replies

Flex :: Events - Updating External Components From An Action?

Apr 6, 2010

I'm new to Flex and am having trouble understanding Events. I think Events are what I want to use for my situation. I have 2 components, addUser.mxml and listUsers.mxml. I access these from a ViewStack in my main application. When I load listUsers.mxml it shows a list of current users in a datagrid via a HTTPService call. When I add a user using the form on addUser.mxml I would like the datagrid in listUsers.mxml to refresh when I return to that view to show the new user. I've tried several different things with addEventListener and dispatchEvent but can't seem to get it working. Can someone help me with this logic?

[Code]...

View 2 Replies

Flex :: Create Advanced Flex Custom Components Library?

Nov 25, 2011

I want to create a custom component library. the components are customize-able during creation time. means like Accordion or TabNavigator, when we drag and drop the Accordion in flash builder it

<mx:Accordion x="38" y="167" width="200" height="200">
<s:NavigatorContent width="100%" height="100%" label="Accordion Pane 1">
</s:NavigatorContent>

[code]....

View 2 Replies

Flex :: Pass Parameters To Custom Components?

Oct 2, 2009

I am trying to create a component which can receive an additional value from mxml [code]...

View 6 Replies

Flex :: Base Class For Custom Components

Dec 9, 2009

In my flex app I have various custom components done with mxml or actionscript.I want all of them to extend a base-class where I can define properties/event listeners etc.Can someone give me an example how to create that base class and how I can extend it in mxml and actionscript components?

View 3 Replies

Flex :: Creating Custom MXML Components?

Jun 21, 2010

When I define custom propertie in my MXML component, I also want to define a set of possible values of that property to make Flex Builder show then (possible values of the custom property) when I invoke code completion function.

View 2 Replies

Actionscript 3 - Flex :: Click - Outside Event On Custom Components

Jul 18, 2009

Is there a way to write a custom event that gets triggered when the user clicks outside of that custom component instance? Basically anywhere else in the main flex app.

View 2 Replies

Flex - XMLListCollection Properties In Custom Components Always Null?

Dec 11, 2009

I've written the following custom component, SubNavBar.mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" height="100" width="300"
creationComplete="init()">
<mx:Script>

[Code]...

Whenever the trace function runs in init(), the property menuItems returns null. I don't seem to have this problem with other variable types, like Boolean or String. Is this due to the size of the XMLListCollection object? How can I set up this SubNavBar custom component with XMLListCollection property and bind it to a control in the component?

View 2 Replies

Flex :: 4 - Implement A Custom Toolstrip For An App - Inherit Components?

Jul 1, 2010

I am new to Flex programming. I want to implement a custom toolstrip for an app. This tool strip will include a menu bar (or a customized equivalent) to display the common menu items such as File, Edit, etc as well as a search box. It should be flexible enough to include other menu items such as bookmarks, etc in the future. I have been thinking about mx:Group, s:BorderContainer, mx:HBox, but haven't been able to choose between them. And none of them seem espcially suited to my task as they merely specify layout of other objects. Is there any component which has direct support for such functionality. I have also thought about using mx:MenuBar but I don't know if it will be flexible enough to add non-menu items like search box.

View 2 Replies

Actionscript 3 :: Using Image While Creating Custom Components In Flex?

Aug 25, 2010

For my AIR based application I am trying to create a custom component based on canvas which has an image (as shown below).

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100" height="100" cornerRadius="5" borderStyle="solid" borderThickness="2" dropShadowEnabled="true" borderColor="#EDEDE8" dropShadowColor="#dddddd" shadowDistance="5" shadowDirection="center">

[Code].....

As a work around, I am trying to add an creationComplete listener to the canvas in my custom component and used to give titleImage.source = this.path . keep changing the image or when the path of the image fetched using some async call.

View 1 Replies

Flex :: Edit Button Text In Custom Components?

Apr 16, 2011

i have created custom components in flex where i have used a button,i want to change button text when i will use that component in other mmxl file how i can do that?

View 1 Replies

Flex :: Access Objects In Custom Components File In It?

Sep 18, 2011

I am pretty new to flex, specially to mxml part. There are some confusing things for me.[code]...

So question is how do I access that button's properties. I want when something happens in Xyz file, button's (someId) visibility to become false. If Abc.mxml was AS class file then it would be easy, just make object etc., but how to get if it's mxml file.

View 1 Replies

ActionScript 3.0 :: Detect Mouse Events Outside Childs Scope?

Jun 19, 2010

i was wondering how to make a class that is capable of detecting mouse events outside its own stage.

e.g. i want to make a click-drag bar and if i click on the drag button and start to drag, but the mouse exits the drag bar area, it wont pick up mouse_up and wont finish dragging.

i know i could add a listener to global stage and check if the user is dragging, if so, i could stop the drag. But...what i want to do is a class that wouldnt require me any coding withing a parent class.

View 3 Replies

Actionscript 3 :: Flex 4: Window System Development - Can't Use The PopUpManager To Handle Custom Components

Aug 24, 2010

My application will need some windows but I can't use the popUpManager to handle custom components so I'm thinking to implement a new window system. But I still don't know how to merge it with my custom components.

[Code]....

View 1 Replies

Flex :: Write Events For A Custom Component In It?

Jan 4, 2010

I have written a custom component for drawing a circle in Flex. But When I try to write a click event or mouseDown event for that component, it doesn't work.[code]...

The "Hello" Alert is displayed only at a particular point and guess is, at the point, (175,150) the x, y co-ordinates of the circle. But shouldn't it be displayed wherever I click on the MyCircle component?? how to enable it in that way?

Also the mouseDown function doesn't work for MyCircle,but if have the event for the VBox, the Alerts are displayed.

View 2 Replies

Flex :: Dispatching Custom Events From A Validator?

Aug 2, 2011

Basically I am trying to create a string Validator which requests a new language from its controller by dispatching an event upon its creation.

The example below is a straight copy from the Flex3 component explorer - the only diffrence being that I have created the validator as a custom component which dispatches an event upon its creation.

The problem is that my main Application cannot hear the event being dispatched and I don't know why.

Here is the example

MyValidator.as

package components
{
import flash.events.Event;

[Code]...

View 1 Replies

Flex :: Dispatch Custom Events From A Created Class?

Jan 2, 2010

I have an <mx:Application> which contains a <mx:Module>. This module has several child modules. It also has some an instance of a class I have created. I am trying to have a method of this class dispatch an event that can be "heard" by the module and handled. This isn't happening.To be more clear, I am using 'dispatchEvent' to from inside a class method.There is an instance of this class in: mx.core.Application.myapplication.mymodule.myclassIt is the 'myclass.somefunction' that dispatches the event. I have a listener registered in 'mymodule'. Nothing happens when the function/method runs, however.

View 1 Replies

Flash :: Events Not Firing In Custom Flex Component?

Jun 24, 2011

I'm taking my first stab at writing a custom flex 4 component by extending the UIComponent class. Unfortunately, I cannot get the component to respond to any sort of mouse events.I've tried setting mouseEnabled to true is the component, as well as setting mouseChildren to true in the parent (the stage object). It seems whatever I do, my click events can be detected from the stage, but not with the component.Here is my component class:

package components {
import mx.core.UIComponent;
public class DrawCanvas extends UIComponent {

[code]......

View 1 Replies

Actionscript 3 :: Flex: Bubble Events From Custom Classes - Non-UI

Jul 24, 2011

bubble events up a class tree for none-ui components.I have a structure like this:Controller Unit of Work Child Unit 1 (Raise Event)I would like to handle the event raised in Child Unit 1 in the Controller. I've tried to set the bubble property to true but I've read that this only works for UI components.Is there a way to enable this for custom classes that are not UI components?

View 1 Replies

Flex :: Handling Events From Custom Header Renderer In AdvancedDataGrid

Jul 4, 2010

I have to create a custom header for the AdvancedDataGrid component. The custom header must have two buttons in it. The custom renderer must be applied to more than one column.

How I can fire, dispatch and handle events from the custom headers?

View 1 Replies

Flex :: Usage Of Custom Event With Properties... Multiple Events And Single Listener?

Jan 6, 2010

I have multiple items in my app that I would like the user to click on.Some items are completely different classes.The classes dispatch events and then when the events are captured, some modifications are done to the transform properties of a loosely coupled display object.I want two separate classes to dispatch the same type of event, since I already have an image class that draws images based on a given url... I want the classes to dispatch the events, but then I think I want the difference to be detected when the event comes along... i.e., I would like to recognize the 'origin' or 'sub-type' of the event. Some sort of if/then logic would suffice.

View 1 Replies

ActionScript 3.0 :: Associate Custom Class With MovieClip - Variable Scope

Oct 25, 2008

I'm not an experienced Actionscript user so I'm not sure what the normal way to associate a custom class with a movieclip that has been designed in the Flash IDE is. I made a class called Window to control a movieclip called TestWindow. There are some buttons in the movieclip whose
functionality I would like to assign the instance of class Window. How is this supposed to be done? Here's a representation of what I mean. I hope it is sort of clear. My actual problem is that the local variables are outside the scope of the onPress function but I also think there must be some other way of associating classes with movieclips that have been designed in the IDE.

View 3 Replies

Flex - Custom Events In Flex?

Oct 7, 2009

package classes.events
{
import flash.events.Event;
public class ASSEvent extends Event
{
public static const ALERT:String = " Add Alert";

[Code]...

View 2 Replies

Flex Custom Event - Dispatch An Event From Inside Two Nested Components And Receive

Apr 12, 2009

I am having trouble using a custom event in flex. I need to dispatch an event from inside two nested components and receive it in the main application file. The basic set up is a main application file importing a custom "gallery" component.

[Code]..

View 1 Replies

Flex :: MXML Syntax To Assign Properties Of Subcomponents In Custom MXML Components?

Jun 4, 2011

I am working on a custom Flex 4 component which is an aggregation of two existing flex components. I would like to be able to specify my own custom properties for the component as well as access the existing public subcomponent properties via MXML. For instance I might want to adjust the font color or style for the label and text input. toy component which aggregates both a label and a text input:

<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[code]....

View 1 Replies

Flex :: Extending MXML Custom Components Via MXML?

Feb 3, 2011

What I'd like to do: create an MXML component with some children, then extend it via MXML to create a new component with more children, without losing the original set.In other words

create a component bc.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"

[code].....

View 1 Replies







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