Posted by mrtibbs in SWF Studio V3 on Feb 14 2008, 04:46 pm

So I have a loadMovie that works until it's run through SWF Studio:
loadMovie("projects/fdaFlash.swf", _root.dropZone_fda);

How do I get this to work? I'm having a tough time understanding how the ss-commands work.

Posted by northcode in SWF Studio V3 on Feb 14 2008, 08:44 pm

Change the / to \\ and it should work, as long as you haven't change the Default Base Path setting on the Movie Tab

The path separator on Windows is a \ but in a string literal in Flash you have to use \\ instead. You can read more about String Literals vs. String Values if it's not clear why you have to do that.

Posted by mrtibbs in SWF Studio V3 on Feb 15 2008, 10:55 am

Thanks for your help Northcode.

Got it to work by changing my code up a little bit:
ssDefaults.loadFilesFromLayout = true;

Posted by mbd in SWF Studio V3 on Feb 15 2008, 11:25 am

First, just to clarify, when you put files in the Files tab they are extracted when your EXE launches (by default) to a temporary directory. When you try to target your SWFs using loadMovie it won't work because the default base path of your main SWF is next to the EXE, to emulate what happens with a Flash projector, and when you double-click a SWF.

ssDefaults.loadFilesFromLayout isn't necessary if you use MovieClip.loadMovie (as in the code you posted last), since SWF Studio overwrites that method and checks in the temp folder for you and loads the files from there if they aren't first found in the base path. That was put in place to make situations like yours less painful.

However, if you use loadMovie (the global function as in your first post) then you will have to set the default base path, either in the Movie tab or in code (ssCore.App.setBasePath({path:'tempdir://'});). Unfortunately, there's no way of overwriting the loadMovie global function in Flash.

Note: you don't NEED to change your / to \ for native Flash load commands. It doesn't hurt, unless you also use your SWF on the web, in which case the Flash Player doesn't convert \ to / and, depending on your server, your paths could fail.

For SWF Studio commands that take a fully qualified path you should specify \ instead of /.