# Php to flash

**URL:** <https://forum.kirupa.com/t/php-to-flash/21281>\
**Category:** Uncategorized\
**Created:** [May 19, 2003, 11:16pm UTC](https://forum.kirupa.com/t/php-to-flash/21281 "2003-05-19T23:16:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazzman121](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jazzman121/32/127_2.png) [@jazzman121](https://forum.kirupa.com/u/jazzman121)\
**Post date:** [May 19, 2003, 11:16pm UTC](https://forum.kirupa.com/t/php-to-flash/21281/1 "2003-05-19T23:16:44Z")

</div>

in a php file… how do i pass a command to a flash file???

like in the php file

if ( condition ) {

tell a button in flash to be enabled… ( eg. \_root.prev.enabled = true; )

}

in php how do i do this??? how do i pass a actionscript command to the flash file?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 19, 2003, 11:43pm UTC](https://forum.kirupa.com/t/php-to-flash/21281/2 "2003-05-19T23:43:07Z")

</div>

Use this script:

```php
<?php echo 'buttonIsEnabled=true'; ?>

```

and load it into Flash:

```auto
lv= new LoadVars()
lv.onLoad = function(success) {
if(success) {
_root.prev.enabled = this.buttonIsEnabled
} else {
trace("failed loading file")
}
}
lv.load("myScript.php")

```

I think that should do it 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 20, 2003, 12:51am UTC](https://forum.kirupa.com/t/php-to-flash/21281/3 "2003-05-20T00:51:20Z")

</div>

dint work

this is my php file…

\<?php

if (!$DataArray[$n]) {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Print “\<br\>\<br\>\<b\>No More entries\</b\>”;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo ‘buttonIsEnabled=true’;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;  
&nbsp;&nbsp;&nbsp;}  
}  
?\>

and in flash the text file shows …

No More enries buttonIsEnabled=true

dont know why its showing that :-S

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 20, 2003, 2:12am UTC](https://forum.kirupa.com/t/php-to-flash/21281/4 "2003-05-20T02:12:24Z")

</div>

use this then:

```php
if (!$DataArray[$n]) {
     Print "<br><br><b>No More entries</b>";
     echo '&buttonIsEnabled=true';
     exit;
   }
}
?>

```

I’m not sure what ‘textfile’ youre talking about, and how does flash read it…
