Try something like this.
<fx:Script>
<![CDATA[
protected function defQry_clickHandler(event:MouseEvent):void
{
var lyrDef:Array = ["", "", "FieldName = '" + textInput.text + "'"];
mapSvc.layerDefinitions = lyrDef;
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:layout>
<s:VerticalLayout gap="10"
horizontalAlign="center"
paddingBottom="20"
paddingLeft="20"
paddingRight="20"
paddingTop="20"/>
</s:layout>
<esri:Map id="Map">
<esri:ArcGISDynamicMapServiceLayer id="mapSvc" url="yourURL"/>
</esri:Map>
<s:TextInput id="textInput"/>
<s:Button id="defQry" click="defQry_clickHandler(event)" label="Click to change layer definition"/>
Good Luck,-Dan