-
Notifications
You must be signed in to change notification settings - Fork 51
Description
`
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.apache.org/royale/mx"
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:html="library://ns.apache.org/royale/html"
width="100%" height="800" layout="vertical">
<fx:Script>
<![CDATA[
import org.apache.royale.events.Event;
import mx.events.IOErrorEvent;
import org.apache.royale.net.URLRequest;
import mx.core.IUITextField;
import m.utils.StringUtil;
org.apache.royale.net.remoting.amf.AMFBinaryData;
org.apache.royale.net.URLBinaryLoader;
// Hey guys/gals, AMF3_PHP can pass back objects with object mapping
// So if this is a bug, PLEASE FIX! THANKS
// <<COMPILER ERROR DATA>>>> <<date 2022-6-7>> 12:15 GMT -5
// ==================================================================================================
/* /home/megatron/apache-royale/royale-asjs/examples/mxroyale/HelloWorld/
src/main/royale/HelloWorld.mxml(49): col: 12 Error: Type was not found or was
not a compile-time constant: AMFBinaryData.
var bd:AMFBinaryData = new AMFBinaryData();
/ ^
/
/home/megatron/apache-royale/royale-asjs/examples/mxroyale/HelloWorld/
src/main/royale/HelloWorld.mxml(49): col: 32 Error: Call to a possibly
undefined method AMFBinaryData.
var bd:AMFBinaryData = new AMFBinaryData();
*/
// running Roayle 9.9.10 - PhP 7.4 Fedora KDE 36 VirtualBox Windows Host OS Maven Visual Studio Code
====================================================================================================
public function readData(input2:TextInput, path:String, callback:Function):void {
var dataSet:String;
var urlRequest:URLRequest = new URLRequest(path);
var urlLoader:URLBinaryLoader = new URLLoader();
// urlLoader.dataFormat = URLLoaderDataFormat.TEXT; THIS LINE NOT AVAIL IN APACHE ROYALE
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);
var bd:AMFBinaryData = new AMFBinaryData(); //**THIS LINE GENERATES ERROR**/
var str1:String =urlLoader.toString(); //COMING IN FROM PHP_AMF3 module
bd.fromString(); // using the awesome abyss web server
dataSet = bd.readUTFBytes();
input2.text = dataSet;
function urlLoader_complete(evt:Event):String {
//trace(dataSet)
callback(dataSet);
}
}
private function textInputChange(event:Event):void {
textToChange.text = event.target.text;
}
]]>
</fx:Script>
<fx:Binding
source="input2.text"
destination="databinding_t2.text"/>
<mx:TextInput id="databinding_t2"/>
<mx:Label id="textToChange" text="This is a text" />
<mx:TextInput id="input2" text="This is a text" change="textInputChange(event)" />
<mx:Label id= "mylabel" text="world" x="20" y="20" width="100" height="50" />
<mx:Label id= "mylabel2" text="{databinding_t2.text}" x="20" y="50" width="100" height="20" />
<mx:Button click="readData(input2, 'http://127.0.0.1:8000/as_remote.php',
function(s:String):void{{databinding_t2.text}})" x="20" y="150" width="100" height="50" />
</mx:Application>`