Link to home
Start Free TrialLog in
Avatar of Absente
Absente

asked on

Actionscript3 - get data from php

hi  
I wana actionscript 3 code whicsh is settext to flash from php.

my php code

<?php
//bu kod www.soulsmasher.net adresinden indirilmistir
//kodlama: 25 Ekim 2008 SoulSmasher
function kurtemizle($text) {
$ara=array("<ALIS>", "</ALIS>", "<SATIS>","</SATIS>");
$degis=array("","","","");
return str_replace($ara,$degis,$text);
}
$kaynak = "http://xml.altinkaynak.com/doviz.xml";
$dizi=file($kaynak);
$dolaralis=kurtemizle($dizi[10]);
$dolarsatis=kurtemizle($dizi[11]);
$euroalis=kurtemizle($dizi[15]);
$eurosatis=kurtemizle($dizi[16]);
echo $dolaralis;
echo $dolarsatis;
echo $euroalis;
echo $eurosatis;
?>


I want to use ,dolaralis, dolarsatis, euroalis, eurosatis in flash. how can i do with action script3 could you give me simple code for this.
Avatar of babuno5
babuno5
Flag of India image

Avatar of Absente
Absente

ASKER

its nor work to me. i want to get from phpfile
Avatar of Absente

ASKER

How can I do thiswith actionscript 3 ?

_lv = new LoadVars ();
_lv.onLoad = function () {
      if (!this.faultCode) {
            dovizXML.load ("kurlar.xml");
      } else {
            trace("Bir hata olustu");
      }
};
a = new Date ();
_lv.sendAndLoad("doviz2.php?a=" + getTime (), _lv, "POST");
//
dovizXML = new XML ();
dovizXML.ignoreWhite = true;
dovizXML.onLoad = parsedovizXML;
dovizXML.load ("kurlar.xml");
function parsedovizXML (valid) {
      if (valid) {
            alis = new Array ();
            satis = new Array ();
            parseAll = dovizXML.childNodes[0].childNodes;
            for (i = 0; i < parseAll.length; i++) {
                  allEm = parseAll[i];
                  alis[i] = allEm.attributes.al;
                  satis[i] = allEm.attributes.sat;
            }
            yazdir ();
      } else {
            trace ("XML dosyasinda sorun var");
      }
}
/*Bu veriler bir döngü araciligi ile metin kutularinda
görüntülenir*/
var giris=3
function yazdir () {
      for (k = 0; k < giris; k++) {
            kutua="a"+k;
            kutus="s"+k;;
            _root[kutua].text=alis[k];
            _root[kutus].text=satis[k]+" TL";
      }
}
stop()

this is actionscript 2 code.
ASKER CERTIFIED SOLUTION
Avatar of babuno5
babuno5
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.