What are classes ? Methods?? Im new with this …
Classes are bigger than Methods… Classes contains the Methods… Methods are simply just like functions inside the class…
objects / Properties are the variables inside the class… i think… cant remember clearly, please correct me if im wrong…
Classes are objects. You have a constructor which initiates the object with set values, and methods which are functions that handle what that object can do.
An example, you might see a directory object. So you initiate an initial Directory object with a constructor like this:
$path = "some/path/";
$d = new Dir($path);
Now what you can do with that object once it’s initialized is up to the methods:
$d->openDir(); // can open a directory
Whatever gets put into the constructor is available to all the methods. Since in this case a path to the directory was initialized with the constructor, all the methods know that this path exists and can use it. Now what the actual constructor is, it’s a function that is not supposed to return anything (though you see this rule broken). For instance in the case of the directory constructor maybe it just checks to see if it’s a valid directory path, then opens it. So all the methods now have an open directory handle they can use as long as the object is exists.
There are public and private variables declared within an object. In this case the path could be a public variable and the open directory handle could be private (handled only within the class and never accessed from outside the object)
It’s good to learn about. PHP has quite a library base people are working on, PEAR (pear.php.net) GD, for instance. If you do a phpinfo() on your server you can see which classes are compiled with php. But for instance if you see --with-pear as a compile flag that doesn’t mean all the pear classes are installed. You have to do that yourself, or the admins do. I have a script that checks what pear classes are installed on a server, if you want. Example here: http://www.mardala.com/pear_test.php
also, if you really want to learn and make your own classes, although it probably wont be as powerful as PEAR, i would suggest a book… Beginning PHP4. although it has a few pages about classes, it pretty explains them well…
www.phpclasses.org is a great site for getting php classes.
What are classes for in flash… How can they be useful? How you set them?
oh lol… i dunno flash