| |
AutoCompleter.setDataProvider(array:Array,type:String):Boolean
|
Parameters
array: Array - The Array object that AutoCompleter object should understand as source of data.
type: String - The String value that defines how array should add data to an AutoCompleter object. If there was already some piece of data it could just add new data or replace it. If type equals to "r", data will be replaced. By default, type does not equal to "r".
Description:
setDataProvider() is used to set source of data as Array object to an instance of AutoCompleter object. Method could just add to or replace the content of previous data provider.
Returns:
Boolean - A Boolean value that tell us any data was added, or not.
Usage:
//this will adds content of data1 array as source of data for autoCompleter
autoCompleter.setDataProvider(data1);
//this will replace source of data for autoCompleter with content of data2 array
autoCompleter.setDataProvider(data2,"r");
var data3:Array=new Array("apple", "hockey", "ball");
//as output of the next line we will see: true
trace(autoCompleter.setDataProvider(data3,"r"));
|
AutoCompleter.setXMLDataProvider(url:String,type:String):Void
|
Parameters
url: String - A string that represents the URL where the XML document to be loaded as source of data for AutoCompleter object is located. If the SWF file that issues this call is running in a web browser, url must be in the same domain as the SWF file.
type: String - The String value that defines how xml file, which set in url parameter, should add data to an AutoCompleter object. If there was already some piece of data it could just add new data or replace it. If type equals to "r", data will be replaced. By default, type does not equal to "r".
Description:
setXMLDataProvider() is used to set source of data as .xml file to an instance of AutoCompleter object. Method could just add to or replace the content of previous data provider.
Returns:
No value.
Warning: It takes a certain period of time for the .xml file to be loaded, so to set several data providers you have to wait for this period. So, you should control such situations by yourself, and try to avoid them. Here is the example of situation that may cause some unexpected results:
autoCompleter.setXMLDataProvider("sampleData1.xml");
autoCompleter.setDataProvider(sampleData1);
autoCompleter.setXMLDataProvider("sampleData2.xml");
There is no guarantee that now autoCompleter has as source of data the sum of contents of "sampleData1.xml" file, "sampleData2.xml" file, and "sampleData1" array. Maybe, the size of "sampleData1.xml" file is too large to be loaded before second or third line was called. That's why, there is no guarantee that second or third line was called successfully.
Usage:
//this will adds content of data1.xml file as source of data for autoCompleter
autoCompleter.setDataProvider("data1.xml");
//this will replace source of data for autoCompleter with content of data2.xml file
autoCompleter.setDataProvider("data2.xml","r");
//as output of the next line we will see: true
trace(autoCompleter.setDataProvider("data3.xml","r"));
|
AutoCompleter.setCSSStyle(css:StyleSheet):Void
|
Parameters
css: StyleSheet - The Cascading Style Sheet for AutoCompleter object.
Description:
setCSStyle() is used to set Cascading Style Sheet as StyleSheet object to prompting font of AutoCompleter object.
Returns:
No value.
Usage:
//this will set style.css file as source of Cascading Style Sheet for autoCompleter
var my_styleSheet:StyleSheet = new StyleSheet();
my_styleSheet.onLoad = function(success:Boolean) {
if (success) {
autoCompleter.setCSSStyle(this);
}
}
my_styleSheet.load("style.css");
|
AutoCompleter.setCSS(url:String):Void
|
Parameters
url: String - A string that represents the URL where the CSS document to be loaded as source of Cascading Style Sheet for AutoCompleter object. If the SWF file that issues this call is running in a web browser, url must be in the same domain as the SWF file.
Description:
setCSStyle() is used to set Cascading Style Sheet as .css file to prompting font of AutoCompleter object.
Returns:
No value.
Warning: It takes a certain period of time for the .css file to be loaded, so to set several Cascading Style Sheet providers you have to wait for this period. So, you should control such situations by yourself, and try to avoid them. Here is the example of situation that may cause some unexpected results:
autoCompleter.setCSS("sampleCSS1.css");
autoCompleter.setCSS("sampleCSS2.css");
There is no guarantee that now autoCompleter has as source of Cascading Style Sheet "sampleCSS2.css" file. Maybe, the size of "sampleCSS1.css" file is too large to be loaded before second line was called. That's why, there is no guarantee that second line was called successfully.
Usage:
//this will set style.css file as source of Cascading Style Sheet for autoCompleter
autoCompleter.setCSS("style.css");
|
AutoCompleter.setTextFormat(textFormat:TextFormat):Void
|
Parameters
textFormat: TextFormat - The font format for AutoCompleter object.
Description:
setTextFormat() is used to set font format as TextFormat object to prompting font of AutoCompleter object.
Returns:
No value.
Usage:
//this will set certain prompting font format "sampleTextFormat" for autoCompleter
var sampleTextFormat:TextFormat = new TextFormat();
sampleTextFormat.bold = true;
sampleTextFormat.size = 15;
sampleTextFormat.italic = true;
autoCompleter.setTextFormat(sampleTextFormat);
|
AutoCompleter.addEventListener(listener:Object,eventName:String):Void
|
Parameters
listener: Object - The Cascading Style Sheet for AutoCompleter object.
eventName: String - The Cascading Style Sheet for AutoCompleter object.
Description:
addEventListener() registers a listener object with a component instance that is broadcasting an event with name eventName. When the event occurs, the listener object is notified.
The full list of possible events for AutoCompleter object you will find in Actionscript Events chapter.
Returns:
No value.
Usage:
//this will defines a listener object, and defines the callback function for the onChoosed event
var myListener = new Object();
myListener.onChoosed = function(o: Object) {
trace("It was choosed item "+o.value);
}
autoCompleter.addEventListener("onChoosed", myListener);
|
|