Actionscript 3 :: Traverse Through Children Of A UIComponent Class In Flex?

Mar 3, 2011

I am dynamically creating a UI component based on XML templates stored in database. Now I want to access one of the child component of this UIComponent Class. I dont see any children property in this class? How could I possibly traverse through each child comppnent of this class and set its properties according to some logic in code(which I could not do in templates itself).

[Code]...

View 1 Replies


Similar Posts:


Flex :: How To Traverse / Rebuild UIComponent Tree Structure

Jul 21, 2011

I have some kind of UIComponent grouping which may look something like this with the classes "Group" and "Element". Groups can have children and children may be elements or groups again, basically similar to a file system or the str+g group function in several graphics programs. The simplest form of a group is a group with only children which are also the most low level groups in the tree.

The display hierarchy is already existant, i try to persist it to xml.
Group
- element
- Group
- element
- Group
-element
-element
- element
- element

I want to rebuild this structure in an xml-document for persistence. I know how to build an xml document in Flex but not how to (recursively) traverse this n-tree correctly. For getting only the child nodes one could make use of the following algorithm (pseudo code). But somehow I don't understand how to create the xml from this.

walkTree(group) {
children = node.getChildren
if(children != null) {
for(int i=0; i<children.length; i++) {
if(children[i].isGroup()) {
walkTree(group[i]);
} else {
trace(child);
}}}}

View 2 Replies

Flex :: UIComponent Extended Class Isn't Showing UIComponent Extended Class

Aug 18, 2009

I have 1 class (that is extending a UIcomponent) that is representing a component. In that component I create different instances of another class that is also a UIComponent but this class doesn't show up in de first class. I see that it is running and that it has the correct hights but I got the feeling that it doesn't show up with this hights. If I trace I see the width and height is 200 X 200 but there is still nothing visible in my component.

View 1 Replies

Flex :: UIComponent Base Class Not Working

Jan 4, 2010

I have a BaseComponentClass that I am using as the class that all my custom components extend.For some reason, none of my custom components show up at runtime. I am not getting any compile or runtime errors either.I am implementing all the protected UIComponent methods.[code]The Button never shows up at runtime.

View 3 Replies

Actionscript 3 :: Children Of Image Or UIComponent Not Displayed?

Aug 17, 2010

For instance the mx.controls.Image objects are only displayed when i add them directly to the main application object. If i add a "subimage" to the previously created Image object it simply doesnt show.

What I want to do:

var img : Image = new Image;
var subimg : Image = new Image;
img.source = "images/panel.png";

[Code]....

View 1 Replies

ActionScript 3.0 :: Get UIComponent By Id Or Name, The GetChildByName Does Not Return Childrent Of Children

Sep 23, 2009

My application will load an xml file that has the name or id of a UIComponent. Later this will be used to set text or images.
 
This component could be on a panel or a panel in a panel, I am not familiar with flex but in javascript getElementByid would return the element wherever it is on the document (when called on the document). There is no get....Byid in fex and getChildByName does not look in children.For example

<mx:Text name="works" id="works"></mx:Text>    <mx:Panel>        <mx:Panel>            <mx:Text id="noWorkie" name="noWorkie" text="a test"></mx:Text>        </mx:Panel>    </mx:Panel>
this.getChildByName("works"); // worksstage.getChildByName("works"); // returns nullthis.getChildByName("noWorkie"); // returns null
  
Thinking of creating a getElementByid but has to be called from the top element, have no idea what the top element is.
For example this.root does not have a getChildren method to go through nor does stage. Guess I need to find the highest possible Container class starting with this.parent.There must be a "simple" way to do this but all examples I could find would not go from top level to lowest child as javascript would do in document.getElemetByid.

View 7 Replies

Flex :: Handling Multiple UIComponent With Single Skin Class

Aug 4, 2011

I have created a simple mxml file with code as follows:
<s:application..........>
<s:BorderContainer>
<s:SkinnableContainer id="firstRow"/>
<s:SkinnableContainer id="secondRow"/>
<s:SkinnableContainer id="thirdRow"/>
</s:BorderContainer>
</s:application>

Now I want to apply different font size, font color and font type and background color on each row i.e each of the three skinnableContainers.Currently I have defined 3 different skin classes for each of row but I think this is a bad programing. I should create a single skin class for outermost container i.e BorderContainer and any how provide different fonts and background color to all the 3 child containers through that skin class. So, is it possible that I can create single skin class that can provide different decorations to each of the child container.

