This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch feature/Crux
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/feature/Crux by this push:
new 86b1c9f Fix Jewel Crux quickstart example
86b1c9f is described below
commit 86b1c9fdbb0428a6d3d04efe2b3360535010d187
Author: greg-dove <[email protected]>
AuthorDate: Wed Jul 3 21:33:16 2019 +1200
Fix Jewel Crux quickstart example
---
.../crux/CruxQuickStart/src/main/royale/tracer.as | 46 ++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/examples/crux/CruxQuickStart/src/main/royale/tracer.as
b/examples/crux/CruxQuickStart/src/main/royale/tracer.as
new file mode 100644
index 0000000..d46f599
--- /dev/null
+++ b/examples/crux/CruxQuickStart/src/main/royale/tracer.as
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package {
+
+ public function tracer(...args):void
+ {
+
+ COMPILE::JS {
+ args.unshift('[JS]');
+ console.log.apply(console, args);
+ }
+ COMPILE::SWF{
+ import flash.external.ExternalInterface;
+
+ if (ExternalInterface.available)
+ {
+ try
+ {
+ args.unshift('[SWF]');
+ const method:String = 'console.log.apply';
+ ExternalInterface.call(method, null, args);
+ } catch (e:Error)
+ {
+ }
+ }
+ }
+ }
+
+
+}