|
|||
|
There is no sample since this is the first thing I need to make in my program. Simply said, the program should display an swf (the main movie) which has a "Load Game..." button which allows you to open an SWF file. That opened SWF file should replace the main movie and start playing. I know how to openDialog and load in a movie, but how to make that loaded movie replace the main movie?
|
|
|||
|
Are you using actionscript 3 in flash cs3? If so, there are two methods, either by using ffish script or action script.
1) ffish script in swfkit, insert a new script, say "choosefile", and add the following code Code:
var filename = Dialogs.fileOpen("flash movies(*.swf)|*.swf|", "swf");
if (filename) {
FlashPlayer.loadMovie(0, filename);
}
Code:
import flash.external.*;
ExternalInterface.call("ffish_run", "choosefile");
first, please add "C:\Program Files\SWFKit Pro 3\Classes 3" into your actionscript 3 class path (flash cs3 main menu->view->preferences->actionscript->actionscript 3 settings), so that you can use ffish script objects directly in actionscript 3 second, add the following actionscript code Code:
import SWFKit.*;
var dlg = new Dialogs;
var filename = dlg.fileOpen("flash movies(*.swf)|*.swf|", "swf");
if (filename) {
_root.loadMovie(filename);
}
dlg.Release();
|
|
|||
|
:'( The first action script should work well, don't know why
Code:
import SWFKit.*;
var filename = Dialogs.fileOpen("flash movies(*.swf)|*.swf|");
if (filename)
_root.loadMovie(filename);
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|