From bfeaa92866fb922ce1f6d50b83e9e62736fb1df5 Mon Sep 17 00:00:00 2001 From: Fancy2209 <64917206+Fancy2209@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:57:11 -0100 Subject: [PATCH 1/6] Update README.md to mention AS3 more --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa184fd..d1a8bda 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Two Versions There are two versions of OpenFL, the first is primarily distributed using haxelib, and blends native support for Windows, macOS, Linux, iOS, Android, Flash, HTML5 and WebAssembly. You can read more about the haxelib distributed version of OpenFL, [here](https://github.com/openfl/openfl). -The second edition of OpenFL is distributed using NPM, and is designed for use from TypeScript, JavaScript (EcmaScript 5 or 6+) or Haxe, the latter of which can be used in both versions of OpenFL. The NPM version of OpenFL is designed to be used in a browser environment. The NPM version also has (beta) support for ActionScript 3.0. +The second edition of OpenFL is distributed using NPM, and is designed for use from TypeScript, JavaScript (EcmaScript 5 or 6+), ActionScript 3 (using [Apache Royale](https://royale.apache.org) or Haxe, the latter of which can be used in both versions of OpenFL. The NPM version of OpenFL is designed to be used in a browser environment. The NPM version also has (beta) support for ActionScript 3.0. Getting Started @@ -31,7 +31,7 @@ cd NewProject yo openfl ``` -You will have the opportunity to choose TypeScript, Haxe, ES6 or ES5 as the source language for your new project. +You will have the opportunity to choose TypeScript, Haxe, ES6, ES5 or AS3 as the source language for your new project. The template project will include configuration files for Webpack, as well as a source code entry point where you can begin writing a new project. In order to begin using OpenFL, you can try adding support for loading and displaying an image (_[continued below](#displaying-a-bitmap)_). @@ -249,6 +249,32 @@ var App = function () { } ``` +## ActionScript 3 (Royale) +At the top of the file, add new imports: + +```actionscript +import openfl.display.Bitmap; +import openfl.display.BitmapData; +``` + +Then extend the `new` method so it looks like this: + +```actionscript +public function new () { + + super (); + + BitmapData.loadFromFile ("openfl.png").onComplete (function (bitmapData) { + + var bitmap = new Bitmap (bitmapData); + addChild (bitmap); + + }); + +} +``` + + ## Running the Project You can start a development server by going to the root directory of your project, and running `npm start`. In addition to compiling your application, it will open a new window in your web browser, with hot reloading enabled. This means that if you edit the `app.ts`, `app.js` or `App.hx` source file, the server will automatically compile your changes, and reload the current window, speeding up development. Now we can making more changes. From e5eb3135c6cd9a9095fa40356f075d050b62bea8 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 23 Feb 2024 09:03:54 -0800 Subject: [PATCH 2/6] README: fix AS3 code and remove duplicate mention of AS3 in a single paragraph --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d1a8bda..ee6fef9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Two Versions There are two versions of OpenFL, the first is primarily distributed using haxelib, and blends native support for Windows, macOS, Linux, iOS, Android, Flash, HTML5 and WebAssembly. You can read more about the haxelib distributed version of OpenFL, [here](https://github.com/openfl/openfl). -The second edition of OpenFL is distributed using NPM, and is designed for use from TypeScript, JavaScript (EcmaScript 5 or 6+), ActionScript 3 (using [Apache Royale](https://royale.apache.org) or Haxe, the latter of which can be used in both versions of OpenFL. The NPM version of OpenFL is designed to be used in a browser environment. The NPM version also has (beta) support for ActionScript 3.0. +The second edition of OpenFL is distributed using npm, and is designed for use from TypeScript, JavaScript (EcmaScript 5 or 6+), ActionScript 3 (using [Apache Royale](https://royale.apache.org) or Haxe, the latter of which can be used in both haxelib and npm versions of OpenFL. The NPM version of OpenFL is designed to be used in a web browser environment. Getting Started @@ -257,16 +257,16 @@ import openfl.display.Bitmap; import openfl.display.BitmapData; ``` -Then extend the `new` method so it looks like this: +Then extend the `App` constructor so it looks like this: ```actionscript -public function new () { +public function App () { super (); - BitmapData.loadFromFile ("openfl.png").onComplete (function (bitmapData) { + BitmapData.loadFromFile ("openfl.png").onComplete (function (bitmapData:BitmapData):void { - var bitmap = new Bitmap (bitmapData); + var bitmap:Bitmap = new Bitmap (bitmapData); addChild (bitmap); }); From d0cbfd4cf7641690e79dbbd10be846228fff0780 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 23 Feb 2024 09:04:22 -0800 Subject: [PATCH 3/6] README: missing paren --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee6fef9..e0a8e15 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Two Versions There are two versions of OpenFL, the first is primarily distributed using haxelib, and blends native support for Windows, macOS, Linux, iOS, Android, Flash, HTML5 and WebAssembly. You can read more about the haxelib distributed version of OpenFL, [here](https://github.com/openfl/openfl). -The second edition of OpenFL is distributed using npm, and is designed for use from TypeScript, JavaScript (EcmaScript 5 or 6+), ActionScript 3 (using [Apache Royale](https://royale.apache.org) or Haxe, the latter of which can be used in both haxelib and npm versions of OpenFL. The NPM version of OpenFL is designed to be used in a web browser environment. +The second edition of OpenFL is distributed using npm, and is designed for use from TypeScript, JavaScript (EcmaScript 5 or 6+), ActionScript 3 (using [Apache Royale](https://royale.apache.org)) or Haxe, the latter of which can be used in both haxelib and npm versions of OpenFL. The NPM version of OpenFL is designed to be used in a web browser environment. Getting Started From 25ba6398610ee02dd856fb6f177ba22168a766aa Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 23 Feb 2024 09:05:11 -0800 Subject: [PATCH 4/6] README: clarify where AS3 imports go --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0a8e15..38a73e0 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ Next, use Visual Studio Code or another code editor to open "src/app.ts", "src/a ## TypeScript -At the top of the file, add new imports: +At the top of the file's `package` block, add new imports: ```typescript import Bitmap from "openfl/display/Bitmap"; From b34eb9db6a042c91b15456cf2e6d811aad3c02bf Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 23 Feb 2024 09:05:54 -0800 Subject: [PATCH 5/6] README: last commit edited the wrong section --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 38a73e0..7508a49 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ Next, use Visual Studio Code or another code editor to open "src/app.ts", "src/a ## TypeScript -At the top of the file's `package` block, add new imports: +At the top of the file, add new imports: ```typescript import Bitmap from "openfl/display/Bitmap"; @@ -250,7 +250,8 @@ var App = function () { ``` ## ActionScript 3 (Royale) -At the top of the file, add new imports: + +At the top of the file's `package` block, add new imports: ```actionscript import openfl.display.Bitmap; From 790ca7fa3e92225baee1258abe6641941eb0ba7d Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 23 Feb 2024 09:07:01 -0800 Subject: [PATCH 6/6] README: npm isn't supposed to be capitalized --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7508a49..e3a6b00 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![MIT License](https://img.shields.io/github/license/openfl/openfl.svg?style=flat)](LICENSE.md) [![NPM Version](https://img.shields.io/npm/v/openfl.svg?style=flat)](http://npmjs.com/package/openfl) [![CDNJS version](https://img.shields.io/cdnjs/v/openfl.svg?style=flat)](https://cdnjs.com/libraries/openfl) [![Haxelib Version](https://img.shields.io/github/tag/openfl/openfl.svg?style=flat&label=haxelib)](http://lib.haxe.org/p/openfl) [![Build Status](https://img.shields.io/github/actions/workflow/status/openfl/openfl-js/main.yml?branch=develop)](https://github.com/openfl/openfl-js/actions) [![Discord Server](https://img.shields.io/discord/415681294446493696.svg?logo=discord)](https://discordapp.com/invite/tDgq8EE) +[![MIT License](https://img.shields.io/github/license/openfl/openfl.svg?style=flat)](LICENSE.md) [![npm Version](https://img.shields.io/npm/v/openfl.svg?style=flat)](http://npmjs.com/package/openfl) [![CDNJS version](https://img.shields.io/cdnjs/v/openfl.svg?style=flat)](https://cdnjs.com/libraries/openfl) [![Haxelib Version](https://img.shields.io/github/tag/openfl/openfl.svg?style=flat&label=haxelib)](http://lib.haxe.org/p/openfl) [![Build Status](https://img.shields.io/github/actions/workflow/status/openfl/openfl-js/main.yml?branch=develop)](https://github.com/openfl/openfl-js/actions) [![Discord Server](https://img.shields.io/discord/415681294446493696.svg?logo=discord)](https://discordapp.com/invite/tDgq8EE)
@@ -16,7 +16,7 @@ Two Versions There are two versions of OpenFL, the first is primarily distributed using haxelib, and blends native support for Windows, macOS, Linux, iOS, Android, Flash, HTML5 and WebAssembly. You can read more about the haxelib distributed version of OpenFL, [here](https://github.com/openfl/openfl). -The second edition of OpenFL is distributed using npm, and is designed for use from TypeScript, JavaScript (EcmaScript 5 or 6+), ActionScript 3 (using [Apache Royale](https://royale.apache.org)) or Haxe, the latter of which can be used in both haxelib and npm versions of OpenFL. The NPM version of OpenFL is designed to be used in a web browser environment. +The second edition of OpenFL is distributed using npm, and is designed for use from TypeScript, JavaScript (EcmaScript 5 or 6+), ActionScript 3 (using [Apache Royale](https://royale.apache.org)) or Haxe, the latter of which can be used in both haxelib and npm versions of OpenFL. The npm version of OpenFL is designed to be used in a web browser environment. Getting Started