Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Actionscript3 - get data from php

Posted on 2010-08-27
6
Medium Priority
?
382 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

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.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The goal of the tutorial is to teach the user how to how to record live broadcast.

660 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