View 1 Replies

Flash :: UIComponent In Swc - New Instance Doesn't Seem To Construct The Children Arranged On The Layers

Jun 7, 2010

In Flash, if i create a custom Movieclip, and compile it to a SWC, i can use it in .fla files (by linking to the .swc)..

[Code]...

All the arrangement of graphics on the custom movieClip's layers is preserved. If i subclass UIComponent and compile to a swc, I can use the custom Class in my .fla file, but the new instance doesn't seem to construct the children arranged on the layers.

I know that the correct way to make a custom component is to have the two frames, first to specify bounding box, second frame for assets, and that the first graphic in frame 1 is removed at runtime. But i'm not really trying to make a reusable component - i just want to use the UIComponent class (It seems to have some nice extensions to Sprite). As i really want some hand-positioned layers inside the component i figured i could have the bounding box as the first element on frame 1 (knowing that it would be removed), but any other items i put on frame 1 would be preserved - buttons, images, lines, etc.

View 2 Replies

Flex - Access Children Of Children Recursively?

Mar 10, 2010

I have a Canvas which has many components inside it and those again, have many components inside them.

getChildren() returns only the top level children. What is the best way to retrieve all the children (children of children of children and so on).

Well, I sorta know how to do this by iterating through the children, but the code is really messy. I'd prefer to use a nice recursive function. Has anyone written this before? Or is there a Util class to do this?

View 3 Replies

Actionscript :: Add Children To Accordion Children In Flex 4?

Oct 28, 2011

I have an ArrayCollection that is read to generate containers in an accordion programmatically:

<s:ArrayCollection id="_ac_ps">
<fx:Object label="Block and lot" data="_blocklot" searchType="districtblocklot"
info="" />

[code].......

View 1 Replies

Flash :: How To Use UIComponent In Flex?

Oct 9, 2009

I am new to Flash/Flex. I would like to use a Component I created in Flash extending fl.core.UIComponent. How do I use this in Flex? Do I just export it as a swc or do I have to use the Flash Flex 3 kit which will convert it to a UIMovieClip. That does not sound right.

View 2 Replies

Flex :: What Does UIComponent Add To DisplayObject

May 19, 2009

I am trying to understand the interaction between Flex UIComponents and (Flash?) DisplayObjects... But it's not clear to me what the UIComponent class "adds" to DisplayObject. So, what can a UIComponent do that a DisplayObject cannot?

View 2 Replies

IDE :: Acesssing Derived Class Children (stage Instances) From Base Class?

Jul 16, 2009

I'm slightly new to Flash CS3 + AS3 combo, so its more of a lack of practice question. My question stems from the problem described here http:[url].... . Note, its not the same problem, its a new one.The Problem ,So I have multiple library assets (which are on teh stage) and I want to assign similar functionality to all of them.

Attempt 1: So I create the n assets, create a custom class in AS3, link them to Flash CS3 and obviously enough it gives me the error that multiple assets can't be linked to the same class.Obvious enough to understand (well not completely, because from a programmers background it doesn't make sense).

Attempt 2: Same as attempt 1, but instead of linking all the assets to the same class I make the base class the same class, and let the derived class be dynamically created by Flash on compile time.So the linking works, but the problem is, in my base class I have a method which does something (say an tween) on a child of the library asset. So if the assets on the stage/library are called asset1, asset2, asset3 (same name for asset name, class name, id name), each of them has a sub-movieclip called ... say 'foo'. now if I manually wrote a class for each asset, I could do 'this.foo' to play with the sub-movieclip. However since this functionality is in the parent class, I'm unable to do it.

P.S. If you're form a programming/OOP background, its basically a abstract class problem. My Base class knows how to doSomething(), but it needs aSomething, which is defined in the Derived classes. However I found out that AS3 classes don't support virtual(C++ )/abstract (Java) in the true sense of the word (unless I missed some obvious documentation).

View 3 Replies

Flex :: Update UIComponent Size?

Feb 23, 2010

I've created a AS3 class which extends UIComponent so that I can easily add it to my MXML layout. It works fine, but I'm trying to figure out how to update the UIComponent width and height dynamically. I want my super UIComponent to draw a border around the content, so I need get the specific 'content' dimensions in order to do this.

