[Extendflash] Problems with ComponentInstance.parameters

Jim Allman jim at ibang.com
Mon Jul 10 13:48:22 BST 2006


On Jul 10, 2006, at 12:08 PM, John Deans wrote:
> I've got a compiled clip and I want to look at its parameters only  
> if it has any defined. I'm finding that when there are no  
> parameters, any attempt to access the property causes the script to  
> silently fail. I know the property's there - but I can't even tell  
> if it's an empty array, or undefined, or something else. Has anyone  
> any ideas? (I'll be happy with any solution that allows me to  
> ignore clips which don't have parameters defined on them).

Try using "typeof( blah )" to see if it exists, before trying to do  
anything else. This returns a string like "number", "object", or  
"undefined". This might give you enough information to back off  
before trying to do something that will cause the script to fail.

A couple of gotchas here: typeof frequently returns "object" when  
you'd expect something more specific, including for arrays and (most  
importantly!) null. But "undefined" is always a distinct value, and  
may be just what you need here.

   =jimA=

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
. . . . . . . . . . . . . . .
Jim Allman
Interrobang Digital Media
http://www.ibang.com/
(919) 649-5760

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.flashguru.co.uk/pipermail/extendflash/attachments/20060710/a95ec24e/attachment.htm


More information about the Extendflash mailing list