|
|||
|
i want swfkit to load an image file in an mc, but it wont work >
![]() in flash i got a button and an mc (loader) on the button i use this code: on (release) { fscommand("ffish_run", "openfiles"); } in swfkit i use: var filename = Dialogs.fileOpen("flash movies(*.jpg)|*.jpg|", "jpg"); if (filename) { _root.loader.loadMovie(0, filename); } but this doesn't do anything ??? can someone help me please ?? |
|
|||
|
You cannot control a movieclip in ffish script directly; however, you can only load an image into the level0 in ffish script:
FlashPlayer.loadMovie(0, filename); To solve the problem, we recommend that you call swfkit objects directly in actionscript, e.g. in actionscript 2 Code:
import SWFKit.*;
var filename = Dialogs.fileOpen("flash movies(*.jpg)|*.jpg|", "jpg");
if (filename) {
_root.loader.loadMovie(0, filename);
}
|
|
|||
|
To code swfkit code directly in flash you need the swfkit3
In swfkit2 you have to build a workaround like this. 1. browse for a file with swfkit: you get a variable containing the path of your jpg 2. transfer the path to flash with the setVariable method 3. since this is asynch programming, let flash know you transfered the path. I used to do this with the trigger component. 4. when the trigger is activated, it calls a function in flash to load the jpg. I made you a sample |
|
|||
|
Sure, you can use 2 triggers. However, you can also combine the file names of the images, e.g. "c:\image.jpg,c:\sun.png" and pass it to one trigger. Then in the trigger event handler you can separate the image file names and load them separately.
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|