I understand the idea of UIComponent is that you are supposed to specifically set the width and height... but I am literally only extending it so that I am able to use my custom component with MXML easily.Is there a method in which I can get the width and height of a UIComponents 'content'?

View 2 Replies

Flex :: Difference Between UIComponent And Sprite ?

May 23, 2010

What is the difference between a UIComponent and a Sprite in Flex.

View 1 Replies

Flex :: UIComponent Click Handler?

May 27, 2010

I'm trying to put a label and an image on a UIComponent, side-by-side. I want to use UIComponent for efficiency reasons, and the entire component is more complicated than just a button with an icon.

I'm trying to get a click handler on ther entire UIComponent so that when a click happens on either the label or the image, the same [click] event handler is called. If I add a click handler on the root component, it works, but when I introduce space between the label and the image, the space between them becomes un-clickable. I produce the space by using the move(x,y) method for the label and the image with a small gap between the x/y coordinates.

View 3 Replies

Flex :: Change The FusionWidgets UIComponent?

Aug 29, 2010

I'm using the ravis FusionWidgets component in flex to create guages.I have a problem to change a guage in my program.I build an mxml component with the guage like this:"ns1:FusionWidgets id="myGuage" width="{guageWidth}" height="{guageHeight}" FCChartType="{guageType}" FCDataXML="{guageXML}" y="0" x="0"/"when the guageType and the guageXML is the bindable data providers.when I place this component in first time, the providers don't contain nothing and i let the user to change them in my flex application.the problem is that when the user change them, the guage doesn't update itself.I know that when I change a bindable data provider, the component must be changed.

View 1 Replies

Flex :: Nothing Displays When Add UIcomponent To Canvas?

Oct 22, 2010

i am trying to add a uicomponent which contains an object of a custom class the extends UIcomponents and i want to display this uicomponent to canvas i have done no error compile or run time but it does not display the Uicomponent.

here is code;

var item:RecordRanderer = new RecordRanderer();
item.randerItem(child);
item.x=20;

[Code]....

View 2 Replies

Flex :: What Is The NonInheritingStyles Property On The UIComponent For

Nov 10, 2010

What is the nonInheritingStyles property for on the UIComponent?

Is this a list of styles that the component does not inherit from the container?

Or is this a list of styles that have been set inline or in code so the component is just telling me that they are NOT inheriting from the container?

If it's the first why are their values set for this properties?

View 1 Replies

Flex :: Add Uicomponent Inside A Sprite?

Apr 15, 2011

i want to add UIComponent inside a spite. here is the code:

