Chris_C
10-11-2007, 03:18 PM
Ok just say I have this in testFile.as
package {
public class testFile{
var phrase:String;
public function testFile(){
trace ("this part auto runs");
}
public function sayHello(phrase){
trace (phrase);
}
}
}
Now in the .fla file i just do a simple
var testtrace:testFile = new testFile();
testtrace.sayHello("Yarrrrr");
It works perfectly. However when i change the beginning of the .as file to
package anyname{
}
I cant figure out how to get it to work. What is the deal with package names?
I have many books now all which explain all sorts of wonderful things.. except the basics of package names and exactly how to use and reference them in a flash file. The thing that is covered well is when you're sending a movieclip to a class, but theres very little info on text based things like in my little example.
So in the short of please give me a full explanation "in detail" on how to use a class file when the package has a name.
Thanks!
package {
public class testFile{
var phrase:String;
public function testFile(){
trace ("this part auto runs");
}
public function sayHello(phrase){
trace (phrase);
}
}
}
Now in the .fla file i just do a simple
var testtrace:testFile = new testFile();
testtrace.sayHello("Yarrrrr");
It works perfectly. However when i change the beginning of the .as file to
package anyname{
}
I cant figure out how to get it to work. What is the deal with package names?
I have many books now all which explain all sorts of wonderful things.. except the basics of package names and exactly how to use and reference them in a flash file. The thing that is covered well is when you're sending a movieclip to a class, but theres very little info on text based things like in my little example.
So in the short of please give me a full explanation "in detail" on how to use a class file when the package has a name.
Thanks!