PDA

View Full Version : small Problem with document class


secretchat2004
10-12-2007, 03:43 PM
hallo,
sorry if my question is a bit too easy for u guys but am new in this fiel. Am doing it for some 2 weeks.

so i a following from:
got a flash file example.fla with a document class file: exampleClass.as

in the example.fla i have following code:
var testingVar = "test is working";

in exampleclass.as:
PACKAGE{
PUBLIC CLASS ....

PUBLIC FUNCTION EXAMPLECLASS(){
TESTFUNC();
}

STATIC PUBLIC FUNCTION TESTFUNC(){
TRACE(testingVar);
}

}
}

this wz a simplified example. so my question is basically hw can i call a variable or a function which is defined in the main fla file from its document class.

wht i noticed is tht if i can the testingVar from the function exapleClass() it works but as soon i want to call it from another function it doesnt work nd i get a error.

so can anyone help my plse, its urgent. I am tired of searching in google. tryied everythng.

thanks in advance
greets

panel
10-12-2007, 03:59 PM
remove static keyword

secretchat2004
10-12-2007, 04:28 PM
thx for the fast reply. nd jeah tht helped :) but nw i am not gettign a error but UNDIFINED.

btw another question: is it possible to call this testingVar from another class file. for example i have got a movieclip in the flash file named testMovie with the class file testMovie.as. so how do i call the testingVar from testMovie.as?

secretchat2004
10-12-2007, 05:41 PM
thread can be closed... problem solved :) ... thx for the fast reply panel :D