XML : PHP parse JSON data from video URLs with ActionScript

I do not get the results I want the following code.

  <?xml version="1.0" encoding="utf-8"?>  <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"           xmlns:s="library://ns.adobe.com/flex/spark"          creationComplete="init(event);"          title="PlayDialog">      <fx:Declarations>          <!-- Place non-visual elements (e.g., services, value objects) here -->          <s:HTTPService id="json" result="getJSON(event)"                         url="http://samplepage.com/phpsample.php" useProxy="false">              <s:request xmlns="">                  <id>{requestedId}</id>              </s:request>          </s:HTTPService>      </fx:Declarations>      <fx:Script>          <![CDATA[              import mx.events.FlexEvent;              import mx.rpc.events.ResultEvent;                private var URLRow:String;              private var URLHd:String;              private var URLSd:String;                [Bindable]              private var requestedId:String;                private function getJSON(event:ResultEvent):void{                  if(event.result.count != 0)                  {                      URLRow = event.result.low;                      URLHd = event.result.hd;                      URLSd = event.result.sd;                  }              }                private function init(e:FlexEvent=null):void{                  requestedId=data as String;                  json.send();              }                private function play_row(e:MouseEvent):void{                  navigateToURL(new URLRequest(URLRow));              }                private function play_sd(e:MouseEvent):void{                  navigateToURL(new URLRequest(URLSd));              }                private function play_hd(e:MouseEvent):void{                  navigateToURL(new URLRequest(URLHd));              }                       ]]>      </fx:Script>      <s:VGroup left="30" right="30" top="30" height="150">          <s:Button width="100%" label="Low"  click="play_row(event)"/>          <s:Button width="100%" label="sd"  click="play_sd(event)"/>          <s:Button width="100%" label="hd"  click="play_hd(event)"/>      </s:VGroup>  </s:View>    

URL address that tries. Working address: http://217.20.153.78/?sig=ee373716dfc9962ef6a4a9b2917997eaea84d28e&ct=0&urls=217.20.157.202%3B217.20.153.71%3B217.20.145.42&expires=1440250966444&clientType=0&id=54644181549&type=1

  <?php    // $urlJSON = $_GET["id"];       $json = file_get_contents('http://odnoklassniki.ru/dk?cmd=videoPlayerMetadata&mid=32309709443');    // $json = file_get_contents($urlJSON);       $obj = json_decode($json);     $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";       $count=0;     foreach($obj->videos as $video){        if($video->name!="mobile" && $video->name!="lowest"){              $xml .= "<$video->name>";                //embed the SQL data in a CDATA element to avoid XML entity issues              $xml .= "<![CDATA[$video->url]]>";                 //and close the element              $xml .= "</$video->name>";              $count++;            //echo $video->name .' :: '. $video->url;          //echo '<br>';          }     }     echo $xml;     echo "<count><![CDATA[$count]]></count>";  ?>    

[![enter image description here][3]][3] Coming result on this page. However AS3 comes with different results. http://codepad.viper-7.com/GdxJ2g

AS3 is different cause erroneous URLs? Where did I go wrong?

No comments:

Post a Comment