Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-29 Thread Alan MacDougall
Micky Hulse wrote: Pedro Taranto wrote: if you want to return diferent types in one function you dont specify any return data type Ah, sounds good to me. I was not sure if it was bad practice to not specify a type. Well, if you want to write strictly, and if you're interested in exactly

Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-29 Thread Micky Hulse
Hi Alan, thanks for reply. Alan MacDougall wrote: Well, if you want to write strictly, and if you're interested in exactly what data type your method returns, you can specify a return type of Object (the parent of every other AS class): Ooooh, nice! Thanks for the code snippet and tips!

Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-28 Thread Micky Hulse
eric e. dolecki wrote: the compiler will point this out for you. I see now. :) Thanks Eric, you have been very helpful. I really appreciate it. Have a great day/night. Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8

Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-28 Thread Micky Hulse
Pedro Taranto wrote: if you want to return diferent types in one function you dont specify any return data type Ah, sounds good to me. I was not sure if it was bad practice to not specify a type. if you wanna use an auxiliary 'object' to use as a reference to another, try to use the same

Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-27 Thread eric e. dolecki
Void or void is used when the method doesn't return a value. function foo ():String { return someString; } so that method returns a string :) I have seen people use void within a method that takes no arguments, like this (but I would never do it): function foo( Void):Void { ... video

Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-27 Thread Micky Hulse
Hey Eric, thanks for the fast reply, I really appreciate the help. eric e. dolecki wrote: Void or void is used when the method doesn't return a value. That make sense. :) So, just to clarify further, if the function returns anything then assign the function (is this called casting a

Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-27 Thread eric e. dolecki
you don't have to type a return type - its mostly for legibility. if you type an argument in a func and send something else, the compiler will catch it.. function foo( nValue:Number ) { // stuff }; foo( aString ); the compiler will point this out for you. On 7/27/07, Micky Hulse [EMAIL

Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-27 Thread Pedro Taranto
if you want to return diferent types in one function you dont specify any return data type function foo () {...} if you wanna use an auxiliary 'object' to use as a reference to another, try to use the same data type ... var auxVideo : Video = myVideo; ... -- Pedro Taranto