Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-2007, 12:11 AM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default Load Movie

I'm able to replace the main movie on startup of my program. But I need to replace the main SWF with another one on command, how is this done? :-\
Reply With Quote
  #2 (permalink)  
Old 08-07-2007, 10:27 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Load Movie

Please send us a sample(support@swfkit.com), we will help you to make it work.
Reply With Quote
  #3 (permalink)  
Old 08-07-2007, 10:38 AM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default Re:Load Movie

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?
Reply With Quote
  #4 (permalink)  
Old 08-07-2007, 11:02 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Load Movie

in action script, you can use
Code:
import SWFKit.*;
var filename = Dialogs.fileOpen("flash movies(*.swf)|*.swf|");
if (filename)
    _root.loadMovie(filename);
Reply With Quote
  #5 (permalink)  
Old 08-07-2007, 12:20 PM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default Re:Load Movie

That does absolutely nothing at all, doesn't open a dialog.
Reply With Quote
  #6 (permalink)  
Old 08-07-2007, 12:46 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Load Movie

We are not clear about your situation. Please send us your file, so that we will know where the problem is. Thank you.
Reply With Quote
  #7 (permalink)  
Old 08-07-2007, 12:58 PM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default Re:Load Movie

Again: There is no file, right now the only code in my FLA is the code you provided me, then that SWF is made into the main movie and executed with SWFkit Pro.
Reply With Quote
  #8 (permalink)  
Old 08-07-2007, 01:33 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Load 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);
}
in actionscript 3, call the ffish script
Code:
import flash.external.*;

ExternalInterface.call("ffish_run", "choosefile");
2) action script

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();
Reply With Quote
  #9 (permalink)  
Old 08-07-2007, 01:44 PM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default Re:Load Movie

Nope, I only know AS2. But your FFish script method worked, thank God it worked
Reply With Quote
  #10 (permalink)  
Old 08-07-2007, 02:07 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Load Movie

:'( 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);
, which has been tested and works well
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:31 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.