Hi James

The answer to your question is yes it is theoretically possible.. whether or
not its supported and whether it will continue to work is another story. The
following is an easy way of doing what you want without Lingo throwing a
script error but it is undocumented and unsupported by Macromedia. Put the
following into a movieScript or adjust for your behaviour:

on mCheckFlashObjectForProp(oFlashObject,symPropName)
  if not(objectP(oFlashObject)) then
    return(false)
  end if
  return(oFlashObject.dbgPropList().getPos(symPropName) > 0)
end mListFlashObject

This will allow you to determine whether a property exists on a flash object
before you call it. It will only work "accurately" on flash objects that are
non movieclips and not associated with a movieClip. ie. It won't work with
objects/movieclip "hybrids" that are created with registerClass. It will
work on a movieClip but only to reveal the presence of core movieClip
properties. You can use it to check for the existance of a property on the
__proto__ property of the movieClip to get at a registerClass
movieClip/object hybrid but that does not reveal any undeclared properties
of the object class (to the best of my knowledge). The data revealed by
dbgPropList will give you the exact same data as that displayed by the
object inspector. If you can't see it in the object inspector then you won't
see it by dbgPropList.

For additional detail, dbgPropList gives you a list of all properties (and
in Flash all methods since methods are properties on an object).

for example:
lets say gTextSO is a sharedObject on the server (remote shared object). It
contains a data object which has a textValue and a code property.

gTextSO.Data.dbgPropList() will return:
[#textValue, #code]
as a linear lingo list which you can then perform lingo list manipulations
on as I did in the handler noted above.

For those interested, dbgPropList will work on more than just flash
objects.. but your mileage may vary and I have not tested beyond
flashobjects. For flashObjects, thus far it does work in Shockwave and it
does work in authoring and projector. No additional xtras or anything seem
to be required. This may not hold true for other object types. This seems to
be the only way I have come up with that seems to traverse the explosion of
property does not exist script errors. If someone has a better method that
is more supported then I'd gladly use it. The only other method that I can
think of would be to create a very small flash movie that contains a number
of accessory methods that might be useful, such as one that traverses any
flash object revealing its properties and so forth. Perhaps an encapsulating
function for typeof as that doesn't seem to work either.

But again dbgPropList is unsupported, undocumented Lingo that you are
advised to use at your own risk as it may disappear from future versions. If
they do make it disappear, I sure as heck hope they implement something that
allows us to get around the lingo script errors that you are seeing James.

I hope this helps you James and I hope I haven't broken any cardinal sins.

Sincerely
Mark R. Jonkman

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to