Hi
This would be expected behavior that the property would not show up on
the instance when declared as static. The reason for that is relatively
simple. The property doesn't exist on the instance, it exists solely on
the class. While it is possible from within Flash itself to do a little
sidestep to access the class property within the instance for example
if the class property is declared as:
public static var someNumber:Number = 200;
then from within an instance you can access it as:
trace("someNumber = " + someNumber);
outside of the instance you *must* access like this:
trace("MyClass.someNumber = " + MyClass.someNumber);
I prefer to use the MyClass.someNumber access whether I'm inside or
outside of the instance because to me it tells me exactly where the
property is located and therefore prevents any ambiguity from arising.
Not all of my peers would agree with that as a best practise because
Flash allows for the less wordy access.
Since the OI is outside of an instance, it would require the later
access type. Again it comes down to where the property and its value
actually resides.. that is on the class. So if in the OI you got smart
and did something like:
_global.MyClass
you might expect to see a listing of the property (although the
prototype crap in Flash might not neccessarily reveal it easily), you
might need to do something like:
_global.MyClass.someNumber
to see it. Again this isn't a bug in Director or in Flash, its an issue
of knowing the scope of the variable in question.
Finally you might be able to fool the OI into giving you the
information you want if you look at the __proto__ property of the
instance in question.
myInstance.__proto__
or possibly
myInstance.prototype (but I think you want the __proto__ property)
anyhow.. see if that helps..
If you need to access said property from the instance then simply write
a method on the instance that will return the value of the property in
question.
Sincerely
Mark R. Jonkman
----- Original Message -----
From: Thomas Higgins <[EMAIL PROTECTED]>
Date: Monday, September 19, 2005 2:27 pm
Subject: RE: <lingo-l> Dir <--> Flash communication (static)
> > In Director's object inspector, sprite(swfSprite).gTools,
> > when expanded, doesn't show pTrack.
>
> Ok, but can you use Lingo/JS to access pTrack regardless of the OI
> issue? I'm just trying to sort out if this is a OI display bug or if
> this is something more generic that's preventing even code-based
> accessas well.
>
> Cheers,
> Tom Higgins - Technical Product Manager
> Macromedia Director and the Shockwave Player
> http://weblogs.macromedia.com/thiggins/
>
> ...
>
> [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 owner-
> [email protected]). Lingo-L is for learning and helping with
> programming Lingo. Thanks!]
>
[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!]