Solved

Actionscript3 - get data from php

Posted on 2010-08-27
6
376 Views
Last Modified: 2012-08-13
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.
0
Comment
Question by:Absente
  • 2
  • 2
6 Comments
 
LVL 15

Expert Comment

by:babuno5
ID: 33548703
0
 

Author Comment

by:Absente
ID: 33548989
its nor work to me. i want to get from phpfile
0
 

Author Comment

by:Absente
ID: 33549115
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.
0
 
LVL 15

Accepted Solution

by:
babuno5 earned 500 total points
ID: 33556223
check this u can use FLASHVARS

http://kb2.adobe.com/cps/164/tn_16417.html

<PARAM NAME=FlashVars VALUE="foo=Hello%20Worldgraph=first+line%0Dsecond+line">

This same line can be written in php as

echo "<PARAM NAME=FlashVars VALUE='".urlencode("dolaralis= $dolaralis&dolarsatis=$dolarsatis;")." '>";

Hope this helps
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 34059433
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.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now