Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6537335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:36:16+00:00 2026-05-25T10:36:16+00:00

I have the following packages: spark      spark.engine Within spark I have a class

  • 0

I have the following packages:

spark
    spark.engine

Within spark I have a class SeCore; and within spark.engine I have SeStepper and SeKeyboard.

What I’m trying to achieve is have SeCore as being the only class that can create an instance of SeStepper or SeKeyboard. This can be achieved by moving SeCore into the spark.engine package and making the other two classes internal, but I’d like to have SeCore in the spark package if possible.

I’ve tried making my own namespace to handle this, like so:

package spark.engine
{
    import spark.namespaces.spark_core;

    use namespace spark_core;

    spark_core class SeStepper extends SeObject
    {
        //
    }
}

However I get the error:

1116: A user-defined namespace attribute can only be used at the top
level of a class definition.

Are there any other approaches I can take to achieve what I’m after?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:36:16+00:00Added an answer on May 25, 2026 at 10:36 am

    99% of the time, marking anything as ‘internal’ is a bad idea. It’s better to have a naming convention for ‘off-limits’ classes and members, and allow developers to go there at their own risk. Marking things as ‘internal’ or ‘private’ is something that should only be done rarely, and with great forethought.

    However, you could enforce this behavior at run time by using a read-only property in SeCore and checking its value from SeStepper and SeKeyboard.

    Following is pseudocode, haven’t used AS3 in a while.

    In SeCore

    private var _createAuthorized = false;
    public function get CreateAuthorized():boolean {return _createAuthorized;}
    
    private function createSeStepper(){
      _createAuthorized = true;
      var obj = new SeStepper(this)
      _createAuthorized = false;
      return obj;
    }
    

    in SeStepper

    public function SeStepper(core:SeCore){
      if (!core.CreateAuthorized) throw new Error("Only SeCore can do this");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a maven project with the following packages (for illustration only): Root: src/main/java
Suppose I have following code package memoryleak; public class MemoryLeak { public static int
In Scala IDE I have the following code: package pkg.one object S { class
I have the following simple Java code: package testj; import java.util.*; public class Query<T>
i have the following class in C#. using System; using System.Collections.Generic; using Iesi.Collections.Generic; using
Suppose we have following packages in our project org.xxx.dao, org.xxx.service, org.xxx.service.impl all the package
On a fresh Debian system (Squeeze/Sid) I have installed the following packages using apt-get:
I have following HTML markup, <div id=subcontent_l> <p> <a href=/membership-packages/><img height=202 width=644 alt= src=http://74.52.72.231/wp-content/uploads/2010/06/banner1.jpg
I have following class in Java code: public class CHRTreeCreator extends IndexCreator { ...
Let's assume we have following models: from django.db import models class Foo(models.Model): name =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.