[Extendflash] Problems with ComponentInstance.parameters

John Deans John.Deans at theboardworks.co.uk
Tue Jul 11 12:42:13 BST 2006


Thanks for this. Unfortunately, I can't - as soon as I try to access the
property (even with typeof), my script exits without tracing or alerting
any kind of result. The reason I know it exists is that I can do a
for...in... loop through and read the names of ComponentInstance's
properties - but that's as far as I can go with this particular
property.
 
If anyone has had a similar problem and has overcome it, I'd like to
know. Meanwhile, I think I'm going to add a dummy parameter so that my
array has at least got something in it. 
 
Grr... anyone know if Flash 9 is going to have improved JSFL stability/
bug tracking?

________________________________

From: extendflash-bounces at flashguru.co.uk
[mailto:extendflash-bounces at flashguru.co.uk] On Behalf Of Jim Allman
Sent: 10 July 2006 17:48
To: extendflash at flashguru.co.uk
Subject: Re: [Extendflash] Problems with ComponentInstance.parameters


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/20060711/e11d9e8f/attachment.htm


More information about the Extendflash mailing list