View Full Version : loading flex components through xml
theGuru
04-29-2009, 12:40 PM
How can i load components through xml... whether it should be visible or not.
JeTSpice
04-29-2009, 08:19 PM
you could have a property in the XML, like type="label" and then a switch case on the type
switch(data.type)
{
case("label")
var l:Label = new Label();
addChild(l);
break;
case("Canvas")
var c:Canvas = new Canvas();
addChild(c);
break;
}
this requires that you at least know what all the possible components are going to be.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.