URLLoaderDataFormat.AError#1069:在字符串上找不到属性TEXT,并且没有默认的valuerray as3

时间:2014-04-04 09:29:40

标签: actionscript-3 actionscript

我正在尝试将从另一个类加载的一些静态变量解析为此URLloader。我可以毫无问题地跟踪数组,但不确定为什么我不能将它们设置为URLVariables的变量?

private function Contactyes(event:MouseEvent):void
        {

            //Here create the parser to php database for interested list
            variables:URLVariables;
            Sends = new URLRequest("http://localhost/Sendinterested.php");
            Sends.method = URLRequestMethod.POST;
            Sends.data = variables;

            Loaders = new URLLoader();
            Loaders.dataFormat = URLLoaderDataFormat.TEXT;
            Loaders.addEventListener(Event.COMPLETE,completeHandler);
            infodata= SearchVectorTest.lists;
             somedata=homepage.infoss;
            trace(somedata[0]);
            variables.userid = somedata[0].TEXT;
            variables.username = somedata[1].TEXT;
            variables.useremail = somedata[3].TEXT;
            variables.Listingname = infodata[1].TEXT; 
            variables.Listingid = infodata[0].TEXT;

Homepage.as

public class homepage extends MovieClip {
public static var infoss:Array;
public function homepage(){Mend = new URLRequest("http://localhost/myaccount_1.php");
            Mend.method = URLRequestMethod.POST;

            variablesss = new URLVariables();
            variablesss.username = s7.statusname.text;
            Mend.data = variablesss;


            nLoader = new URLLoader();
            nLoader.dataFormat = URLLoaderDataFormat.TEXT;
            nLoader.addEventListener(Event.COMPLETE,Candler);
            nLoader.load(Mend);


            // handler for the PHP script completion and return of status
             function Candler(event:Event):void{




                 var resultString :String = event.target.data;
// parse result string as json object and cast it to array
           var resultArray  :Array  = JSON.parse( resultString ) as Array;




                 trace(resultArray[0]);
                 trace(resultArray[1]);
                 trace(resultArray[2]);
                 trace(resultArray[3]);
                 s7.statusname.text= resultArray[1];

                infoss = new Array(resultArray[0],resultArray[1],resultArray[2],resultArray[3]); 



        }

感谢您的时间

0 个答案:

没有答案