PDA

View Full Version : Center Projector (how to use pattern in caption?)


BadBadNeil
11-16-2004, 04:37 PM
OK i found a way finally to center a projector but I don't quite understand what they mean when they say "If you call CENTER without specifying a value for the pattern argument, nothing will happen. If you supply a value for the pattern, any window that contains the pattern in its caption will be centered on the desktop." in the below instructions. Any help is appreciated!

Thanks
Neil


Center running application(s) on the desktop
There are no commands in Flash alone to control the placement of the Flash projector window. The best you can do is create a full screen projector and center the Flash movie within that window. However, this leaves a border around your Flash movie and the user will be unable to access the desktop.

CENTER allows you to reposition any running application on the desktop. The size of the window being centered and the size of the desktop are determined dynamically at run time so you don't have to include any of that information in your call.

usage: center.exe pattern

If you call CENTER without specifying a value for the pattern argument, nothing will happen. If you supply a value for the pattern, any window that contains the pattern in its caption will be centered on the desktop. Case is not important but spaces are significant.

This actionScript command fscommand("EXEC", "center.exe" + chr(9) + "Flash"); will center all open windows that have "Flash" in the caption.

If you use the old Flash trick of using tabs in place of spaces, CENTER will look for tabs in the caption (exact match) and will probably fail to find the window.

Flash 5 will allow you use a tab between the application name and the pattern.

Flash MX does not allow spaces in the argument to the EXEC actionScript command. This means that the CENTER utility can't be called directly from Flash MX.

In a batch file the pattern can contain spaces which provides a workaround for Flash 5 limitations and makes it possible to use CENTRE from Flash MX projectors.

If you're working with SWF Studio you can use spaces in the pattern argument.

CyanBlue
11-16-2004, 11:20 PM
Howdy... :)

I think you've got that stuff from the extendflash or something similar, right???

I think that pattern means the string in the Title bar, but I could be wrong...
So, you could name your projector 'myProjector' and use 'center myProjector' to center it...

BadBadNeil
11-17-2004, 01:00 AM
Heya ;)
Yeah I tried naming it and then keeping it the same as the code in the fscommand to no avail, we gave up on the centering for this project, has to be out the door tomorrow, argh. I hate when things don't work out. I found another strange centering sample on the net where it used a batch command with an exe, it worked to some extend but on several test computers it didn't launch at all so we scrapped that one.

At the last moment I thought of dumping the flash into director and using director to center but perhaps next time.

Thanks anyways, gonna get back to u about that project by the way, i need some time to jot ideas down.

Thanks
Neil