Solved

Actionscript3 - get data from php

Posted on 2010-08-27
6
377 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The goal of the tutorial is to teach the user how to how to record live broadcast.

831 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