Hi Raul,
Thanks for your answer. I want to give the actual picture here. I've an xmlObj from where I get the data (text line). From the xmlObj I get the name of the SWF file which is to be loaded. I've a panel wherein is a map. Here I want to place the SWF file at a particular coordinates in the panel, if only if it is available. And the compiler gives me the error that the object myCity is undefined. As posted by you I've ammended the code and checked. But it is still giving the same error.
My codes goes like this:
public var myCity:SWFLoader = new SWFLoader();
if (findImgSource(xmlObj.area[14].cityId[0]) != null)
{
panelCountry.addChild(myCity);
with (myCity)
{
source="{findImgSource(xmlObj.area[14].cityId[0])}";
x="151";
y="311";
width="50";
height="50";
}
public function findImgSource(imgVal:String):String
{
return "swfs/"+imgVal+".swf";
}
Hope, you've some suggestions on this!