You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2021/12/16 13:45:21 UTC

[royale-docs] branch master updated: info about packages

This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new e28234a  info about packages
e28234a is described below

commit e28234aa7f581807f06928e0ae528148f50bf9d6
Author: Harbs <ha...@in-tools.com>
AuthorDate: Thu Dec 16 15:45:13 2021 +0200

    info about packages
---
 _data/toc.json                        |  6 +++++
 features/as3/classes-and-functions.md | 25 ++++++++++++++++++
 features/as3/packages.md              | 50 +++++++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+)

diff --git a/_data/toc.json b/_data/toc.json
index dac3ab8..e907358 100644
--- a/_data/toc.json
+++ b/_data/toc.json
@@ -50,6 +50,12 @@
                     "path": "features/as3.md",
                     "children": [
                         {
+                            "path": "features/as3/packages.md"
+                        },
+                        {
+                            "path": "features/as3/classes-and-functions.md"
+                        },
+                        {
                             "path": "features/as3/code-conventions.md"
                         },
                         {
diff --git a/features/as3/classes-and-functions.md b/features/as3/classes-and-functions.md
new file mode 100644
index 0000000..fdc6f85
--- /dev/null
+++ b/features/as3/classes-and-functions.md
@@ -0,0 +1,25 @@
+---
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+layout: docpage
+title: Classes and Functions
+description: Classes and functions in ActionScript 3
+permalink: /features/as3/classes-and-functions
+---
+
+# Classes and Functions
+
+Classes and functions in ActionScript 3
diff --git a/features/as3/packages.md b/features/as3/packages.md
new file mode 100644
index 0000000..dad6561
--- /dev/null
+++ b/features/as3/packages.md
@@ -0,0 +1,50 @@
+---
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+layout: docpage
+title: ActionScript Packages
+description: Packages in ActionScript 3
+permalink: /features/as3/packages
+---
+
+# ActionScript Packages
+
+Packages in ActionScript 3
+
+Code in ActionScript is structured the same way Java code is structured. Each ActionScript file must declare its package and wrap any externally visible class in the package. A top level package does not need a name. So for a `Foo` class at the top level, it would look like this:
+
+```
+package {
+	class Foo {
+		public function Foo() {
+		}
+	}
+}
+```
+You can name your folder structure any way you like, but an accepted convention is to nest it in a unique domain to prevent potential package conflicts. So for a class `MyFoo` you might have a folder structure like this: `src/com/acme/MyFoo.as` and the class would look like this:
+
+```
+package com.acme {
+	class MyFoo {
+		public function MyFoo() {
+		}
+	}
+}
+```
+
+Always structure your packages, so all classes have a unique qualified path.
+
+[Read more about classes and functions](features/as3/classes-and-functions)
\ No newline at end of file