Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-17-2010, 01:43 PM   #1
Senior Member
Join Date: Feb 2010
Posts: 180
Default Inquery about Namespace, Class, Packages

I've been reading a bit about classes and namespaces from adobe's live docs AS3 manual

ActionScript Code:

I've noticed that classes & packages themselves are very much similar to a main function in c/c++ where class is the main function and just after the define/declare of package is the import directive of other predefined / user defined class's is similar to the include directive for both c & c++.where header files contain additional information pertaining to xyz information.

Ofcourse import is used when references userdefined class's within Flash/Flex IDE itself.

Then there is the access controllers which in the predefined / user defined class. If the members of that class are not defined explicitly as public, private, protected or internal, then by default they are considered internal which is very much similar to what they call block scope in c/c++ and many other languages.

Where internal is the local scope or variable scope to the code block.
Public would be considered Global scope.

Namesspaces seem to be used as Macro's or Constants even Enum's or Typedef's.

This seems like a very very flexible language to work with, and not that difficult to learn.

I hope I'm on the right track.

Last edited by Artofwork; 02-17-2010 at 01:50 PM.
Artofwork is offline   Reply With Quote
Old 02-17-2010, 02:10 PM   #2
Senior Member
Join Date: Feb 2006
Location: Washington, DC
Posts: 2,812
Send a message via AIM to abeall

Is that an inquiry or a statement? I don't know much about C/C++ but your description of AS3 package/class/namespace sounds like you are on indeed on the right track.

One imortant compiler difference, AS3 import does not actually include the source package (there is an include statement in AS3 which can include a .as file), but rather it more allows the compiler to resolve references and definitions. If there are no references to the imported classes, they don't get compiled. In other words, using import is not enough to make the compiler include that package/class in the .swf, it must actually be referenced somewhere.
Aaron Beall | Flash portfolio | Fireworks extensions | Twitter
abeall is offline   Reply With Quote
Old 02-17-2010, 02:46 PM   #3
Senior Member
Join Date: Feb 2010
Posts: 180

Yes this was an inquiry, sorry if it sounded like a statement, its just how I rationalize things.

Just trying to understand how all this works, with comparison's to other programing language fundamentals.
Artofwork is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 07:19 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.