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 {

Not working and a

function fName() {


This is why I thought I might be missing something about the :Void.
Maybe its something else in my code, but I don't think so.

Here is the code I am working on:
I took Jiri's advice on fixing the function calls on my tweens,
but it either is not firing the function or not firing the gotoAndPlay.
my first thought was that because the other tweens started working after I made the change to the function call,
that this was a :Void culprit.

var beginAlpha = 0;
var endAlpha = 100;
var quoteShowY:Number = 219.9;
var quoteHideY:Number = -219.9;
this.quoteRequest_mc._x = 354.1;
this.quoteRequest_mc._y = quoteHideY;
this.quoteRequest_mc._alpha = 0;
function formVisible():Void {

function formHidden():Void {

function showForm() {
this.quoteRequest_mc.ySlideTo(quoteShowY,5,"easeincirc",. 5,formVisible);

function hideForm() {

Thanks for taking the time to answer my question everyone.


On Jul 13, 2009, at 11:43 PM, Taka Kojima wrote:

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 that helps.


On Mon, Jul 13, 2009 at 9:29 PM, Karl DeSaulniers <>wrote:

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!?!


On Jul 13, 2009, at 11:18 PM, Taka Kojima wrote:

 :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
nothing... i.e. there is no return at the end of the function.

Although specifying a :void return type is not necessary in AS3, it is
considered best practice to include it. I believe it will generate
if you don't.

In AS2, it really doesn't matter if you do :Void after functions.

The reason this syntax exists is to make it easy for compilers to easily identify problems in regards to object types, i.e. if you're trying to use the return value of a function as a MovieClip when it should really be an Array, or void. It also makes it easier for you to see what type of value
the function is returning just by looking at the top of the function

- Taka

On Mon, Jul 13, 2009 at 9:07 PM, Karl DeSaulniers <

 Using AS2.
When is it best to use the :Void ? and what is the difference between
and :void ?
I have a somewhat understanding of what each are,
I am asking more to "you" (The List) as a programers, what is the best
scenarios to use these things?
What are the advantages and why use them if say, your function works
without them?
I know that the Void is a Boolean, but I also know you cant use it when
statement returns something.
Does this "return" include any of the basics like gotoAndPlay? or does it
literally mean a return(); ???

Thanks for any clarification anyone can give me.


Karl DeSaulniers
Design Drumm

Flashcoders mailing list

Flashcoders mailing list

Karl DeSaulniers
Design Drumm

Flashcoders mailing list

Flashcoders mailing list

Karl DeSaulniers
Design Drumm

Flashcoders mailing list

Reply via email to