you shouldn't var any functions even though technically that is correct.

also anything withoug a access keyword is defaulted to private which means
you can only access it from the class.

so to answer your question

public function onEnterFrame():Void
{
//code here
} 
The void means you are not using a return.
if you are doing actionscript 1.0 then technically that is okay...

so something like 

var myFunction = function ()
{
//code here
}

is what you should be using but that is 1.0 and not for classes.  


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of eric cash
Sent: Tuesday, February 06, 2007 7:42 PM
To: [email protected]
Subject: [Flashcoders] var (eventHandler)

Okay, I'm guessing it's a stupid question, so I'll get over it asap.
I've never written a custom class before, and have recently started to code
things in Flash which are much more complex, approaching application status,
so I'm trying to wwrap my head around all of this OOP stuff.  I keep running
into something that I can't get though...  
using the VAR keyword when declaring event handlers, like this example from
Object-Oriented Actionscript for Flash 8:

var onEnterFrame:Function = doSomething;

I've Googled my [EMAIL PROTECTED] off, and I can't get it to save my life, and 
this seemed
like the best place to ask.  Will one of you take a couple minutes out of
your day to help a poor guy out?

Thanks

ec
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to