flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Irnbru <irnbru...@live.com>
Subject Re: How do I to access data from objects created with addElement ?
Date Fri, 01 Aug 2014 18:09:26 GMT
				//*******************************************************************/
				//* We must traverse the Dynamic Form object. This code is not good */
				//* but it works, untill I can find something better                */
				//*******************************************************************/
				//* Start at the Form Level and open a loop to all its elements */
				//***************************************************************/
				for (var i1:int = 0 ;i1 <= siForm.numElements-1;i1++)
				{
					//*******************/
					//* Inside The form */
					//*******************/
					var item:IVisualElementContainer = siForm.getElementAt(i1) as
IVisualElementContainer;

					//***************************************************/
					//* Each Form has a Form Item                       */
					//***************************************************/
					for (var i2:int = 0; i2<=item.numElements-1;i2++)
					{
						//************************/
						//* Inside The form item */
						//************************/
						trace(item.getElementAt(i2));
						
						//*****************************************/
						//* The Form Item has a Custom Component  */
						//*****************************************/
						var comp:IVisualElementContainer = item.getElementAt(i2) as
IVisualElementContainer;
						
						for (var i3:int = 0; i3<=comp.numElements-1;i3++)
						{
							//************************/
							//* Inside the Component */
							//************************/
							trace(comp.getElementAt(i3));
							
							//****************************************/
							//* The Component has a Vgroup Container */
							//****************************************/
							var vgrp1:IVisualElementContainer = comp.getElementAt(i3) as
IVisualElementContainer;
							
							for (var i4:int = 0; i4<=vgrp1.numElements-1;i4++)
							{
								//*********************/
								//* Inside the Vgroup */
								//*********************/
								trace(vgrp1.getElementAt(i4));
								
								//**************************************/
								//* The Vgroup has an Hgroup container */
								//**************************************/
								var hgrp1:IVisualElementContainer = vgrp1.getElementAt(i4) as
IVisualElementContainer;

								for (var i5:int = 0; i5<=hgrp1.numElements-1;i5++)
								{
									//*************************************/
									//* Inside the final container Hgroup */
									//*************************************/
									trace(hgrp1.getElementAt(i5));
									
									//************************************************/
									//* I can finall get to the form inputs YEAH :-) */
									//************************************************/
									var input:UIComponent = hgrp1.getElementAt(i5) as UIComponent;
									trace(input.id);
								}// END for (var i5:int = 0; i5<=hgrp1.numElements-1;i5++)		
							}// END for (var i4:int = 0; i4<=vgrp1.numElements-1;i4++)							
						}// END for (var i3:int = 0; i3<=comp.numElements-1;i3++)
					}// END for (var i2:int = 0; i2<=item.numElements-1;i2++)
				}// END for (var i1:int = 0 ;i1 <= siForm.numElements-1;i1++)



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/How-do-I-to-access-data-from-objects-created-with-addElement-tp7446p7450.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message