A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Set position of opened program

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Posts
    272

    Set position of opened program

    Greetings all,

    I have a projector in Flash 8, using the exec fscommand to call a program file. All works great.

    My question is: Can I set the position on the screen where the program shows. It is a small program with a display size of 500x400 pixels. Right now it appears in the center of the screen...I want to the left of center...

    Any suggestions will be greatly appreciated..

    TIA

  2. #2
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    This is not possible using only Flash. It can be accomplished with any of the many 3rd party tools though. I could have sworn that Northcode made a free utility to do it but I don't see it at http://www.extendingflash.com
    If you are looking to buy a 3rd party program, i'd recommend SWF Studio from http://www.northcode.com
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  3. #3
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,764
    This is not the final resting place for ncstart, it will eventually be posted in the "free stuff" section at northcode.com, but you can grab it from here for now...

    http://www.northcode.com/misc/ncstart.zip

    usage: ncstart.exe /e exepath /a arguments /w width /h height /c /t /m /b

    The /e parameter allows you to specify the full path to an exe (exepath) file that you want to start. The exepath may use any of the following substitution strings as shortcuts to commonly used directories: {windir}, {sysdir}, {startdir} and {desktop}.

    The /a parameter allows you to specify arguements that will be passed to the executable file that you are launching. The arguments may also use the same substitution as in the exepath.

    The /w and /h parameters allow to specify the final width and height of the application window. These parameters must be used together.

    The /x and /y parameters allow to specify the final position of the application window. These parameters must be used together and will override the /c option.

    The /c parameter tells ncstart to center the application window on the desktop.

    The /t parameter tells ncstart to make the application window a topmost window.

    The /m parameter tells ncstart to maximize the application window at startup.

    The /b parameter tells ncstart to make the application window borderless

    {windir} - the windows folder, e.g. "c:\winnt" or "c:\windows"
    {sysdir} - the windows system folder, e.g. "c:\winnt\system32" or "c:\windows\system"
    {startdir} - the directory where ncstart is located
    {desktop} - the current users desktop folder, e.g. "c:\documents and settings\tim\desktop"

    Examples

    Start Windows Notepad centered on the screen and the make it window a topmost window
    ncstart.exe /e {windir}\notepad.exe /c /t

    Start projector.exe centered on the screen
    ncstart.exe /e {startdir}\projector.exe /c

    Start projector.exe centered on the screen without a border and make the window 800 x 600 pixels
    ncstart.exe /e {startdir}\projector.exe /c /b /w 800 /h 600

  4. #4
    Senior Member
    Join Date
    Sep 2000
    Posts
    272

    Thanks Northcode....help...

    I appreciate the download and info. Just got a chance to attempt to use it and I am obviously doing something wrong.

    Do I stull use the fscommand("exec", "ncstart.exe");

    Do I put ncstart.exe in the fscommand folder?

    where do I put - ncstart.exe /e {C:\WINDOWS\System32}\sndrec32.exe /c /t

    No matter what I do, except put the entire ncstart...../t in quotes does not give my ascript errors, but then it does not work.

    Any further guidance will be greatly appreciated. I know it just has to be something simple, but..........more coffee!

    Thanks

  5. #5
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,764
    Put this in a BAT file called sound.bat

    Code:
    ncstart.exe /e {winsys}\sndrec32.exe /c /t
    Then put the BAT file and a copy of ncstart.exe in your fscommand folder and run the BAT file to make sure it works and launches sndrec32 for you.

    Note: Just use the {winsys} string as-is on the command line and ncstart will figure out what the real directory name is when it runs.

    Next, put this code in your FLA:

    Code:
    fscommand("exec", "sound.bat");
    If you want to avoid the ugly DOS box that you're going to see then you can use another FREE tool I created called proxy.

    Download http://www.northcode.com/misc/proxy.zip and unzip it. Make a copy of proxy.exe, rename it to sound.exe and put a copy of sound.exe in your fscommand folder and change the fscommand call you used above to this

    Code:
    fscommand("exec", "sound.exe");
    The proxy utility looks at what you called it and executes any BAT file it finds that uses the same name. So running sound.exe will cause sound.bat to run, but you won't see a DOS box.

    Yes, it's a bit more complicated than using a commercial swf2exe tool, but the price is right.

  6. #6
    Senior Member
    Join Date
    Sep 2000
    Posts
    272

    Thanks Northcode

    Thanks alot,

    I can't tell you how much this has helped.

    Again,

    Thanks for all the help.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center