Actionscript and Obeject-C have few Data types things in common part 2

Data types are the basic building blocks
of just about object oriented language and Objective-C has a few also

int
can store a positive or negative whole number (in other words a number with no decimal places). The actual size or range of integer that can be handled by the int data type is machine and compiler implementation dependent. Typically the amount of storage allocated to int values is either 32-bit or 64-bit depending on the implementation of Objective-C on that platform or the CPU on which the compiler is running
char
is used to store a single character such as a letter, numerical digit or punctuation mark or space character
float
is used to store floating point values
double
is used to store larger values than can be handled by the float data type. The term double comes from the fact that a double can handle values twice the size of a float
id
The id data type is a general purpose data type that can be used to store a reference to any object, regardless of its type.
BOOL
Objective-C, like other actionscript, includes a data type for the purpose of handling true or false (1 or 0) conditions. Such a data type is declared using either the _Bool or BOOL keywords.
Posted in Uncategorized | Leave a comment

Actionscript and Obeject-C have few Data types things in common

ActionScript primarily consists of “fundamental” or “simple” data types which are used to create other data types.
These data types are very similar across few other object Oriented languages.

ActionScript primitive data types

primitive data types are the basic datatypes that are are usally used to create complex data types

Boolean
-The Boolean data type has only two possible values: true and false or 1 and 0. No other values are valid.
int
-The int data type is a 32-bit integer between -2,147,483,648 and 2,147,483,647.
Null
-The Null data type contains only one value, null. This is the default value for the String data type and all classes that define complex data types, including the Object class.
Number
-The Number data type can represent integers, unsigned integers, and floating-point numbers. The Number data type uses the 64-bit double-precision format as specified by the IEEE Standard for Binary Floating-Point Arithmetic (IEEE-754).
String
-The String data type represents a sequence of 16-bit characters. Strings are stored internally as Unicode characters, using the UTF-16 format. Previous versions of Flash used the UTF-8 format.
uint
-The uint (Unsigned Integer) data type is a 32-bit unsigned integer between 0 and 4,294,967,295.
void
-The void data type contains only one value, undefined. In previous versions of ActionScript, undefined was the default value for instances of the Object class. In ActionScript 3.0, the default value for Object instances is null.

Continue reading

Posted in Actionscript, Codelicous, Object-C | Leave a comment

Objective-C Variable and DataType

Well if we should pick from where we left off, we were talking about how to define variables as you would notice that there are little differences in the way Object-C does this; you would start with the variable type and then you will you will notice the “*” that we will learn to call the pointer (pointer will need some explanation that I will do later) then comes the name that you would like to call your variable; the equal sign followed by the new value

NSSvariableType * myVariable  =  newVariableValue;
Posted in Codelicous, Object-C | Leave a comment

Define a variable and let get started

Just about anybody who have done any sort of programming would know what a variable is, but for the newcomers that are just starting out this one is for you

A variable is a simple means of keeping track of a value in your code. A variable can be defined to hold a constant value that never change, or it could be defined to change as often as necessary to suit your programming needs. The value of a variable can be set during author-time (while you are writing you code), or determined during run-time, like the score in a game.

The Basic syntax when defining a variable in actionscript is

 var  variableName : VariableType  =  newVariableValue ;

var is a keyword in the ActionScript language that tells flash that we are about to create a variable followed by the name that you would like to call the variable, then a colon, followed by the variable type; that I will explain in future posts and then there goes the equal sign that is known as the assignment operator that I will explain in details as we go along . The assignment operator is used to update the variable’s value to the value on the right side of the operator if that sound strange right now in a short while you will understand what this var war is all about.

The final bit in this line of code is a semicolon it is used to terminate code blocks or in this case complete statements, it also help to make you code more human readable.

If you are just starting to learn ActionScript or Object-C; pay close attention to your semicolon missing out one could cause you loads of debugging time, even though there are times when missing out a few will not stop you code from ruining .. it’s allways best to stay on the safe side where programing is concern

/*this is a comment with text that flash will not read
  I will explain "int" in future post
*/
var myVariable:int = 1234;
The Objective-C equivalent would look like this
/*this is a comment with text that the object-c compiler will not read
  I will explain what  this mean in the next post
*/
int myVariable = 1234;

See you at the end of the next post.

Posted in Codelicous | Leave a comment

Hey thanks for dropping by

Hey thanks for dropping by this is the first post so you have not miss any of the codelicous goodness . I have been using Actionscript to create website and animation for quite some time now and it’s always fun, but most of all I enjoying sharing the fun with anyone who is interested in this sort of stuff . You can see some of my design work over by www.goshine-design.co.uk . Creating great animations , websites and images, and keeping them to yourselves are ratter useless so, I encourage each and everyone who have read this post to get out there and show your stuff ..
With the emerging of iPhone and iPad Apps revolutions many are trying to learn the syntax and Apis of the languages that are use to create these mind blowing application that run on these devices; Objective-C has the steepest learning curve, this has cause many to give up learning it .. with flash CS5 promise to compile apps for the iPhone .. but no!!! said Apple noooooo! so what do we do some say F*$%&* Apple but that does not solve the madness of Apple nor the greediness of Adobe, so all those who know Actionscript and need a taste of the Object-C goodness this is your chance to start your journey of a thousand miles with your first foot step..
See you at the end of the next post cheers…

Posted in talk | Leave a comment