PDA

View Full Version : How do I get Flash to pass a value back to the web page in which it is embedded?


Boyle
08-27-2008, 04:22 AM
Hi,

I'm sure this is very simple to do, but I have little experience with Flash.. and need to use it.

I have a flash file with a number of buttons on it. Each time a button is clicked, it changes the single dynamic text field to show relevant information about that button (using the on release event).

This flash object is going to be embedded in a Learning Management System, and I need it to pass a value back the page it is embedded in.

In this instance, I need it to pass back a single digit. Basically, I need the web page to know how many of the buttons in the flash object the user clicked on (each button should only be counted once though).

Can it be done, and.. ummm.. how (noob-instructions would be great!) I'm using Adobe Flash CS3 (ActionScript 3.0)

I hate to ask, but I have a 5 day deadline to present the whole e-learning system to a client, and this is a component of it!

Thanks!!

xxneon
08-27-2008, 04:58 AM
if everything is displayed inside flash, couldnt you keep track of which buttons were clicked in the swf instead of having the webpage keep track of them?? or are there other reasons to have the web page aware of what flash buttons you clicked on??

rawmantick
08-27-2008, 05:12 AM
xxneon's right... Flash has all the necesary things. But still you could use flash.external.ExternalInterface (http://injun.ru/flash10api/flash/external/ExternalInterface.html) class. It is possible to call java script functions, pass arguments and get return value. See call() method.

xxneon
08-27-2008, 05:13 AM
even if you wanted to store the clicks to a cookie .. flash has its version of that too.. SharedObject.

Boyle
08-28-2008, 12:39 AM
The flash object actually has to sit within a Learning Management System (and the LMS is very very limited in what it can do).

My only option is to have the flash file embedded. It needs to pass a value back to the LMS as the LMS calcuates a pass/fail for overall courses and certificates across a huge range of web pages, and it can only take a single digit from each page.

By the way.. I know NADA about flash generally - its the first time I've had to start using it for this purpose, but don't have many other options.

Thanks!!

xxneon
08-28-2008, 01:35 AM
and how are you supposed to pass this value back to the LMS?? targeting another page? with a query string?