Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The error is thrown, because you are trying to apply the namespace to your entire class, but user defined namespaces are limited to use with variables and functions ("top level of a class definition" means "elements <em>within</em> a class"). If you're going to say "But that's stupid!" I can only agree with you - it would make much more sense to have namespaces available to classes and interfaces, as well. Still: Those are the rules. :( </p> <p>I also believe your namespace definition isn't done correctly. If you're going to use a namespace for more than a single class, it should be declared in a separate file. Something like:</p> <pre><code>package my_package { public namespace myproject; } </code></pre> <p>in <code>/my_package/myproject.as</code>, and </p> <pre><code>package my_package { internal namespace myproject_internal; } </code></pre> <p>in <code>/my_package/myproject_internal.as</code>. </p> <p>Note that <code>internal</code> in this case specifies the visibility <strong>for the namespace itself</strong>, and not for the functions and variables you are using it with - those will be visible <strong>within the custom namespace</strong> (duh!). If you're going to use an <code>internal</code> namespace, your implementing class has to reside within the same package - otherwise that namespace will not be accessible.</p> <p>See <a href="http://gskinner.com/blog/archives/2010/01/a_complete_guid.html" rel="nofollow">Grant Skinner's blog post</a> for comprehensive info about namespaces.</p> <p>Last, but not least, I would strongly advise against using "parent" as a package name - apart from it being a very ambiguous name, this could easily lead to naming conflicts when used in conjunction with display objects, where <code>parent</code> refers to the actual parent object.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload