RE: [Flashcoders] To Void or not to void?? That is my question..

2009-07-14 Thread Merrill, Jason
Besides the compiler checking, specifying the return type is also good when you write code - enforces you to return the correct type and code correctly. Also helps apps like FlashDevelop know what the method returns, so great with code-hinting. Jason Merrill Bank of America Global Learni

Re: [Flashcoders] To Void or not to void?? That is my question..

2009-07-14 Thread Joel Stransky
If I remember correctly, in AS2, you need to write a complete function signature including the scope. Try including the scope on the functions that stopped working when you added :Void *public* function fName():Void { gotoAndPlay(2); } You can choose between internal, private, protected or

Re: [Flashcoders] To Void or not to void?? That is my question..

2009-07-14 Thread Eric E. Dolecki
void is good when you compile - if your method does not return something and you try to return something from the method, your compiler will complain which is good: private function foo():void { return true; } // 1051:Return value must be undefined. Also, if you define something being returne

RE: [Flashcoders] To Void or not to void?? That is my question..

2009-07-13 Thread Kerry Thompson
Karl DeSaulniers wrote: > Using AS2. > When is it best to use the :Void ? and what is the difference between > that and :void ? You use void when a function doesn't return anything. In fact, there are some languages, like Pascal and, I believe, Fortran, that have that built in. In Pascal, a funct

Re: [Flashcoders] To Void or not to void?? That is my question..

2009-07-13 Thread Karl DeSaulniers
That is what I figured. Then why would my function not fire the gotoAndPlay when there was a :Void and would when removed?? This isn't a bug is it? I mean were talking about a simple function fName():Void { gotoAndPlay(2); } Not working and a function fName() { gotoAndPlay(2)

Re: [Flashcoders] To Void or not to void?? That is my question..

2009-07-13 Thread Taka Kojima
Let's say I wanted to do something like this... trace("Taka " + getLastName("Taka")); function getLastName(firstName:String):String{ if(firstName == "Taka"){return "Kojima";} else{return "";} } That function returns a String. Having a gotoAndPlay() inside a function is not a return value. Hope

RE: [Flashcoders] To Void or not to void?? That is my question..

2009-07-13 Thread Barry Hannah
ly 2009 4:30 p.m. To: Flash Coders List Subject: Re: [Flashcoders] To Void or not to void?? That is my question.. Thanks for the quick response Taka, So what contitutes a return? I have used the :Void on functions that had a gotoAndPlay() inside it and it didnt work. But if I removed the :Void, i

Re: [Flashcoders] To Void or not to void?? That is my question..

2009-07-13 Thread Karl DeSaulniers
Thanks for the quick response Taka, So what contitutes a return? I have used the :Void on functions that had a gotoAndPlay() inside it and it didnt work. But if I removed the :Void, it did!?! Karl On Jul 13, 2009, at 11:18 PM, Taka Kojima wrote: :Void is AS2, and :void is AS3 The defin

Re: [Flashcoders] To Void or not to void?? That is my question..

2009-07-13 Thread Taka Kojima
:Void is AS2, and :void is AS3 The definition of void is "nothingness: the state of nonexistence"... The syntax of functionName():void{} simply states that the function returns nothing... i.e. there is no return at the end of the function. Although specifying a :void return type is not necessary