Skip to content

Commit 42e53ea

Browse files
committed
Update
1 parent 7c58e0b commit 42e53ea

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/as3/namespaces.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ ActionScript 3 uses three-dimensional property names: a property consists of a n
77
You can use ActionScript namespaces to privatize definitions across class fields and access them from any package as long as the used namespace is in scope:
88

99
```
10-
// my_lib_internals.as
10+
// MyLibInternals.as
1111
package my.lib {
1212
/**
1313
* @private
1414
*/
15-
public namespace my_lib_internals = "http://my.lib/internals";
15+
public namespace MyLibInternals = "http://my.lib/internals";
1616
}
1717
1818
// Atom.as
@@ -23,7 +23,7 @@ package my.lib.atoms {
2323
/**
2424
* @private
2525
*/
26-
my_lib_internals var x:Number = 10;
26+
MyLibInternals var x:Number = 10;
2727
}
2828
}
2929
@@ -32,5 +32,5 @@ import my.lib.*;
3232
import my.lib.atoms.*;
3333
3434
const atom = new Atom();
35-
trace(atom.my_lib_internals::x);
35+
trace(atom.MyLibInternals::x);
3636
```

src/as3/packages.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,17 @@ import me.diantha.*;
1515
// me.diantha.y
1616
y
1717
me.diantha.y
18-
```
18+
```
19+
20+
## Source tree
21+
22+
It is allowed to define how many items you wish in a source file. However, it is a good practice to keep the source tree the same as the package inheritance:
23+
24+
```
25+
// <project>/src/me/someone/lib/SomeConst.as
26+
package me.someone.lib {
27+
public const SomeConst:decimal = 10;
28+
}
29+
```
30+
31+
This source tree can be used to insert MXML files at the right package.

0 commit comments

Comments
 (0)