This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/royale-docs.git
commit c55370ba617a295ec7fadd96cb9a9c1d04ff76c4 Author: Josh Tynjala <joshtynj...@apache.org> AuthorDate: Thu Aug 21 15:52:28 2025 -0700 use com.example instead of com.acme --- features/as3/classes-and-functions.md | 6 +++--- features/as3/interfaces.md | 2 +- features/as3/packages.md | 4 ++-- features/as3/reflection-introspection.md | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/features/as3/classes-and-functions.md b/features/as3/classes-and-functions.md index a1900c1..71475bd 100644 --- a/features/as3/classes-and-functions.md +++ b/features/as3/classes-and-functions.md @@ -66,10 +66,10 @@ A common problem in JavaScript is that `this` is lost within functions. ActionSc In Royale, it's generally not recommended to use `this` inside non-instance methods and functions. In fact that compiler will warn you by default if you do. Generally, the only case where it's necessary to use `this` inside a function in Royale is if you need `Object.defineProperty` for some reason, and even that should be very rare. The `org.apache.royale.utils.object` package has a number of utility functions for helping to define properties without using `this`. Namely: `defineGetter` [...] ## Package level functions -You don't need to declare a class to use code. You can have "utility" functions as first class citizens. To create a public function you create a file similar to a class (but name it camel-case). Assuming your file structure is like so: `src/com/acme/doAwesome.as` Inside the file you declare the function like this: +You don't need to declare a class to use code. You can have "utility" functions as first class citizens. To create a public function you create a file similar to a class (but name it camel-case). Assuming your file structure is like so: `src/com/example/doAwesome.as` Inside the file you declare the function like this: ```as3 -package com.acme { +package com.example { public function doAwesome(notSoAwesome:Object):Awesome { return new Awesome( doSomethingComplicatedInTheSamePackage(notSoAwesome) @@ -78,7 +78,7 @@ package com.acme { } ``` -Then `doAwesome()` is available anywhere in your project. Your IDE should `import com.acme.doAwesome` if you use it. +Then `doAwesome()` is available anywhere in your project. Your IDE should `import com.example.doAwesome` if you use it. ## Static classes and singletons One of the cool new features in ActionScript is [private constructors](features/as3/private-constructors). Use that if you have a class that you want to use as static-only class or as a [Singleton](https://en.wikipedia.org/wiki/Singleton_pattern) diff --git a/features/as3/interfaces.md b/features/as3/interfaces.md index 2d9f441..9677dac 100644 --- a/features/as3/interfaces.md +++ b/features/as3/interfaces.md @@ -41,7 +41,7 @@ Interfaces *must* be implemented as classes. You cannot declare an interface for Here's one example ```as3 -package com.acme { +package com.example { public interface IFoo { function get name():String; function set name(name:String):void; diff --git a/features/as3/packages.md b/features/as3/packages.md index 245cace..9499137 100644 --- a/features/as3/packages.md +++ b/features/as3/packages.md @@ -35,10 +35,10 @@ package { } ``` -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: +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/example/MyFoo.as` and the class would look like this: ```as3 -package com.acme { +package com.example { class MyFoo { public function MyFoo() { } diff --git a/features/as3/reflection-introspection.md b/features/as3/reflection-introspection.md index 491ec7b..0aef047 100644 --- a/features/as3/reflection-introspection.md +++ b/features/as3/reflection-introspection.md @@ -47,7 +47,7 @@ Use reflection to find the class of an object. Sets up an alias mapping for serialization/deserialization purposes. The Royale compiler can auto-generate this when using class level metadata, e.g. [RemoteClass(alias='someAlias')] ``` -registerClassAlias("someAlias", com.acme.Foo); +registerClassAlias("someAlias", com.example.Foo); ``` ### getAliasByClass @@ -55,7 +55,7 @@ registerClassAlias("someAlias", com.acme.Foo); Retrieves an alias for a class, based on an alias mapping previously registered with `registerClassAlias`, or possibly using [RemoteClass(alias='someAlias')] metadata. ``` -var alias:String = getAliasByClass(com.acme.Foo); +var alias:String = getAliasByClass(com.example.Foo); trace(alias); // Displays the alias name (i.e. someAlias) ``` @@ -64,7 +64,7 @@ Retrieves a class based on an alias mapping previously registered with `register ``` var classRef:Class = getClassByAlias("someAlias"); -trace(classRef); // Displays the class (i.e. com.acme.Foo) +trace(classRef); // Displays the class (i.e. com.example.Foo) ``` ### getAncestry