XMLConnector.suppressInvalidCalls

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX Professional 2004.

Usage

componentInstance.suppressInvalidCalls

Description

Property; indicates whether to suppress a call if parameters are invalid. If this property is true, the trigger() method does not perform a call if the bound parameters fail the validation. A status event is emitted, with the code InvalidParams. If this property is false, the call takes place, using the invalid data as required.

Example

This example displays an error because the required parameters are not being passed. Drag an XMLConnector component into your library, and enter the following code on Frame 1 of the timeline:

import mx.data.components.XMLConnector;
var xmlListener:Object = new Object();
xmlListener.result = function(evt:Object) {
    trace("results:");
    trace(evt.target.results);
    trace("");
};
xmlListener.status = function(evt:Object) {
    switch (evt.code) {
    case 'Fault' :
        trace("ERROR! ["+evt.data.faultcode+"]");
        trace("\t"+evt.data.faultstring);
        break;
    case 'InvalidParams' :
        trace("ERROR! ["+evt.code+"]");
        break;
    }
};
var myXMLConnector:XMLConnector = new XMLConnector();
myXMLConnector.addEventListener("result", xmlListener);
myXMLConnector.addEventListener("status", xmlListener);
myXMLConnector.direction = "send/receive";
myXMLConnector.URL = "http://www.flash-mx.com/mm/login_xml.cfm";
myXMLConnector.multipleSimultaneousAllowed = false;
myXMLConnector.suppressInvalidCalls = false;
// myXMLConnector.params = new XML("<login username='Mort' password='Guacamole' />");
myXMLConnector.trigger();

Remove the comments from the second to last line of code for the snippet to work correctly.