private function make() : void {
var circle : Sprite = new Sprite();
circle.graphics.beginFill(0xFF0000, 0.2);[code]......

the problem is that button is added, but is not displayed. if i do reversed - add sprite to uicomponent - everything works fine, but this way it doesn't work. i tried to use invalidate functions for button etc... even tried making "circle" as UIMovieClip, but no luck - button is still invisible. also if i simply do "addChild( button );" - it is shown,how can i add a button inside a sprite?

View 2 Replies

Flex :: Games - Using Canvas Versus UIComponent?

Oct 10, 2009

For developing simple games with the Flex SDK, what are the consequences of using a Canvas object, versus a UIComponent object, as a drawing surface? Are there performance issues with either one? Are the methods generally the same? Searching around, it seems that most sample code I've found uses UIComponent. Is this just customary, or are there reasons?

I already know one odd difference - I had developed a simple Pong game using:

public class MyGameCanvas extends UIComponent

and then decided to replace UIComponent with Canvas. This caused the line to fail:

[Code]...

However, I have to confirm something, being new to Flex and the various terminology. I'm presuming that people mean I should not be using MXML for games, when they said Flex SDK. Since I thought the Flex SDK was what provided the compiler that generates .swf files. Otherwise, where/how would I even compile AS3?

Assuming that's the case, then my question would be about the suitability of using both MXML and AS3 for (simple) games. Based on what I've read about both, it seemed like the intended use of them was MXML for the interface elements, and AS3 for everything else. Is the overhead that bad for MXML?

View 3 Replies

Flex :: Set Property Of NumericStepper Declared As UIComponent

Mar 9, 2010

I have a NumericStepper declared as a UIComponent:

<![CDATA[
private var component:UIComponent;
component = new NumericStepper();
]]>

I need to change the .maximum value of the NumericStepper but due to the UIComponent not having a .maximum property the following code fails with the error: 1119: Access of possibly undefined property maximum through a reference with static type mx.core:UIComponent.

component.maximum = 11;

how would I define a property in this scenario?

View 2 Replies

Flex :: Adding UIComponent To Both Canvas And Tree

Apr 8, 2010

I currently am trying to add a custom class which subclasses UIComponent to both a tree and a canvas, but when I try to re-order the tree by dragging I get this error:[code]When I do not add the UIComponent to the canvas, this error does not occur, anyone have any knowledge as to why this happens?

View 2 Replies

Flex :: Flash - Custom UIComponent Disappearing?

Aug 3, 2010

Extremely frustrated with this. I've created a simple class that extends the UIComponent. I create an instance of this class in a parent class and utilise the 'addChild' method to add it to the parent. I've overridden the 'updateDisplayList' method of the extended UIComponent to add my own drawing routine using the 'graphics' object.

My problem occurs when I start attempt to change any of the following properties (x , y , width, height) either directly or using 'move' or 'setActualSize' because the UIComponent will no longer display - prior to changing any of these properties the object displays fine. I know the object is still there, the 'updateDisplayList' method is still being called (as I'm calling 'invalidateDisplayList' after each change) and it correctly reports the changes.

View 1 Replies

Flex :: Drag And Drop From Datagrid To Uicomponent?

Aug 10, 2010

I'm trying to drag an item from a datagrid and drop it onto a UIComponet. Basically I just want the UIComponent to know that something has been dropped onto it and allow it to access the data of the dropped item.

I thought just listening for the drop event would do it but it seems not.

I found lots of documentation on dragging from one IList to another but nothing for this.

<mx:UIComponent xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="init(event)" dragDrop="itemDropped(event)">

View 1 Replies

Flex :: Make Custom UIComponent Accessible?

Apr 18, 2011

I added a MXML component in flex and selected the base as UIComponent. I want to make it accessible so that automated testing tools can Access it. I am using TestComplete for automated testing. As TestComplete uses Microsoft Accessibility classes. Now it treat my component as the Graphics.

View 3 Replies

Flex :: Correctly Redraw UIComponent By ValidateNow()

Apr 20, 2011

I'm removing an UIComponent but parts of it last being visible. It redraws only when I move mouse around or something. I tried to do validateNow() on its parent, tried to do setTimeout(validateNow, 100) but it doesn't help. When I call it by setTimeout it seems these artifacts shown more rarely but it doesn't solve a problem in all cases. Please guide me someone to read about validateNow(), how it works and how to make these things correctly.

The code is below:

protected var bubble: SpeechBubble;
// creation
bubble = new SpeechBubble();

[Code]....

View 3 Replies

Flash :: Using DrawLine On UIComponent Object In Flex?

May 1, 2011

I've been trying to draw a series of points using a UIComponent using:

var line : UIComponent = new UIComponent();
...
line.graphics.lineTo(renderPoint.x, renderPoint.y);

[Code]....

The problem is that although I have all renderPoint segments etc. The line never gets drawn or it never gets displayed. I think this might be because of some Flex thing that is not so obvious.

View 1 Replies

Flex :: Override A Protected Method From UIComponent?

May 30, 2011

I want to create a custom button in ActionScript. [code]...

View 2 Replies

Flex :: Parent And Owner Property Of UIComponent

Jun 30, 2011

I'm trying to understand the difference between the owner and parent properties of the UIComponent.

<s:Panel id="panOne" title="Success">
<s:Label id="labOne" text="Hello World!!"/>
</s:Panel>

In the above code, labOne.owner.id returns panOne and labOne.parent.id returns contentGroup.

I understand the owner property refers to the parent container of a component (Label in this case). But what does parent property actually mean? I think it relates to some skin concept which has a with id value of contentGroup.

exact difference between these two?

There is another link in the link provided by you. It explained these two terms very clearly. That link is: Gumbo DOM Tree API - Functional and Design Specification

I have pasted below the best lines from that page.

The parent of a visual element is the container directly in charge of laying it out. The owner of a visual element is the component that logically owns it. If a Button is in a SkinnableContainer, its parent is the contentGroup while its owner is the SkinnableContainer.

View 1 Replies







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