A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: .txt file from projector (without plugin)

  1. #1
    Modding with Class JabezStone's Avatar
    Join Date
    Aug 2000
    Location
    Grand Rapids, MI
    Posts
    2,008
    OK, here's the idea and my somewhat failed attempt...

    use FScommand to execute command.com, thus creating a .txt file to the user's hard drive.
    After file is created, the stored variables can be later referenced for use in the standalone.

    reason for this? Here's one... A user is navigating through your CD and wants to "bookmark" where he is for use later in a couple days when he has more time. He clicks a "bookmark" button, which creates a .txt file with a variable denoting the section of the movie he is in. A couple days later he inserts the CD, then chooses "Go to bookmark" from the movie's start page. At this point, the movie references the created .txt file for the variable "bookmark" and takes the user to that place in the movie. This would be great for instructional CDs that will be used over a period of days or weeks (sessions).

    Now, here's my code:

    fscommand ("exec", "command.com" add chr(9) add "/c" add chr(9) add "echo off" add chr(9)add "bookmark=this^is^where^you'd^store^the^locati on" add ">c:\bookmark.txt");

    It seems to me that this should work, but for some reason it doesn't. I am getting a "file creation error" from the command line. If there are any suggestions, I'd love to hear them!

    Regards,

    Jabez

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    Umm.. Suggestion #1
    Search the board.. I've read that it works.. I just haven't tried it yet.. (heard nasty things about MS-DOS window or something)

    Suggestion #2
    Use my program (Flash Beta Tools 4) if you haven't already..
    http://www.flashkit.com/board/showth...threadid=20493

  3. #3
    Modding with Class JabezStone's Avatar
    Join Date
    Aug 2000
    Location
    Grand Rapids, MI
    Posts
    2,008

    true, true

    I have successfully gotten this command to work, however you are correct...

    when FScommand executes the command.com, the dos window pops up (long enough to write the text file), then disappears. On most systems, this will cause the whole screen to go black for about a second. I guess if this method is to be used, one should warn the user that their screen may flicker briefly.

    Master,
    I have not used your app yet, but I have downloaded it. Does the function to write text files in your app cause any type of DOS screen to apear?

    regards,

    Jabez

  4. #4
    Modding with Class JabezStone's Avatar
    Join Date
    Aug 2000
    Location
    Grand Rapids, MI
    Posts
    2,008

    My Solution

    This is the code I used to make it work for me...

    on (release) {
    fscommand ("exec", "command.com\t/c\techo\\bookmark=thisiswhereyoustorethelocation>c :\\bookmark.txt");
    }

    Put this action on a button and you are all set. You can also get creative by dynamically setting the variable "bookmark" in your movie and then placing that generated variable into the above command.

    Jabez

    Note:this code was used in Flash5... don't know how it works in F4

  5. #5
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    its real fickle.

    I must Access the command with:
    C:\COMMAND.COM

    Based on a Flash 4 SWF- I'll see if I can get this puppy to work on a Flash 4 based proj.

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    No it doesn't use a MS-DOS window that would be pointless..

    Not to mention that I'm not sure the command.com stuff would work on all implementations of windows (unlike my program) specifically there might be problems on Windows ME (DOS was removed) and Windows 2000

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