Hi Robert,Thank you for the help. I have got it up and running. However, I have not got it integrated with the config.xml file, it serves my purpose as this is how I need it, as my definition query changes dynamically. Only drawback I see is it the definitionQuery also returns me the layer name which does not contain any information for that state, and this is directly displayed in the TOC. (It would be great if we could eliminate this, and would be great if someone could hint me as how could I proceed).Hope this helps someone.1. I have ArcGISDynamicMapServiceLayer url is the config file as it is.
<layer label="USA" type="dynamic" visible="true"
url="http://............/arcgis/rest/services/USAinfo/MapServer"/>
2. In the MapManager.mxml in the addLayerToMap function where it handles case "dynamic", it was as simple as adding definition query for each layer in the service
dynLayer.layerDefinitions =
[
"state = 'DC''",
"state = 'DC''",
"state = 'DC''",
"state = 'DC''",
"state = 'DC''",
"state = 'DC''",
"state = 'DC''",
]; "state = 'DC''",
Thank you.