"Genevieve Young" <[EMAIL PROTECTED]> wrote:

> So what do I do? How do I know which which functions to use? Most of the 
> time this is the confusing part.

Yes, it can seem like an insurmountable task, but stick with it. Confusion and 
frustration are part of the process of learning, but judging by your questions, it 
seems like you are coming very far. You've also got one of the best books and one of 
the best mailing lists to learn from, which is a great advantage.

> >You use properties when you want to encapsulate something--for example, a 
> >particular sprite's screen position.
> 
> 
> Why do you need to encapsulate it? Isn�t a property just a characteristic of 
> the object?

In the case of a sprite's screen position, yes, but you've already seen that code can 
get very confusing. If you had to move dozens of sprites around the screen, it would 
be less confusing if you had some mechanism to only think about one sprite at a time. 
Encapsulation is one such mechanism, and one that many of us here like very much, 
because we are not autistic enough to keep track of hundreds of abstract pieces of 
information at once. Encapsulation allows us to focus, and not get distracted by 
irrelevant things until they become relevant, at which time, the things we were 
looking at before become irrelevant.

> >Globals are used for data that you want to share globally, among all 
> >objects.
> 
> 
> So, am I correct to say that properties are used for individual objects but 
> when they are used by all objects, they become globals?

Not quite. Properties can not become globals. They always belong to objects. Globals 
are globals, whether they are actually used everywhere or not. It's the accessibility 
which makes them global. Properties are only accessible through the object that they 
belong to. If you don't have access to the object, you don't have access to its 
properties either (unless you are passing multiple references to the same objects 
around in some way, which is an advanced technique).

The phenomenon of 'different kinds of accessibility' is more properly known as 'scope'.
 
> Could it then  be compared to local and global variables?

Very much. 'Global' and 'local' are both kinds of scope.

You might say that properties lie somewhere between local and global 'scope'. Whether 
it is closer to global or local depends entirely on the object who 'owns' the 
property. If it's a cast member property, then the scope is very broad, because cast 
members are accessible from everywhere. If it's the property of a list buried deep 
inside some complex game engine, it's quite well hidden - localised, in fact, to that 
list.


> In Special Edition using Macromedia  8,  Pg282,
> the author uses the on exitFrame handler to  loop.  Is this what I should be 
> doing instead?

YES! See my other post for a quick example.

> >>When I use the getPropertyDescriptionList handler, am I going into Object  
> >>Oriented programming?
> >
> >You're heading there.
> 
> At the rate I�m going, it�s going to take me 10,000 light years?

Hmm. What do others think? :)
I'd say you were on the verge of 'getting it', and it's funny to watch, even though 
you're very frustrated. Sorry for smiling.

> I apologize for asking so many questions but I really do not understand.  
> Instead, it is becoming more and more confusing. Where is the light at the 
> end of the tunnel?

Learning is a leaping process, not a stepping process, so sometimes you have to be in 
mid air with your feet dangling, which can be very disorientating.

As children we are used to 'not knowing' and 'not understanding', and that is why it 
is so easy for us to learn at that age. When we become adults, our comprehension of 
reality solidifies. 'Not knowing' and 'not understanding' become uncomfortable, and 
are experienced as frustration and confusion which is why many adults begin to 
stagnate as soon as they think they know enough about the things that are important to 
them. 

In other words, I think you should see that very frustration and confusion you are 
experiencing as exactly the light you seek. It's not always possible to do this, but I 
am pretty sure you have convinced many of those reading this thread that you have the 
determination to emerge triumphant (and probably exhausted) at the other end. Do you 
drink a lot of coffee, by any chance?

When learning object oriented thinking, it's largely a process of finding names for 
things we didn't know we knew, and trusting those discoveries; For example, the word 
'properties'. You know this word in English, and surely understand its use(s) in 
everyday speech, but are apparently not quite seeing the relationship between that 
understanding and what you are learning about lingo. As an exercise, look up 
'property' in an English dictionary, and see if it gets the juices flowing.

Webster's has

"1. That which is proper to anything; a peculiar quality of a thing; that which is 
inherent in a subject, or naturally essential to it; an attribute."

American heritage has

1.
a. Something owned; a possession.
...
4.
a. A characteristic trait or peculiarity, especially one serving to define or describe 
its possessor. 
b. A characteristic attribute possessed by all members of a class.


So a property, in object oriented programming, is something which belongs to an 
object, which describes or characterises it, and perhaps most interestingly, is 
something common to other objects of the same kind, even if they have a different 
value for that property. All sprites have a member property, for example, unless you 
delete the member in the cast, in which case any sprite referring to that deleted 
member is not a 'proper' sprite any more. (Don't do this).

When you use a behavior, you add additional, custom properties to the standard set of 
sprite properties, and any sprites which use that behavior can be considered as being 
of the same 'kind' or 'class'. Sprites without this behavior do not get this property, 
so they are of a different kind - and they behave differently because of that. 



_____________

Brennan Young

Artist, Composer and Multimedia programmer

mailto:[EMAIL PROTECTED]

"If you play a wrong note, play it again twice as loud and everyone will think you did 
it on purpose the first time."

-Thelonious Monk

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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