Importing user defined classes into other .as files.

sandeep akula sandeep.akula at gmail.com
Mon Jan 14 07:27:51 PST 2008


I am trying to import one class into another class. For example I have

package avmclass
{
    public class A
    {
        public function func()
        {
            trace ("A::func123");
        }
    }
}
I have named this file as "A.as" and kept it in "avmclass" under root
folder.

Then I have created new file "caller.as" in root folder.
The contents of caller.as is

package
{
 import avmclass.A;
var b1 = new avmplus.A();
 b1.func();
}


And I have tried to compile it using
java -jar ../utils/asc.jar -AS3 -import ../core/builtin.abc caller.as

I am not getting any problem while generating .abc file.

But while running using avmplus_sd.exe , I am getting following error

*"ReferenceError #1065: Variable avmclass::A is not defined.
               at global$init"*

I have also tried to compile using
java -jar ../../utils/asc.jar -AS3 -import ../../core/builtin.abc -import
./avmclass/A.abc caller.as

Then also I am getting same Error.

Can anyone know how to do this.


-- 
Thanks & Regards

Sandeep.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/tamarin-devel/attachments/20080114/9f4b8ec5/attachment.html 


More information about the Tamarin-devel mailing list