You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2020/01/09 09:28:27 UTC

[royale-asjs.wiki] branch master updated: Created Creating A High-Level Emulation Component (markdown)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4e96aab  Created Creating A High-Level Emulation Component (markdown)
4e96aab is described below

commit 4e96aabcddab2604a3435a6834b11b631331919c
Author: aharui <ah...@apache.org>
AuthorDate: Thu Jan 9 01:28:25 2020 -0800

    Created Creating A High-Level Emulation Component (markdown)
---
 Creating-A-High-Level-Emulation-Component.md | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Creating-A-High-Level-Emulation-Component.md b/Creating-A-High-Level-Emulation-Component.md
new file mode 100644
index 0000000..20779d7
--- /dev/null
+++ b/Creating-A-High-Level-Emulation-Component.md
@@ -0,0 +1,13 @@
+Some emulation components are better implemented by copying the Flex code and modifying it.  One of the deciding factors is whether there are low-level Flash APIs used.  If not, the component is a candidate for straight migration.
+
+The process is "simple":
+1) Copy the Flex code file.
+2) Rename flash.*.* imports to the Royale equivalents:
+* flash.events.* generally can become org.apache.royale.events.*
+* flash.display.Graphics might be replaced with mx.display.Graphics
+* flash.display.* needs to be replaced by Basic or MXRoyale controls.  Sprite probably gets replaced by UIComponent, for example.
+* flash.text.TextFIeld might be replaced by mx.controls.Label
+3) If the code relies on Flex lifecycle APIs, consider calling commitProperties in an override of addedToParent().  createChildren() should get called.  measure() may not get called but hopefully there aren't critical things in measure().  If updateDisplayList is used, override setActualSize() to call updateDisplayList.
+4) Try to compile it.
+5) Ask on the dev@royale mailing list about any remaining errors.
+