Hi all
I am currently learning AS3, and I seem to be a bit confused on
understanding accessing variables outside of the class it resides in.
for example:
package test {
public class test extends Sprite {
public var hello = hello;
}
}
package test
{
public class test2 extends Sprite
{
var testInstance:test = new test;
trace(testInstance.hello);
}
}
--
Eduardo Omine
http://blog.omine.net/
http://www.omine.net/
___
Flashcoders mailing list
You'd need to instantiate the other class and then access it, like this:
package test {
public class test2 extends Sprite {
public function test2(){
var testInstance:test = new test();
trace(testInstance.hello);
}
}
}
Also, it's good
You'd need to instantiate the other class and then access it,
like this:
That's one way, the other way is to use static variables:
package com
{
class MyClass
{
public static var name:String = Johnny;
//or declare as a public
Ah thanks for all the help everyone.
I'm slowly coming around to classes, as has been confused about when
and when not to use classes and how to access the information from
each other. interesting.
Thanks again :)
On Thu, Jun 12, 2008 at 3:38 PM, Merrill, Jason
[EMAIL PROTECTED] wrote:
You'd
5 matches
Mail list logo