You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/06/03 14:45:22 UTC

[royale-asjs] branch develop updated: B012: simplifiy code adding binding

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 12fb499  B012: simplifiy code adding binding
12fb499 is described below

commit 12fb4992e5068db615d849564b519e56f29744da
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 3 16:45:14 2019 +0200

    B012: simplifiy code adding binding
---
 ...g_external_javascript_libraries_in_Apache_Royale.mxml | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
index 13185a6..9cb6b97 100644
--- a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
+++ b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
@@ -27,6 +27,7 @@
 		<![CDATA[
             import utils.HighlightCode;
 
+            [Bindable]
             public var code_txt:String;
 
             public function highLightContent():void
@@ -37,17 +38,14 @@
                     highlightCode.highlightBlock(sourceCodeMXMLText.element);
                 }
             }
-
-            public function onComplete():void
-            {
-                code_txt = codeTextLoader.data;
-                sourceCodeMXMLText.text = code_txt;
-            }
 		]]>
 	</fx:Script>
-
-    <js:HTTPService id="codeTextLoader" url="as3code.txt" complete="onComplete()"/>
     
+    <j:beads>
+        <js:ApplicationDataBinding />
+        <js:HTTPService id="codeTextLoader" url="as3code.txt" complete="code_txt = codeTextLoader.data;"/>
+    </j:beads>
+
     <j:initialView>
         <j:View>
             <js:beads>
@@ -63,7 +61,7 @@
                     <js:beads>
                         <j:ScrollingViewport/>
                     </js:beads>
-                    <html:Code id="sourceCodeMXMLText"/>
+                    <html:Code id="sourceCodeMXMLText" text="{code_txt}"/>
                 </html:Pre>
                 
                 <j:Button text="highlight Block" emphasis="primary" click="highLightContent()"/>