public var WebserviceURL:String;
public var service:WebService;
public function accessWebService():void
{
service = new WebService();
WebserviceURL = "http://mywebserver.net/webService.asmx?wsdl";
service.wsdl = WebserviceURL;
service.addEventListener(ResultEvent.RESULT,webServiceResultHandler);
service.loadWSDL();
service.GetCallHistory(username, 1, PageNo);
}
public function webServiceResultHandler(event:ResultEvent):void
{
var result:ArrayCollection = event.result as ArrayCollection;
dgVideoHistory.dataProvider = result;
}
//Recieves a string, checks to see if it is true/false, passes boolean back
function checkBoolean(val:String):Boolean {
if (val.toLowerCase() == "true") {
return true;
} else {
return false;
}
}
/**
Text String Clipper class
author: Blaine Joubert
version: 0.1
modified: 04/08/2009
Adds a ... to the end of a text string if its too long
To use: Import Class then use
var textClip:TextClipper = new TextClipper (cutOffCharLength, textFieldName, textFieldCharLength, textContent)
*/
package {
import flash.display.*;
import flash.text.*;
public class TextClipper extends MovieClip {
//--------------------------------------
// PUBLIC VARIABLES
//--------------------------------------
public var _cutOffCharLength:int
public var _textFieldName:TextField
public var _textFieldCharLength :int
public var _textContent:String
//--------------------------------------
// CONSTRUCTOR
//--------------------------------------
public function TextClipper(cutOffCharLength:int, textFieldName:TextField, textFieldCharLength:int, textContent:String ):void {
_cutOffCharLength = cutOffCharLength;
_textFieldName = textFieldName;
_textFieldCharLength = textFieldCharLength;
_textContent = textContent;
Init();
}
public function Init():void {
if (_textFieldCharLength >= _cutOffCharLength) {
_textFieldName.replaceText(_cutOffCharLength, _textFieldCharLength, "...");
}else {
_textFieldName.text = _textContent
}
}
}
}
public function RemoteService( serviceId:String
, serviceDestination:String
, amfChannelId:String
, amfChannelEndpoint:String
)
{
// Create a runtime Channelset for given Channel ID and Endpoinr URI
var amfChannel:AMFChannel = new AMFChannel(amfChannelId, amfChannelEndpoint);
amfChannelSet = new ChannelSet();
amfChannelSet.addChannel(amfChannel);
// Create the remoteObject instance
this.remoteObject = new RemoteObject(serviceId);
this.remoteObject.channelSet = amfChannelSet;
this.remoteObject.destination = serviceDestination;
this.remoteObject.addEventListener(FaultEvent.FAULT,onRemoteException);
}