Posted by smuella in SWF Studio V3 on May 23 2008, 10:18 am

Hi there - I am having a strange problem that I don't understand - I'm hoping someone might be able to explain what is going on!

I have a .exe made with northcode that works perfectly when I launch it manually, but when I launch it automatically using a batch file in the startup folder, for some reason a WMV video in the program doesn't show - I just get a black screen.

My batch file is just this:

Start c:\CYC_FORENSICS\CYC_FORENSICS.exe

inside my program I am using :

ssCore.WMVideo.setResource({resource:"who_anims/forens_anim.wmv"});

to set the path to the wmv file to be played.

it plays absolutely fine if I just double click on the .exe to launch it. But for some reason launching from the .bat file makes something go wrong..and the video doesn't show - (however I have a function that calls ssCore.WMVideo.stop() when the mouse is clicked, which does work and triggers the onComplete function - but no video!)

What is going on? Any help much appreciated - it's pretty urgent right now that I get this working!

Many thanks,

Sam.


Posted by AGo in SWF Studio V3 on May 23 2008, 10:45 am

that sounds like either a path or a working dir issue.
Both should be fixed with this


var sd = ssGlobals.ssExePath.substr(0, ssGlobals.ssExePath.lastIndexOf("\\"));
ssCore.WMVideo.setResource({resource:sd +"\\who_anims\\forens_anim.wmv"});


Posted by northcode in SWF Studio V3 on May 23 2008, 10:59 am

Start c:\CYC_FORENSICS\CYC_FORENSICS.exe

Will start your application with the directory the BAT file is in as the current directory instead of the C:\CYC_FORENSICS folder (which is what SWF Studio wants). If you change the BAT file to this (below) it should work just fine.


C:
CD  \CYC_FOREENSICS
CYC_FORENSICS.exe


NOTE: You don't need to use the Start command to start an EXE file.


Posted by smuella in SWF Studio V3 on May 23 2008, 11:32 am

thank you very much - changing the bat file as suggested works fine!