|
|||
|
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. |
|
|||
|
Just wanted to add that I've figured out the answer to my second question. I can store the variables I need to pass in a text file and then load it with DataFile.load. This means I can use a script to generate the text file and for inclusion before outputting the EXE. So my code now looks like this:
getAdditionalFile(); var datafile = getAdditionalFile("module-02-pain.txt"); DataFile.load(datafile); 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; Again, this works with no problems in SWFKit 3.4 but not in SWFKit Pro 2.2. If you can help me resolve this problem I'd really appreciate it as it's the only obstacle left in this project and the only thing preventing a purchase of SWFKit Online. |
|
|||
|
In swfkit pro 2 the movies in the "Movies" list and those in the "Attachments" will be placed in different folders, i.e. they cannot "see' each other, and thus cause problems. In swfkit 3 this kind of problems have been solved.
To make your project also work in swfkit pro 2, you may do as follows 1) you must have a main movie in the "Movies" list. Please move it into the "Attachments" list, as well as all other movies in "Movies" list. That is, the "Movies" list will be empty. 2) swfkit 2 requires at least a movie in the "Movies" list to be the main movie. So you need to create a blank movie, and add it into the "Movies" list, and set it to be the main movie. 3) the blank movie isn't the "real" main movie you want. So you will have to add the following code into the "initialize" script of your swfkit pro 2 project: Code:
Application.onGetMovie = function (movie) {
movie.value = getAdditionalFile("The real main movie.swf");
return true;
}
As many users requested, we're building a new version of the replacer for swfkit pro 3. You'll be able to upgrade to the new version for free if you have the current version. |
|
|||
|
Hi. Thanks for the detailed reply, it's very helpful. I have a couple more questions though, I'm afraid.
1) Does this method get around the problem of having to specify an absolute path for an FLV loaded using the netstream object or do I still need to do that? 2) I can't seem to get SWFKit to respond to a call from a Flash movie using ExternalInterface.call() even though I've done as directed above. It's this that triggers my swfkitSetupVars function. The idea being that variables declared in SWFKit can be passed to Actionscript for use there. Are there any issues with ExternalInterface.call() specific to SWFKit Pro 2.2 that might be causing this? 3) Do you have any idea of when the replacer for SWFKit Pro 3 will be available and what the cost will be? Thanks again for all your help. I'm very close to achieving all I need to in order to get my project finished. |
|
|||
|
1) It's highly recommended that you use the same method to handle flv files - always put your resource files and the real main movie in the same place.
2) no, swfkit pro 2 doesn't have interface to response to the external calls from as. 3) The new replacer will have the same price as now. It should be finished soon. |
|
|||
|
Hello again. Is there any about when the replacer for SWFKit Pro 3 will be available? My client has purchased SWFKit Online but we're still having some problems getting the FLVs to work despite following the instructions given here. I am using a blank movie as the main movie then changing it to the actual movie as recommended above. This works fine but the FLVs still aren't playing.
I've tried everything I can think of to get it working but something just isn't right. Frustratingly it works exactly as required using a demo of SWFKit 3 so the updated replacer would be my preferred solution. If that's still a way off, can I run this past you to see if there's anything obvious that I'm doing wrong? Here's the structure of my project: PHP Code:
PHP Code:
Can you shed any light on what I'm doing wrong or - preferrably - tell me when the new replacer for use with SWFKit 3 will be ready? Thanks for all your help. |
|
|||
|
Replacer for v3 is still under developing, and it'll probably be released in 2 weeks.
Please try to remove the event handler "onMovieLoaded", OR change it to Code:
Application.onMovieLoaded = function (movie) {
FlashPlayer.setVariable("_root.MEDIA_PATH_FLV", getAdditionalFile("media\\flv\\"));
}
If it still doesn't work, please send us the skp file of your template, the slide.fla, and a flv file. Our email address is support@swfkit.com. We'll test your project and try to fix your problem. Thank you very much. |
|
|||
|
Hi, and thanks for your response. I've tried the change you suggested but unfortunately it didn't work. I've zipped up the files you requested and have emailed them to your support department. Hopefully they will find a solution. Thanks again for all your help.
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|