Flex :: Child - Access A Component's Grandchildren?

Oct 21, 2010

I need to access topBox's grandchildren and determine whether they're buttons or not. This function belowgrabs topBox's immediate children which are the HBoxes. How do I go one level lower to topBox's grandchildren? Or is the only way to do this is to run this function on each HBox?

for (var i : int =0; i<topBox.numChildren; i++){
var child : DisplayObject = topBox.getChildAt(i);
var myButton:UIComponent = child as UIComponent;

[code].....

View 1 Replies


Similar Posts:


Flex :: How To Access Variable In Parent Component From Child

Sep 18, 2010

I have a public variable set within fx:Script tags in a parent component that I'd like to access directly from a child component. How can I do this? I don't want to pass the variable to the child component (I know how to do this and am currently using this approach). Following is a simplified version of the mxml:

Note: SimpleComp is an HBox with a couple of lists.
<mx:Accordion>
<comp:SimpleComp/>
</mx:Accordion>

View 4 Replies

Flex :: 4 - Null-component - Checking If The Cancel Button Component In The Child Component?

Jun 23, 2011

I have a component "child" which has a cancel button. Now this component is placed in a state called "newChildComp" I also have another component called "parent". In the parent component, i have a button that dispatches an event. Here is the event code:

[Code].....

so, basically,i am checking to see if the cancel button component in the Child component, while i am still in the parent Compoent, was clicked, if it was clicked, call the cancelButtonHandler. The problem is by the time the addNewChild handles the event, that cancel button was still null. My question is how do i solve this without using the itemCreationPolicy on the cancel button?

View 1 Replies

Flex :: SWFLoader - Child Apps Couldn't Access Certain Objects That Were Instantiated By Another Child App?

Aug 23, 2010

i have problem with swfLoader in flex, when i close following code in click method i can easly add many swf to main application

<mx:VBox id="content" width="100%" height="100%" ></mx:VBox>
public function doIT():void
{[code]....

when i close adding those swfs in loop i have the same error, it looks like child apps couldn't access certain objects that were instantiated by another child app, so what can i do?

View 1 Replies

Actionscript 3 :: Flex - Access Component Inside Another Component In MXML?

Sep 3, 2009

I have two components. One is called "InsideComp" and one is called "OutsideComp". OutsideComp has InsideComp as one piece of its component, and in my main MXML file, I have embedded an instance of OutsideComp. How do I access a public variable of InsideComp within my main MXML file?In Actionscript, I could just do something like:OutsideComp.InsideComp.valToChange = 5; But I dont know how to do it in MXML. I know this is probably an easy question.

View 4 Replies

Flex :: Access The One Component Properties Form Other Component With Out Binding?

Sep 21, 2011

I would like to bind two components with out binding and which resides in different MXML.for eg: A.mxml has textinput and B.mxml has a combobox when choose one item in B.mxml selected item should be display in A.mxml textinput.

View 2 Replies

Flex :: Access Component Properties From Extending Component

Jul 29, 2011

I have a component with a public variable declared

[Bindable]
public var mnuSource:String;

When I extend this component, I can reference mnuSource (it compiles) but Runtime complains about the property not being accessible (error 1056).

How do you modify / declare component properties so they are actually available to other components?

View 2 Replies

Flex :: Extending Mxml Component With From Another Mxml Component With Visual Child Supported?

May 18, 2011

I've been trying to create a custom mxml component that extends another custom mxml component (i.e.MyMXMLComponent -> BaseMXMLComponent -> Group). I've been reading that trying to add visual children to MyMXMLComponent caused error with Flex 3 but that's no longer the case with Flex 4.

What I want to know is whether this is a supported/fixed/documented feature of Flex 4? or just some undefined behavior in Flex 4 that may get changed with future updates?

if this is supported and documented feature, does anyone have link pointing to adobe document stating it as such?

View 1 Replies

Flex :: Toggle Viewstack Within Child Component?

Feb 12, 2011

I have a viewstack with two tabs.In one of them there is a data grid shows a list of notes. The other one is includes a form that can edit notes or crates new note. I want the user to be able to add new note or edit existing note when clicks an item in data grid. I mean when user clicks an item the viewstack must become editor.

View 1 Replies

Flex :: Adding A Child To A VBox Component?

Mar 8, 2011

I'm having a problem when adding a child to a VBox component. Is it not the same thing?:

List Item:

<mx:Script>
<![CDATA[
public function addChildren():void {

[Code]....

I am injecting two properties (question and answer) to the FaqItem component from an auxiliar file (using BabelFX) that depends on the id of the FaqItem, but it is only working when I choose the second option. If I use the first option, I get a child but with the text in question and answer fields is empty. I need to use the first option.

View 1 Replies

Flex :: Static / Private Child Component In Mxml?

Oct 14, 2009

Are there any way to declare a child component in mxml which is private/protected or even static? Sure we can do this inside a script tag, but are there any other way?

View 2 Replies

Flex :: Adding MXML Component As Child Of Main App Using AS

Apr 26, 2010

How can I add an MXML component as a child of the main application using ActionScript. It's not possible to instatiate it, is it? Assuming that behind every mxml file stands an actionscrpt3 class, I tried to import it but id didn't show up.

View 1 Replies

Flex :: Put MXML Child Nodes Within A Custom 4 Component?

Nov 27, 2010

Here is an example of a custom component. It is just a box with a title label and a close image (X):

[Code]...

When using the component in an MXML document, I would like to have the "(HEADING TEXT)" replaced with a parameter (should be easy) as well as the "(INSTANCE MXML)" with several labels, text inputs, check boxes, etc. (maybe harder). I have found this script-based method, but I would like a cleaner compile-time solution if one exists.

View 2 Replies

Flex :: Dynamically Initializing A Child Component At Run Time?

Jun 22, 2011

In a current Flex project, i have an issue where a certain child component must be initialized and ready when the user clicks a button. the button is a mouseClick Event.

//mouseClick Event
protected function tableSearch_searchClickHandler(event:MouseEvent):void
{

[code]......

View 1 Replies

Flex :: Does Disabling Parent Component Affect Its Child?

Aug 30, 2011

I have many buttons in HBox. Instead of disabling each button, I've disabled HBox. But I am able to click buttons even though the HBox is disabled. Disabling parent component will not make difference on its child? it shows like disabled but mouse events will generate.

View 1 Replies

Flash :: Flex - Export SWC And Access Child

Mar 15, 2010

I'm creating an actionscript project in Flex Builder. I succeed to export from Flash a SWC file, and to use it succesfully in Flex. I have a good programming background and Flex looks very simple for me, but I have difficult times in flash. I'm trying to achieve something that might be very simple(not for me of course): I create a simple shape in Flash, convert it to symbol. Then I create a TextField. The I select both the elements and convert them to another symbol, and Export it as a movieclip in swc.

In flex I want to change the value from the textfield. How should I do? I'm trying to do:

var t:ExportedMC = new ExportedMC();
t....(what should I write here)

As I mentioned when I open flash I feel like an elephant in a porcelain store. I have 2 questions here: - how to assign a name to the textfield in flash? I'm using CS4. - how to access it as a child in flex?

View 1 Replies

Flex :: Forcing A Child Component To Resize Itself Larger Than Its Container?

Mar 29, 2010

I am creating a component that displays a variable amount of "gauges" (square tiles of content if you will), that is laid out like so:

<HDividedBox id="container">
<VBox id="myComponent">
<HBox id="header">

[code]...

View 1 Replies

Actionscript 3 :: Flex Combobox Child (textInput, Button) Access

Dec 15, 2011

I need to access the combobox child (textinput and button) without creating a customize component. I know the best practice is to create a custom component but still need to access the combobox child like textinput and listen for their event.

View 2 Replies

Flex :: Access Component Id Of One Mxml From Another?

Sep 21, 2009

I have two mxml files. one is main that is application tag mxml file and another is my mxml component file. I have a viewstack in my main mxml whose id is, say, "mainViewStack". Now I want to set selectedChild property of "mainViewStack" from my mxml component file. [code]...

View 4 Replies

Flex :: Access The Datagrid In One Mxml In Another Component?

Oct 9, 2009

I have a datagrid in my mxml file, say, samp.mxml.

<mx:DataGrid id="taskDataGrid" dataProvider="{initDG}" variableRowHeight="true"
editable="true" width="100%" paddingBottom="1" paddingTop="1" height="55" >
<mx:columns>

[code].....

View 3 Replies

Flex :: Access Datagroup's Itemrenederer's Component?

Jun 9, 2010

I have a datagroup where I use a custom itemRenderer with a datagrid inside. What I want is to access each datagroup's itemRenderer's datagrid and get it's dataProviderAll I know is that you can access the ItemRenderer by using myDataGroup.getElementAt(index)

View 1 Replies

Flex :: Advanceddatagrid - Access Component Id's Generically?

Jul 16, 2010

I have some generic functions like copy, paste,etc in an AS file. I want to use them for editing data present in different mxml applications embedded in one application. If I pass the child's component id as a parameter of a function in one of the events, I get the value as either null or the parent app name. But I want the id of the child's component to access the values.

[Code]...

View 1 Replies

Actionscript :: Flex - Access Variable From One Component Into Another?

Jul 18, 2010

I have a main application which has an int variable declared. I want to access this variable in another component which is present in another package. How can I do this?Main.mxml (default package)

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"

[code].....

View 4 Replies

Flex - Access The Top Level Component From Within The Script Tag?

Oct 30, 2010

I have done this many times but can't remember the syntax for the life of me and am obviously asking Google the wrong questions.

[Code]...

I can't give the TitleWindow an id as it's the top level component. How do I access the TitleWindow component from inside the script tag, the 'this' keyword will give me type Object, which one of its properties will give me the title window?

View 1 Replies

Flex :: Access Main Function From Component?

Dec 6, 2010

How do I get "close" button to run runFunction() from within component to outside declaration? FxGlobals.topLevelApplication doesn't seem to be working for this.

<fx:Declarations>
<fx:Component className="MyNativeWindow">
<s:Window>

[Code]....

View 1 Replies

ActionScript 3.0 :: Access Child Vars/functions Without Adding Code To Child?

Mar 11, 2010

I've seen some discussion on how to load a child swf using swfLoader and accessing it's variables but I am wondering if it is possible to do this without adding any code to the child swf.Either accessing public vars or listening for funciton calls would work fine

View 2 Replies

Actionscript 3 :: Access Scrollbar In A Group Component Flex 4?

Jul 22, 2010

This is the setup. I have created a timeline with a playhead. When my playhead is dragged I would like the timeline to scroll with the drag.

So far, the only way I can do this is by setting clipAndEnableScrolling to true. But in this case I lose the scrollbars(not to mention the impact on my view). So what I would like is to set this property to false and dynamically affect the horizontal scrollbar's position, in other words enable scrolling without the clipping.

View 1 Replies

Flex :: Access Items Selected In A Component From The Main App?

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

Flex :: Access A Component Within <fx:Declarations> In A MXML Class?

Dec 20, 2011

Is it possible to access a declared component as an IFactory within an MXML class? I've used this style of declaring factories many times for Skin Parts, but I've never figured out how to access those factories from within the MXML.

Here's an example of what I would expect to work:

<fx:Declarations>
<fx:Component id="labelDisplay">
<s:Label fontSize="12" fontWeight="bold"/>

[Code].....

View 2 Replies

Flex :: Access Items Selected In A Component From The Main App

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







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