Solved

Actionscript3 - get data from php

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to obtain the string from a PHP StdObject ? 6 33
What is wrong with this PDO Delete Query? 2 17
php help 34 58
troubleshoot a python script 8 15
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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.
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

809 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