My company currently has CFMX7 and we have our objects aliased in
ActionScript and ColdFusion.  I had recently been trying to return the
objects back to ActionScript using the __type__ method, but did not
realize that this was a CF8 feature at first.

I have incorporated this method into our VOs and passing a struct back
from ColdFusion with one key being ['__type__'] = "fully qualified
qualified class name".  When this is returned from ColdFusion to
ActionScript, I then loop over this array of structs and build the AS
VOs dynamically somewhat replicating the "automagic" method that CF8
and LiveCycle both use.  If we ever do switch to CF8, I figure there
would be very little to alter to get us moved over.  However, I ran
into a snag once I returned everything to our calling object.

A coworker of mine wrote a ConcurrentRemoteObject that allows queuing
of remoteobject calls and handles the requests via a static method
call (thus cutting out much of the add/remove event listener,
operation/remote object declaration).  This object is included in a
remote request library which is then included in the project build
path via the source path tab.  When I try to dynamically build the
object I'm checking for __type__, if found, I use getDefinitionByName
create a new class() from this, then set any necessary properties. 
These methods are called in the ConcurrentRemoteObject which does not
(and should not) include every other VO library.

I'm getting the error "ReferenceError: Error #1065: Variable
AddressType is not defined. at global/flash.utils::getDefinitionByName()"
The code it is referring to is:
var classRef:Class = flash.utils.getDefinitionByName(
object['__type__'] ) as Class;
I'm guessing this error is being thrown because there is no reference
to the AddressType library from the remote request library.

Now for my question: does anyone know a method that would allow me to
get around this problem (without having to include references to every
other library, which is not an option)?  Otherwise, I have to include
my 2 object building functions in each library if I want to use them.  

Reply via email to