Rendering form on the fly from XML in flex
Posted
by kartikkowligi
on Stack Overflow
See other posts from Stack Overflow
or by kartikkowligi
Published on 2009-03-10T03:23:46Z
Indexed on
2010/04/12
3:03 UTC
Read the original article
Hit count: 466
Hi, I have an xml code something like this
<root>
<render>
<head>
<transition id="fadeIn" type="fade" subtype="" dur="3s"/>
<transition id="fadeOut" type="fade" subtype="" dur="3s"/>
<layout>
<root-layout width="480px" height="360px" backgroundColor="0"/>
<region id="rootRegion" dur="15s">
<region id="background" soundLevel="100%" top="0px" left="0px" width="480px" height="360px" z-index="0"/>
<region id="foreground" soundLevel="100%" top="0%" left="0%" width="480px" height="360px" z-index="1"/>
</region>
</layout>
</head>
<body>
<par region="background" begin="0s">
<img>
<meta name="assetsource" content="stock"/>
<src>http://s3.amazonaws.com/JivoxStockImage/000003296736.jpg</src>
<width>102.49999999999999%</width>
<height>97.5%</height>
<left>0%</left>
<top>0%</top>
<clipBegin/>
<clipEnd/>
<begin>0s</begin>
<dur>15</dur>
</img>
<audio>
<meta name="assetsource" content="stock"/>
<src>http://audio.mp3</src>
<clipBegin/>
<clipEnd/>
<begin>0s</begin>
<dur>15s</dur>
</audio>
</par>
<par region="foreground" begin="0s">
<img>
<meta name="assettype" content="user"/>
<src>http://image.png</src>
<width>20%</width>
<height>20%</height>
<left>41.5%</left>
<top>25.555555555555557%</top>
<begin>2s</begin>
<dur>10s</dur>
<id>BA6B7CF0BD9080CAD7A02199483224EA61A6E08A</id>
</img>
</par>
</body>
</render>
<form>
<map formId="BA6B7CF0BD9080CAD7A02199483224EA61A6E08A" type="image" label="Logo" />
<map formId="F635A9123082A15834389030382683C55EB29E75" type="text" label="Company Name" />
</form>
</root>
Here I need to match formId in 'form' with that of 'id' in 'render' and create the form dynamically in flex.
I am able to get the xml file via the httpservice. All I need to know is how to match it and render the form dynamically!!
© Stack Overflow or respective owner