August 02, 2004

File Savings With Flash MX Pro Web Service Classes

As you're most likely aware, the new MM V2 components are great but they are a bit bulky. Don't get me wrong, I'm not complaining because I use them all the time....but, they do introduce a good bit of overhead when using them in applications. So this is just a quick note you might aready know but it provides a 15kB file savings when using Web Services.

I've been using the WebServiceConnector component but coding all my service calls and callbacks. So, in it's simplest form they look like this:

import mx.services.*;
var ws:WebService = new WebService("http://url/service?wsdl");
var wsResult:PendingCall = ws.getData();

wsResult.onResult = function(re:ResultEvent):Void {
// data returned successfully
}

wsResult.onFault = function(fe:FaultEvent):Void {
// error retrieving data
}

It turns out they I can just import the WebServiceClasses since I don't need the functionality of the WebServiceConnector component. The WebServiceConnector component adds about 40kB to your application while the classes add only 25kB. If you want to add just the classes then go to:

Window > Other Panels > Common Libraries > Classes

Every little bit helps!

Posted by dennis baldwin at August 2, 2004 11:37 AM
Comments