1

i was just writing some code and wrote :

public Class start extends SimpleButton

I thought this would be 100% right but it gave errors

1071: Syntax error: expected a definition keyword (such as function) after attribute public, not Class.

1084: Syntax error: expecting rightbrace before leftbrace.

I open some previous actionscript and wrote in this one

1084: Syntax error: expecting rightbrace before leftbrace.

So MY QUESTION is that what is the difference between Class and class

Atleast i am sure that for both (class and Class) there is some type of definition

It will be kind of you if you will answer my question

2 Answers2

3

The Class is a type name similar to your classes or SimpleButton. This is special class that is created for each class definition in a program.

See documentation for details http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Class.html

The class is an keyword. You use it for declare your own classes.

Nicolai
  • 5,489
  • 1
  • 24
  • 31
0

Check out this article. Class is a type in AS3 and every object has an instance of Class, similar to Type in some other languages. The lowercase variant is a keyword whereas the camel-case version is an object type. It holds information about functions and fields as well as constructor information.

Will Custode
  • 4,576
  • 3
  • 26
  • 51
  • This is incorrect. In AS3, every object extends `Object`, as with other languages. The `Class` datatype is used to describe actual classes, rather than instances of classes. An instance of a `Class` object has no relation whatsoever to `Class`. – Josh Oct 01 '13 at 18:08
  • Sorry, I misread the document at Adobe and read "Every object is an instance of the Class class" rather than the correct "Every Class object is an instance of the Class class." – Will Custode Oct 01 '13 at 18:14
  • Yeah. Basically, the `Class` datatype allows you to pass around specific Classes as if they were variables. In Flex's `ViewNavigator`, when you want to move to a new `View`, you pass a `Class` object (`newView:Class` is the argument) and the ViewNavigator is what instantiates the object (calling `new newView()`) – Josh Oct 01 '13 at 18:25