PDA

View Full Version : Send data to a Flash movie from (not through) Php.


JoriathLionfort
03-04-2004, 01:57 PM
Hi there! First of all, thanks for taking time to read this post...
I'm trying to make a web page that gets all of its contents from a MySQL database. I have 3 tables (head, body, foot) that provide that content. The body of the page is made up by a number of links (that are stored in a 4th table -> id, link text, text) and a Flash movie (basically, a textarea).
The links are created with the image processing functions of PHP, embedding the 'link text' into a button image. And here comes the problem: when you press a link, the text in the Flash movie should be updated with the new text straight out of the database. I know I can load data from a database THROUGH a Php file, via the LoadVars function (if I recall correctly) but, is there a way to send data FROM a Php file to a Flash movie without having to reload the whole page? :think:

Thanks a lot in advance!!!

mrand01
03-04-2004, 11:08 PM
EDIT: if the flash object isn't on your PHP page I don't think it can work. Also, I've never tried this before, so I'm not 100% sure it will work...I've never used the flash object in Javascript, just VB.

give your flash object an id tag in the html document like this:


<object id="myFlash" ...rest_of_stuff_here...


then you can reference the object through javascript like this i think:


document.myFlash


the Flash object has a merhod called SetVariable. Use it like this:


document.myFlash.SetVariable("varname", "value")


so just create a javascript function with all of that and call it from the php...I think that could work

JoriathLionfort
03-05-2004, 05:41 AM
Thank you very much, mrand01! That sounds good. I'll go check it out immediately!

The Flash object is in the php page. And I guess I'd have to make a direct relationship between the name of the variable sent to Flash (via SetVariable) and the name of the textarea within the Flash object. Hmmm... Well, let's see what happens! :) Thanks again!!