An instance variable is inside a class, but outside that class's methods. A local variable is inside one of the methods.

 

public class MyClass

{

    var myInstanceVariable:String;

 

    public function myMethod():Void

    {

        var myLocalVariable:String = "Gordon";

        trace(myLocalVariable);

    }

}

 

Questions like this are definitely not silly, but they're questions about object-oriented programming, not about Flex per se. You would face similar issues with other OO programnming environments.

 

- Gordon

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, May 25, 2005 2:31 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Applications forgetting variables

 

Ok assuming your right and again I hope this is not another silly question but what does a local variable look like and what does an instance variable look like? To me I just thought all variables were just like this

public var name:String

you know things like that

 



Yahoo! Groups Links

Reply via email to