Flex :: Recursive Iteration Through Every Component Instance?

Nov 17, 2009

I have various custom component instances in my flex app. I want to loop through them recursively and get their instance Ids. The recursive part is very important to me. I have tried doing this, but it didn't do recursive:

for each (var myItem:* in this.MasterContainer.childDescriptors)
{
trace(myItem.id);
}

View 3 Replies


Similar Posts:


Actionscript 3 :: Recursive Flex View Component?

Sep 15, 2011

I have a Flex component that is a view of a data Object that recursively has a reference to itself.

For example if you had an Employee class that references a boss field of type Person, I'd like to nest the same view for that Boss. This shouldn't be an infinite recursive relationship (e.g. I'd only be viewing the boss field of each object).

I've tried creating an MXML component that references itself but when I run it locks up (seems like it gets into a recursive loop).

Is there anything you can do like includeInLayout conditions that will make sure it doesn't even instantiate that component.

View 3 Replies

Xml :: Flex ListCollection Iteration Concatenating Collected Values?

Dec 29, 2010

I am working in flex builder 3 with an XMLListCollection and have run into this (should be simple) parsing snag...The XMLListCollection Data:

<data>
<term name="NUMBERS">
<alt_form name="1"/>

[code]......

View 3 Replies

Actionscript 3 :: Reloading A Component But Maintaining The Same Instance In Flex?

Jun 14, 2011

I have a canvas component called myCanvas and I instantiated it with

var myCanvasPage:myCanvas = new myCanvas;
this.addChild(myCanvasPage);

Then I want to essentially reload myCanvasPage later on. In effect I want to do this:

this.removeChild(myCanvasPage);
var myCanvasPage:myCanvas = new myCanvas;
this.addChild(myCanvasPage);

except instead of creating a new instance of myCanvas, I want to use the already created instance of myCanvas and essentially reload or re-create it but making sure that the instance name and references to it remain the same.

View 3 Replies

ActionScript 3.0 :: [flex As3]function Non Recursive Call. How?

Feb 3, 2009

So, I create standard AS3 flex project. In constructor goes only start();


rest of functions are basically this:

private start():void { f1();}

private function f1():void { f2();}

private function f2():void { f1();}


And it's standard recursion. SWF either breaks or loops as many times as I tell it. One f calls the other, which calls first... I do not want that.

I want f1 to do some stuff, calls f1 and closes itself. Than f2 works, calls f1 and closes. And so on.

Like having 2 sets of code that loops through.
What's the cleanest way to do that?

View 16 Replies

ActionScript 3.0 :: [flex As3] Function Non Recursive Call?

Sep 2, 2009

I create standard AS3 flex project. In constructor goes only start();

rest of functions are basically this:
private start():void { f1();}
private function f1():void { f2();}
private function f2():void { f1();}

And it's standard recursion. SWF either breaks or loops as many times as I tell it. One f calls the other, which calls first... I do not want that. I want f1 to do some stuff, calls f1 and closes itself. Than f2 works, calls f1 and closes. And so on. Like having 2 sets of code that loops through.

View 1 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

ActionScript 3.0 :: Show Steps Of An Iteration In It?

May 28, 2009

I did an ActionScript 3 version of my old algorithm made in c language to solve the �Tower of Hanoi� puzzle.

The problem is that I knew how to show the intermediary steps in c language but I don�t know how to do that in ActionScript 3.

The below .as file code uses just three disks of successive bigger diameters ( and different colors ) created as MovieClips in Flash which must move from the first peg to the third one, through appropriate moves, in such way that they end up piled up in the same crescent order as they were in the first peg.

The way the code is written just shows the beginning disks position and the end result but not the intermediary steps.

I want this code being capable to show the successive disks positions on the pegs in each step of the process, each time I right-click the mouse.[code]...

View 2 Replies

ActionScript 3.0 :: Pausing A Loop At Each Iteration?

Nov 30, 2009

I'm working on a script and I've run into a coder's writing block so-to-speak. I have an array of twenty object (with attributes). I want to loop through the array and for each object, update some text fields, create a tween, pause, and create another tween (i.e. fade in / fade out). I tried working with the timer class but the for loop, as expected, keeps on rollin' after the function has been called by the listener.

View 10 Replies

Actionscript :: Use For Variable As Parameter And Keep It Different For Each Iteration

Mar 25, 2010

I have a basic for loop to loop through buttons and set some stuff and onPress handlers:[code]However, as I noticed, all buttonsthen link to one and same frame - all point to last i + 1 - Is there any possibility to call gotoAndStop with "static" Number, so in next iteration, it won't change?[code]

View 1 Replies

ActionScript 2.0 :: How To Remember Iteration Numbers

Oct 25, 2008

I have this code.
for (i=1; i<6; i++) {
this.attachMovie("myMovie","unit"+i,i);
this["unit"+i]._x = i*100;
this["unit"+i].onRelease = function() {
trace("Unit number " + i + " was pressed");
};}
I want to trace the number (i) of the button that is pressed. But no matter what button I press, I always get the value '6' on my trace. Isn't there a way to store the a value for i in each movie clip attached?

View 3 Replies

ActionScript 3.0 :: Last Iteration Of A Loop - Buttons

Jul 30, 2009

i have this from as2, where i can create many buttons on stage and loop. then create a function that applys to all the buttons

Code:
for (var i = 1; i <= 3; i++)
{
bt = this["button" + i];

[Code].....

View 3 Replies

Arrays - Make For Each Loop Dynamically Depth Of Iteration?

Mar 24, 2012

I hope I am clear enough. My data set is populated I have

comment:CommentVO;
comment.replies=[comment:CommentVO,comment:CommentVO,comment:CommentVO];
_comments:Array = [comment:CommentVO,comment:CommentVO,comment:CommentVO]

I've correctly populated my _comments Array and the replies array in my CommentVO Obj.

[Code]...

View 3 Replies

ActionScript 2.0 :: Use Iteration To Reference Each Array Name To Pass It Into A Function

Nov 12, 2004

In AS2 I have several arrays constructed like this :

var myArray0:Array=new Array(value,value,value...)
var myArray1:Array=new Array(value,value,value...)
var myArray2:Array=new Array(value,value,value...)
var myArray4:Array=new Array(value,value,value...)
...

What I'm trying to do is use iteration to reference each array name to pass it into a function.

[Code]...

View 2 Replies

ActionScript 2.0 :: Button Component Instance Syntax Error

Jun 18, 2007

I have 3 insances of the button component on stage named 2_btn, 3_btn and 4_btn.They all are broadcasters and have been initialized.I want them to broadcast an event and pass a variable along each time they are pressed.[code]

View 1 Replies

ActionScript 3.0 :: Iteration Through Array Of Complex Data Object On Different Properties?

Sep 27, 2011

I am not sure my title is correct.Is there any 3rd-party library on AS3.0( like STL in C++), can do this: I define my class and use its objects as associative array, for example:

class Company{
var public name;
var public logo;

[code].....

View 7 Replies

ActionScript 3.0 :: Displaying A For Loop Iteration Counter In A Dynamic Text Box?

Jan 26, 2012

I am just learning how to use Flash AS3. I have made a very basic animation that is a circle with a slice in it that grows larger over a couple of seconds until it is about a quarter of the size of the circle. It is designed for my research subjects to watch and follow for range of motion and speed as they complete a leg exercise task. I used a basic for loop in the animation to repeat it 10 times, then a frame appears that says "Set Complete." I would like to add a repetition counter to the screen so that subjects know which rep they are on throughout the animation. I know that I have to use a dynamic text box to do this, but I don't know where to put the script so that the new counter number will appear on the screen after each loop. Here is what I have so far for script:

Action Layer first frame of loop:

var count: Number=0;

Action Layer last frame of loop:
count++;
if(count<=9){

[code]....

View 6 Replies

ActionScript 2.0 :: [MX PRO 2004] For Loop Variable Not Showing Increase On Each Iteration

Feb 22, 2008

I am wondering if anyone has experience this problem before:

[Code]...

I was experiencing some other "strange" behavior so I'm wondering if my code is getting too long. Maybe I'm running into some kind of limit. Has this happened to anyone else? Anyone know of some fixes? The loop is in a _global function, could that be causing a problem? other than that, the code is on line 4420 of the actionscript coding interface.

View 1 Replies

ActionScript 3.0 :: Figure Out The Instance Name Of The Text Area Component In Focus?

Mar 2, 2009

- I have two textArea components on the stage
- I need to figure out what textArea component is in focus when clicking on it

How do i make it so that it can figure out the instance name of the text area component in focus so i can preforme some code? I tried the following code but it doesn't seem to work.

[Code]....

View 3 Replies

Arrays :: Actionscript 3 - Creating A New Array For Eache Iteration Of The Function Call. AS3

Oct 5, 2011

so I have writing a function that returns objects on the stage and puts them into an array. and the function works fine until i call the function on more than one object name, meaning if im in the root class, and I call this function on object1 lets say it will add all the object one's from the stage, but if i call it on object2 it will throw an error, which makes some sense, i guess it means that it is not adding it to a unique array, but im not sure how to do that. would it be a good idea to maybe make a multidimensional array? if that is the case would it be too slow?

[Code]...

View 1 Replies

Flex :: Make A Custom Component Or Extend The List Component For A 2D Top Down View MAP ?

Nov 11, 2010

I'm building a top view 2D map, that it's objects are stored on the server.The kind of objects are 10 and might be a photo, label, button, lists, mix of them or labels with tooltips.The component must request the "areas" that are missing on screen.An area is 1000x1000 px and is cached in flex.To move in the map, will be like in google maps (drag-and-drop).I should be able to have another list and move objects from one to another using drag-an-drop on objects. Ex.: I grab an objects from a list and I move it on this map, I release the mouse button and the item is placed there.Now the problem is: I build a custom component for this trying to emulate the item renderer for performance and recyclage, implement drag-and-drop on objects and request the areas that are missing?

or

I extend the List component from spark and I add some features as multiple kind of itemrenderers and use recycle on them. Of course it must be able to request the missing areas on the screen and cache it's data.Maybe create a custom layout is needed too.What I need is something that must be really fluid, so the lighter this component is, the better.

UPDATE: *There will be not any object over another.

*I will not use hitTest on bitmaps because all bitmaps are wrapped in another component,as they,for now are itemrenderers.

Anyway I already begin to do this using a class that extends the SkinnableDataContainer and a custom layout. As the layout is not like a grid, is sparse, random items at diferent points(x, y).How to get the localX and localY, relative to item renderer and not to the Spark List, from a DragEvent in Flex 4?

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

ActionScript 3.0 :: Flex - Construct A Derived Class Instance From An Existing Base Class Instance?

Jan 22, 2010

I have a base class which is being created via remote_object [RemoteClass alias] from the server.I have other specialized classes that are derived from this baseclass, but serialization with the server always happens with the base class.The base class has meta data that defines what the derived class is, for example

[RemoteClass (alias="com.myco...')]
public Class Base
{

[code]....

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

ActionScript 2.0 :: Flash - Instance Of The DateChooser Component Reads An Xml File Which Houses Info For Homework Assignments

Jun 30, 2004

the situation | an instance of the DateChooser component reads an xml file which houses info for homework assignments and their due dates. if there is a due date, make sure that date is highlighted on the DateChooser component. from what i've been told, the xml file stores urls which will tell if there is s/thing due on a particular date. the xml file | very simple, has an <activity> element with a 'date' attribute, i.e.

[Code]...

my remaining questions | What needs to happen as soon as the xml file is loaded? i.e. do i call a function which parses the xml data and puts it into an array? then the DateChooser component iterates thru the array looking for boolean values noting if there is an activity or not and if so, on which day. if it finds one, it sets its highlight property to true for that particular day. i'm setting up the xml file correctly.

View 11 Replies

ActionScript 2.0 :: Objects - XML - Creating A New Instance Of An Object That Uses An Identical Name To An Older Instance Delete The Previous Instance?

Mar 20, 2009

Does creating a new instance of an Object that uses an identical name to an older instance, delete the previous instance? Or should the original instance be deleted first? The code uses a ridiculous amount of XML vars. Isn't it less memory intensive to parse the XML and save the properties to an Object, and then delete the XML Object, rather than keep the XML Object around and reference it's child nodes directly? Is it better form to break up a huge XML file (>600lines/3200vars) into smaller chunks?

View 1 Replies

Actionscript :: Recursive Function And Returned Value?

Nov 5, 2010

I think I have the recursion working properly, but I'm not able to get the originally requested item's property set to the right value.The goal here is to find the topmost parent (or "ancestor," depth = 0) of the nested item (a taxonomy based on Dictionary "parent" attributes), and assign that originally requested nested item's "ancestor" property accordingly.For instance, in

Apples
- Red
- - Empire
- - - Fresh

"Fresh"'s ancestor should be set to "Apples." While I'm attempting this on an "on-demand" and individual basis, I'm open to a solution that tags all children that are related to the same ancestor in one fell swoop or for statement, since that would probably be more efficient.

REQUEST

for (var mc:Object in taxonomy) {
var term = taxonomy[mc];[code]....

As you can see, while the recursion does find the root, the originally requested item still gets the default value.

View 2 Replies

ActionScript 2.0 :: Recursive XML To Multidimensional Array

Dec 27, 2010

ActionScript Code:
<root>
<node>

[Code].....

create Multidimensional Array from Recursive XML.

All I need create Array inside an Array dynamically from an unknown XML tree.

View 3 Replies

ActionScript 2.0 :: Recursive Function XML Tree

May 3, 2004

im having a problem reading a xml tree in Flash MX...[code]and this Actionscript to just to view the tree.[code]meaning that when it calls itself again, that it will stop searching the next items on the same level from where it was called.how do i not let it stop searching and complete the tree.

View 4 Replies







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