Access keysTop, Summary, Constructors,
Instance properties, Event handlersEventLoadVars
| Kind of class: |
class |
| Inherits from: |
LoadVars |
| Classpath: |
org.asapframework.util.forms.EventLoadVars |
| File last modified: |
Monday, 06 November 2006, 08:09:16 |
/*
Copyright 2005 by the authors of asapframework
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import mx.transitions.BroadcasterMX;
/**----------------------------------
This class extends LoadVars to send messages on onData and onLoad.
It keeps a copy of the raw data as received from the server, that can be
accessed in .serverResult, p.e. to check what the server response was
Note: LoadVars uses its toString() to enumerate all properties and send them to the server.
Since this class adds BroadcasterMX properties, these are listed in toString, and therefore
sent to the server. Be aware that no properties to be sent to the server are named the same as
these properties.
>>> Ignore the note above, this has been fixed with ASSetPropFlags (Martijn, 20-12-2004)
*/
class org.asapframework.util.forms.EventLoadVars extends LoadVars {
private var mServerResult:String;
public var broadcastMessage:Function;
public var addListener:Function;
public var removeListener:Function;
function EventLoadVars () {
BroadcasterMX.initialize(this);
// hide new props (we don't want these to be sent!)
_global.ASSetPropFlags( this, ["mServerResult","serverResult"], 1, true );
}
/**
getter for the response of the server. This only contains the parameter list, provided the server response was valid
@returns String
*/
public function get serverResult () : String {
return mServerResult;
}
/**
function called when the returned parameter list has been parsed
@param inSuccess: Boolean that indicates if the server returned a useful parameter list
*/
private function onLoad (inSuccess:Boolean) : Void {
broadcastMessage("onEventLoadVarsLoad", this, inSuccess);
}
/**
function called when the server responds on the request made by the Flash movie
@param inData: String that contains the raw, unparsed parameter list in key-value pairs, undefined if the server returned an error
*/
private function onData (inData:String) : Void {
broadcastMessage("onEventLoadVarsData", this, inData);
mServerResult = inData;
super.onData(inData);
}
}
This class extends LoadVars to send messages on onData and onLoad.
It keeps a copy of the raw data as received from the server, that can be
accessed in .serverResult, p.e. to check what the server response was
Note: LoadVars uses its toString() to enumerate all properties and send them to the server.
Since this class adds BroadcasterMX properties, these are listed in toString, and therefore
sent to the server. Be aware that no properties to be sent to the server are named the same as
these properties.
>>> Ignore the note above, this has been fixed with ASSetPropFlags (Martijn, 20-12-2004)
Constructor
EventLoadVars
function EventLoadVars (
)
Instance properties
addListener
addListener:Function
(read,write)
broadcastMessage
broadcastMessage:Function
(read,write)
mServerResult
private mServerResult:String
(read,write)
removeListener
removeListener:Function
(read,write)
serverResult
serverResult:String
(read)
getter for the response of the server. This only contains the parameter list, provided the server response was valid
Event handlers
onData
private function onData (
inData:String) : Void
function called when the server responds on the request made by the Flash movie
Parameters:
inData:
String that contains the raw, unparsed parameter list in key-value pairs, undefined if the server returned an error
onLoad
private function onLoad (
inSuccess:Boolean) : Void
function called when the returned parameter list has been parsed
Parameters:
inSuccess:
Boolean that indicates if the server returned a useful parameter list