Karl,

no harm intended, but do yourself and us a favor and get something like Essential Actionscript 3 from Moock, it will save you lots and lots of unnecessary self inflicted punishment :).

That said, AS3 is much more about (strong) typing than AS2 was.
In that line of thinking, you need to specify exactly what types of parameters go into a method/function and what it returns, even if that "what" is nothing.
The type of "Nothing" is this respect is void.

//i return a number
function bla():Number {
    return 10;
}

//i return nothing
function bla():void {
    //im not giving you anything!
    //....
    //implicit return
}

//i return nothing as well
function bla():void {
    //explicit return
    if (myConditionNotMet) return;

    //some other stuff here
    //...
    //implicit return
}

If you go the corporal punishment route, there is some good info here: http://owhips.com/

;)

Best
H



On 19-5-2013 9:34, Karl DeSaulniers wrote:
In place of void?
so like...

function someFunc():Number
{
        //return a number
}

function someFunc():String
{
        //return a string
}

Karl DeSaulniers
Design Drumm
http://designdrumm.com



On May 19, 2013, at 12:26 AM, John R. Sweeney Jr. wrote:

Void was AS2 and wasn't really necessary.

void is AS3 and since it uses strong typing, very necessary. void will not 
return anything. If you want back values (numeric) use Number (text) use 
String, etc.


John R. Sweeney Jr.
Senior Interactive Multimedia Developer
OnDemand Interactive Inc
Hoffman Estates, IL 60169




On May 18, 2013, at 10:15 PM, Karl DeSaulniers wrote:

My first question.

What is the purpose of "void" versus "Void"? When do you use "void" and "Void" and when 
is it not needed or wise to use "void" on a function? I may have asked this a few years ago, but can not find any of 
the emails, so if its a duplicate I apologize.

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to