Groups | Blog | Home
all groups > flash actionscript > february 2006 >

flash actionscript : How to shut down the computer


magicMan_204
2/24/2006 9:12:00 PM
I have created a small menu.swf file that loads full-screen on a single use
computer. (This application is NOT intended for the internet). The menu.swf is
works like a type of juke box to help users select mp3's on the hard drive. I
have created buttons to open folders to show the mp3's, like:

on(release) {
getURL("C:\\audio_files\\jazz");
//double back slash used as escape character for folder path
}

My question is: This opens a typical window with the title bar, menu bar and
address bar. (I'm using Window XP Home). How can I retrieve the contents of the
folder (titles of the mp3's) and make a list in a flash pop-up window? The user
should be able to click on an mp3 title (in other words, these are links) and
have Winamp play it. I assume any javascript (and actionscript) will be in the
flash file because there is no html page.

My other question is: Does anyone know what actionscript I could use with a
flash button to shut down the computer?

magicMan_204
2/25/2006 12:00:00 AM
makate
2/25/2006 12:00:00 AM
NSurveyor
2/25/2006 1:45:39 PM
I don't know about getting a list of the files locally.. but making the
computer turn off is pretty simple:

'You can use a batch file... Just open up notepad, and paste in the following:

@echo off
shutdown.exe -s

And then, go to File > Save. Create a new folder named fscommand in the same
direcotry as your flash file published as a windows projector file.Save as
shutdown.bat and set the file type to "All files ".

In your flash doc,use:

fscommand("exec","shutdown.bat");

'

http://groups.google.com/group/macromedia.flash.actionscript/browse_thread/threa
d/138b7b3a8b41700d/0d9d71543786d0ce?lnk=st&rnum=7#0d9d71543786d0ce
NSurveyor
2/26/2006 12:00:00 AM
After about an hour of playing with DOS, I was able to come up with a solution
to get the files in a directory... (I'm a DOS-noob). You can check it out here:

http://swf.y11.net/experiments/filesInFolderDOS.zip

If you want to change the directory of the music folder, open up
fscommand/getFiles.bat using notepad. Replace %CD%\..\mp3s with the desired
path... note %CD% means current directory.
magicMan_204
2/26/2006 12:00:00 AM
Thanks NSurveyor: I used your suggestion for shutting down the computer and it
works!! It gives a 25 second countdown and then shuts down. That'll work.

I tried to open or save from the link for
http://swf.y11.net/experiments/filesInFolderDOS.zip. Is it busy, or maybe
another URL??
I've used this script to open the music folder:
on(release) {
getURL("C:\\audio_files\\jazz");
//double back slash used as escape character for folder path
}

I was trying to use javascript to open a window so a can give parameters.
It'll work for an html page but apparently not for a folder. What do you think?
on(release) {

getURL("javascript:menu=window.open('www.macromedia.com','','width=600,height=60
0,left=50,top=50,toolbar=No,location=No,scrollbars=Yes,status=No,resizable=No,fu
llscreen=No');menu.focus();void(0);");
}



NSurveyor
2/26/2006 2:29:38 PM
If you want instanct shut down, I believe you could use:

@echo off
shutdown.exe -s -t 0

magicMan_204
2/26/2006 6:50:52 PM
Hi NSurveyor: I like the "zero" countdown better. Thanks
I still can't open the URL
http://swf.y11.net/experiments/filesInFolderDOS.zip. Says "Page cannot be found"
When I right click and select "Save Target as", I get a message that says
"Site is unavailable or cannot be found"
Is the URL address right?
NSurveyor
2/26/2006 6:53:58 PM
Did you click on the link you made in your last post, because you added a . after the zip...

magicMan_204
2/27/2006 1:25:50 AM
The post reply had the period, but I'm clicking on the link in your post.
Can you post the code here in the message board? Or maybe another link/URL?

NSurveyor
2/27/2006 2:54:59 AM
AddThis Social Bookmark Button