With AS2, you can use typeof and instanceof operators, but typeof is only limited to a few classes so you can only test for MovieClip, Button, String, Function & a few others.

You may need to look at stricter typing for your dynamic "objects" and having fixed properties for these rather than just creating them all as Object - try creating a class for these "objects" instead (you can just use public variables/properties and manipulate these directly without resorting to methods, etc). Then the compiler will help you out if you type the argument to the function to this class - you can't really have the loose type checking of AS1 with stricter OOP of AS2 / AS3 - I may be wrong though.

HTH

Glen

Jamie S wrote:
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
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--

Glen Pike
01736 759321
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to