I've searched the web and this site exhaustively and haven't found the answer's I'm in need of.

I am being given a set of SWF videos to upload into a training management system I created. Each SWF file contains a short "lesson" and a test at the end, which produces a score.

I need to get the score out of the flash fine and then store it in the MySQL db. The latter part is a breeze. The issue at hand is how do you pass a value from an SWF file to PHP?

The SWFs are being created with Camtasia Studio, so there is no author-side knowledge of ActionScript.

I am hoping I won't have to 1) get an Adobe Flash license and 2) edit each video to add ActionScript. All the searches I've done bring up topics about passing values from PHP to flash, but not the other way around.

    I work with a flash developer, but I haven't done much flash unfortunately. Of course, he has CS3. I did run across this post that explains how to do this with LoadVars. If you are able to make a test with scores, you must have some access to actionscript, right? I am not-at-all familiar with Camtasia Studio. However, I cannot think how you can pass variables anywhere without doing ActionScript at some point. I suggest, getting a 30 day trial for Flash CS3 and downloading the Flash Accessory (says it's for MX but perhaps it will still work for CS3.)

      Well, like I said I'm not the one creating the flash files. Camtasia is a 100% WYSIWYG flash creator for doing educational stuff, the guy doing the flash vids knows zero code of any kind.

      But I'm thinking I'm going to have to get CS3 and then go in and at least look at the flash code to see how the score is handled in terms of a variable, and make whatever modifications I need to in order to extract the score into PHP (GET var in URL perhaps).

      I'm hoping beyond hope that Camtasia throws in ActionScript behind the scenes, and all I'll have to do is access it.

        I don't see how you can avoid having to add ActionScript to each video. But once you've written it, it the same script can be used in all movies. You might want to check out this book. It has a lot of info on what you're looking for.

        From what I've read, you need to add an ActionScript that will use LoadVars to pass a variable via the Post method. Then in PHP, you just capture the variables with a $_POST command.

        But if you're set on not getting Flash, then I don't know how else you'd be able to do it.

        EDIT:
        Apparently I was a little slow typing! That book is a good read though. Check it out, I think it should help.

          It sounds like I will have to get flash. The other option is for me to do a PHP/MySQL quiz system external to the flash files, which isn't the preferred solution of the client (the guy creating the videos).

          Thanks for the recommendation.

            Write a Reply...