Hey guys, i have a really annoying problem,
so from a new Flash document (AS3) I put in the code:
class SampleClass
{
trace("hello world");
}
But this comes up with an error when it tries to compile,
'Classes cannot be nested'
This means that the class cannot be inside a function etc. doesn't it?
So I did some research, and apparently I have to make a Package as well, so:
Package
{
class SampleClass
{
trace("Hello World");
}
}
But nothing happens, It still says that 'classes cannot be nested'!?!?!?!
So
a. Why is this error happening? (in a new, blank file)
b. How can I fix it?
c. Can you please give me the exact code to place into a new flash file to create a class (EXACTLY)
Iv even tried using the adobe code examples, copying and pasting them in, with the same annoying error :(
Thanks in advance :)
Tags: