One of the most powerful features of the fCMSPro is that is allows you to specify what content you wish to receive from the database. This tutorial will show you how to take advantage of that by building a search facility.
1. Before beginning this tutorial please complete the Basic Tutorial, we will use the resulting file in this tutorial.
2. Open the file you created following the Basic Tutorial and create a new layer below the 'labels' layer. Name it 'Search Facility'.
On the new layer select frame 5 and press F6 to insert a new keyframe.

3. Press Ctrl+F7 (Windows) or Cmnd+F7 (Mac) to open the components panel and drag a copy of the User Interface TextInput component or the 'Bit Component Set' TextInput component onto the stage on the 'Search Facility' layer at frame 5.
With the TextInput component still selected press Ctrl+F3 (Windows) or Cmnd+F3 (Mac) to open the properties panel and give the component the instance name 'searchText' (without the quotes).

4. Drag a copy of the 'User Interface' Button component or the 'Bit Component Set' PushButton component onto the same layer at frame 5.
Position the component next to the TextInput component. With the component still selected open the properties panel and give the component the instance name 'searchButton' (without the quotes).

With the button component still selected press Alt+F7 to open the Component Inspector panel. Set the button's label to "Search".

5. Select frame 5 of the 'actions' layer and press Alt+F9 to open the actions panel. Paste the following code beneath the code that is already there:
listener = new Object();
listener.onSearchButton = function(invokeObj:Object)
{
gotoAndStop("index");
newsIndex.refresh();
}
myCMS.addEventListener("onSearchButton", listener);
This code sets up a function that runs when the 'onSearchButton' event is triggered. It will move the playhead to the "index" label, if it is not already there and in case it is, it calls the fIndex component's refresh method.
Next paste the following code beneath your existing code:
searchButton.onRelease = function(){
var searchObject = {};
searchObject.type = "onSearchButton";
searchObject.query = myCMS.getQuery();
searchObject.query.addFilter("*", "FULL_TEXT", searchText.text);
myCMS.invoke(searchObject);
}
This code sets up a function that will run every time the 'searchButton' is pressed and released. The first line inside the function brackets creates an object. The second line specifies the name of the event to be triggered, in this case 'onSearchButton'. The third line initializes the query. The fourth line uses addFilter to specify what the search should be for. The first parameter of the addFilter method indicates which fields should be searched (an asterisk means all of them), the second parameter indicates that all the text in the field should be searched and the final parameter is the search term, which in this case is whatever value the code finds entered as text in our 'searchText' TextInput component. The final line uses the invoke method to execute the search.
When the button is clicked and this code runs it will search all fields of the database for the word specified in the TextInput field and then move the timeline to the 'index' label and display any results that are found.
6. Press Ctrl+s (Windows) or Cmnd+s (Mac) to save your file. If you have copied your modules folder to the same directory as your .fla you can test your file in Flash, otherwise you will need to publish your files and upload them to your server to test them.
Refer to this article for more information on Boolean Full-Text Searches
Refer to this article a list of reserved words