For, well, pretty much ever, I've worked on the assumption that in this
structure:

function myFunc(tVar:String) {
}

the variable tVar was automatically defined in local scope: that is, I can
write

function myFunc(tVar:String) {
if (tVar == undefined) { tVar = "limpet" }
}

But you know what? That's not true! I've just discovered (and bear in mind,
I've been using that code structure for years) that I have to declare the
variable:

function myFunc(tVar:String) {
if (tVar == undefined) {var tVar:String = "limpet" }
}

That seems really weird to me. Am I wrong? Is there some other explanation?

Danny

_______________________________________________
[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