Conversion of Script from SWFKit 3.4 to SWFKit Pro 2.2
Hi. I'm currently testing the viability of using SWFKit in a project to create an EXE which contains a number of slides featuring FLVs, MP3s and SWF animations. We have a website where presentations can be viewed online which contain all these assets and we want to use SWFKit to create EXEs so the presentations can be viewed offline.
I've been using a trial version of SWFKit 3.4 to test this and it works very well and does everything necessary. We now want to take things a step further and use SWFKit Online so that user created presentations can be downloaded.
Everything is set up correctly to achieve this in terms of server, Active X component installation, PHP scripts etcetera. The only remaining problem is a difference between SWFKit 3.4 and SWFKit Pro 2.2 which I can't work out.
Basically, in the website I pass the following variables to my main slide engine SWF:
var xmlFile = "xml/module-02-pain.xml";
var sectionUrl = "pain";
var moduleUrl = "02-pain";
var sectionName = "Learning Modules";
var moduleNumber = "2";
var moduleName = "Pain";
To emulate this in SWFKit 3.4 I added the following to the initialize script:
getAdditionalFile();
var xmlFile = "xml/module-02-pain.xml";
var sectionUrl = "pain";
var moduleUrl = "02-pain";
var sectionName = "Learning Modules";
var moduleNumber = "2";
var moduleName = "Pain";
function swfkitSetupVars() {
FlashPlayer.setVariable("_root.xmlFile", xmlFile);
FlashPlayer.setVariable("_root.sectionUrl", sectionUrl);
FlashPlayer.setVariable("_root.moduleUrl", moduleUrl);
FlashPlayer.setVariable("_root.sectionName", sectionName);
FlashPlayer.setVariable("_root.moduleNumber", moduleNumber);
FlashPlayer.setVariable("_root.moduleName", moduleName);
}
return true;
This works perfectly in SWFKit 3.4 but it doesn't work at all in SWFKit Pro 2.2. The main movie doesn't receive any variables at all so nothing happens.
Based on all this I have a couple of questions:
1) How do I go about setting SWFKit Pro 2.2 to do the same as I've done in SWFKit 3.4? That is, how do I pass variables to the main movie before it starts?
2) How do I alter these variables on the fly using SWFKit Online? That is, each of the user created modules will require different section and module names etcetera so how do I go about altering these variables in the initialize script before the main movie is called?
Any assistance you can provide would be greatly appreciated. If you need more information about anything, please ask.
|