Hi,
i have being trying to load an external variable from a php file into my actionscript.I am using flex and i have tried lot of examples listed on google,i have gone through all the tutorials,codes..etc..all of them were made using cs3 or cs4.And when i ran them i dint get any output at all.Either i got that loader wasnt defined or nothing in my textarea.
if possible please guide me on the following or kindly give a small sample that works on flex3.i am also not sure of what i shud write in my php file.
i have added the code of my mxml file for this which is not working and shows me a blank textarea.
Any help would be appreciated..thanks in advance
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="httx://xxx.adobe.com/2006/mxml" xmlns:custom="test.external.*" layout="absolute" initialize="load()">
<mx:Script>
<![CDATA[
private function load() : void {
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest("C:\apache2triad\htdocs\flexu\external.txt"));
}
private function onComplete(e:Event):void {
ext.text = URLLoader(e.target).data;
}
]]>
</mx:Script>
<mx:TextArea id="ext" x="296" y="199" >
</mx:TextArea>
<mx:Button click="load()" x="343.5" y="274">
</mx:Button>
</mx:Application>