I realized the moment i encountered the problem that dynamically adding a property to an argument was bad form so I went another direction with it (thanks to all who suggested creating a subclass), but I asked the question because I thought it was an interesting problem.
The original function was used to add a unique token to an Object containing a set of arbitrary parameters. ( here's a simplified version ) function (theObject:Object) { theObject.__token = Math.random(); sendVarsToServer(theObject); } In the above function, you get an error if a non-dynamic subclass of Object is passed in. I think the suggestion to use flash.utils.describeType() was probably what I was looking for. Jamie On Jan 7, 2008 1:59 AM, Sunil Jolly <[EMAIL PROTECTED]> wrote: > Have you got an example Jamie? > > Sunil > > > -----Original Message----- > From: Jamie S [mailto:[EMAIL PROTECTED] > Sent: 05 January 2008 01:51 > To: Flash Coders List > Subject: [Flashcoders] How do you tell if an Object is dynamic? > > I ran into a particular situation where i had a function that took an > Object as a parameter. I needed that Object to be an actual Object > i.e. dynamic because the function was going to add properties to it. > But since everything in ActionScript is an Object I had trouble > enforcing this. > > Is there a way to check to see if an Object is dynamic? Or is there a > way to enforce something as an Object rather than a subclass of in > Object (which is everthing else)? > > Jamie > > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders