I've chaged your code slightly and added comments to help
explain -
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"creationComplete="initApplication();">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
private function initApplication():void
{
// myService is the RemoteObject tag reference id
// once the application creation is complete call
myService.sayHelloQuery() method
this.myService.sayHelloQuery();
}
[Bindable]
public var qResult:ArrayCollection;
}
public function handleQueryResult(event:ResultEvent):void{
qResult=event.result as ArrayCollection;
}
]]>
</mx:Script>
<mx:RemoteObject
id="myService"
destination="ColdFusion"
source="HelloWorld"
showBusyCursor="true"/>
<mx:method name="sayHelloQuery"
result="handleQueryResult(event)"
fault="Alert.show(event.fault.message)"/>
</mx:RemoteObject>
<mx:Button label="get Query Remote Object"
click="myService.sayHelloQuery()"/>
<mx:DataGrid dataProvider="{qResult}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn dataField="hello"/>
<mx:DataGridColumn dataField="world"/>
<mx:DataGridColumn dataField="exclamation"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Application>