Flash Remoting.com
Home Book Examples Blog Resources About
Search

You are using an out-of-date browser so the pages will not display properly. Please update your browser.

Random thoughts on Flash Remoting:

This is where I get to ramble when I feel like it. Kind of like a blog, but it's not a blog. This is a blog. ;-).

98 posts.

1/06 | 9/05 | 8/05 | 7/05 | 10/04 | 8/04 | 7/04 | 6/04 | 4/04 | 3/04 | 2/04 | 1/04 | 12/03 | 11/03 | 10/03 | 9/03 | 8/03 | 7/03 | 6/03 | 5/03 | 4/03 | 3/03 | 1/03 | 12/02 | 11/02

ASP.NET ASObject

Tuesday, November 26, 2002 5:54:19 PM

I finally figured out a few things in the ASP.NET version of Flash Remoting. I've been trying to piece together the various implementations of object.RegisterClass() on the server side of things. The ServerSide ActionScript implementation turned out to be the easiest--you basically don't do anything. You simply pass the objects back and forth. The ASP.NET version is not documented very well, but I found that the C# ASObject inherits Hashtable. Hashtable has an Add() method, which is also shown in the example in the Flash Remoting documents. The documents did not describe how to read a property, however. In Java, you would use a get() method. To read a property in C#, I just use the property name:

DateTime myProperty = myObject["myItem"];

You have to also use the correct data types for your properties.

The Hashtable also allows you to iterate through the properties of an object:

IDictionaryEnumerator myEnum = myObject.GetEnumerator();

while (myEnum.MoveNext()) {
Console.WriteLine(myEnum.Key + " : " + myEnum.Value);
}

Some other useful methods of the Hashtable which would be available to the ASObject as well would be:

Checking the Key list:

if(myObject.ContainsKey("myKey")) {
// do something
}

Checking the Value list:

if(myObject.ContainsValue("myValue")) {
// do something
}

Add comment (0)
View comments

Director MX Announced

Monday, November 25, 2002 5:53:44 PM

Director MX was announced today. Director MX allows Flash Remoting to be used in Director applications. This could be very cool. Director is a little over my head because I'm not a designer or animator, but it means more exposure for Flash Remoting, and CF-enabling Director animations.

Add comment (0)
View comments

ColdFusion Error in Docs for ASObject

Saturday, November 23, 2002 12:00:00 AM

One of the coolest features of Flash Remoting is the use of object.registerClass() on the Flash side of things to register a custom class. You can then pass these objects to the server, operate on the object, and return the object to Flash intact with all properties and methods. This was very easy to implement with ServerSide ActionScript, but in CF it turned out to be a little more difficult.

After much trial and error I figured out that the Flash Remoting documentation is wrong. The code listed in the Flash Remoting docs will not work:

<cffunction access="remote" name="getFlashObject">
  <cfobject type="JAVA" class="flashgateway.io.ASObject"
   name="myObj" action="CREATE" >
  <cfset myobj.setType("MyFlashObject")>
  <cfset myobj.put("first", "apple")>
  <cfset myobj.put("second", "banana")>
  <cfreturn myobj>
</cffunction>

The object reference in the above code is only a reference to the class: you can call methods of the class but there is no instance created until you call the init() method of the object. This code will work (changes highlighted):

<cffunction access="remote" name="getFlashObject">
  <cfobject type="JAVA" class="flashgateway.io.ASObject"
   name="MYCLASS" action="CREATE" >
  <cfset myobj = MYCLASS.init()>
  <cfset myobj.setType("MyFlashObject")>
  <cfset myobj.put("first", "apple")>
  <cfset myobj.put("second", "banana")>
  <cfreturn myobj>
</cffunction>

Only after calling init() can you use object.registerClass("MyFlashObject",MyFlashObject) in the ActionScript to keep the class of the return object.

Add comment (0)
View comments

1-5 | 6-10 | 11-15 | 16-20 | 21-25 | 26-30 | 31-35 | 36-40 | 41-45 | 46-50 | 51-55 | 56-60 | 61-65 | 66-70 | 71-75 | 76-80 | 81-85 | 86-90 | 91-95 | 96-98