Skip to main content
Participant
December 21, 2009
Question

How to read a .php file in flash

  • December 21, 2009
  • 3 replies
  • 832 views

Hi,

Does anyone know if there's a possibility to read out a .php file in flash? (Like the iFrame in html) Some other webs showed me the 'loadvars' array..

Thanx!

This topic has been closed for replies.

3 replies

thomasje_Author
Participant
December 22, 2009

Problem is still there.. i tried both.. None worked for me

Can someone try to edit that frame to a frame that loads a .php file?

FLA: http://www.hcdbfeesten.nl/aenb/test.fla

PHP: http://www.hcdbfeesten.nl/aenb/test.php

kglad
Community Expert
Community Expert
December 22, 2009

if you're trying to display the output of phpinfo(), use:

echo phpinfo();

in your php file.

December 21, 2009

You mean you want to load in and type out a php file? I'm not sure you can... I think the server will run the php and you will only ever get the output of it.

But you can try something like this:

var lo:URLLoader = new URLLoader();
lo.load(new URLRequest("http://www.mydomain.com/test.php"));
lo.addEventListener(Event.COMPLETE, typeIt);
function typeIt(e:Event){
    trace(lo.data);
}

thomasje_Author
Participant
December 21, 2009

So.. I do need to make a dynamic tekst block? And add to the first frame the action (as3?):

var lo:URLLoader = new URLLoader();
lo.load(new URLRequest("http://www.hcdbfeesten.nl/aenb/test.php"));
lo.addEventListener(Event.COMPLETE, typeIt);
function typeIt(e:Event){
    trace(lo.data);
}

It does show me:

http://www.hcdbfeesten.nl/aenb/test.swf

Nothing... Instead of:

http://www.hcdbfeesten.nl/aenb/test.php

December 21, 2009

i'm really new to as* but i think you should try trace(e.target.data) in that  function... i'm probably wrong but you should get the text atleast (i don't think it will look exactly ike the php output though)

kglad
Community Expert
Community Expert
December 21, 2009

use loadvars if you're using as2.  with as3, use the urlloader class.