# Initiate AS from JavaScript / AJAX / PHP

**URL:** https://forum.kirupa.com/t/initiate-as-from-javascript-ajax-php/277761
**Category:** flash
**Created:** [December 17, 2008, 12:19am UTC](https://forum.kirupa.com/t/initiate-as-from-javascript-ajax-php/277761 "2008-12-17T00:19:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Kevin\_B](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@Kevin\_B](https://forum.kirupa.com/u/Kevin_B)
#### Post date: [December 17, 2008, 12:19am UTC](https://forum.kirupa.com/t/initiate-as-from-javascript-ajax-php/277761/1 "2008-12-17T00:19:26Z")

</div>

I’m making a multimedia player for a website and I’m seeking some help. Here’s my scenario:

- simple multimedia player in Flash with AS 2.0 code
- PHP page that retrieves file information from mySQL database
- Javascript that displays the info from the database and upon selecting a song, should invoke the Flash player to start playing that song

I do not want the list of songs (collected from the database) to be part of the Flash interface – the Flash ONLY should include playing/pausing the music, nothing else.

I know how to program the multimedia player and know the PHP/mySQL to get the information. However, what I don’t know how to do is invoke the Flash to start playing from Javascript. Basically, I need Javascript to send a message to Flash (without reloading the page) that says, “hey, start playing song.mp3 now!”
