1 Reply Latest reply on Jun 7, 2006 1:40 PM by Newsgroup_User

    Flash Actionscript On A Button

    i_am_captivate Level 1
      Hello,

      I was wondering, what actionscript would to open a local file on my computer?

      For example, when I click on the Flash button, I want to open a text file that is stored on my machine.
      The complicated part is that there is javascript on the button as well...

      My code is attached, if anyone could please tell me how to open this file (And I need to open it with javascript because I am using it with another movie that has javascript to close the movie) open my computer, it would be greatly appreciated.

      Thanks

      Doug
        • 1. Re: Flash Actionscript On A Button
          Level 7
          You can add a line and use XML, LoadVars, loadVariablesNum or loadVarables.
          These will work if you publish as a projector since it is reading from the
          local drive. If you are publishing to play in a Web Browser, you cannot read
          from the local drive. You need to read from a web server.

          LoadVars, loadVariablesNum and loadVarables require the file data structure
          to follow url encoded format you can see that the loadVariables doc ref
          below.

          XML require XML file structure.

          The examples in the Docs provde the code:

          XML: http://livedocs.macromedia.com/flash/8/main/00002872.html

          LoadVars: http://livedocs.macromedia.com/flash/8/main/00002329.html

          loadVarables: http://livedocs.macromedia.com/flash/8/main/00001741.html

          loadVariablesNum: http://livedocs.macromedia.com/flash/8/main/00001742.html

          --
          Lon Hosford
          www.lonhosford.com
          Flash, Actionscript and Flash Media Server examples:
          http://flashexamples.hosfordusa.com
          May many happy bits flow your way!
          "imjustabeginner" <webforumsuser@macromedia.com> wrote in message
          news:e672ng$m4$1@forums.macromedia.com...
          Hello,

          I was wondering, what actionscript would to open a local file on my
          computer?

          For example, when I click on the Flash button, I want to open a text file
          that
          is stored on my machine.
          The complicated part is that there is javascript on the button as well...

          My code is attached, if anyone could please tell me how to open this file
          (And
          I need to open it with javascript because I am using it with another movie
          that
          has javascript to close the movie) open my computer, it would be greatly
          appreciated.

          Thanks

          Doug

          on (release) {
          getURL
          ("javascript:NewWindow=window.open'c:\textfile.txt','newWin','width=1024,height=
          768,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,ful
          lscreen=Yes');NewWindow.focus();void(0);");
          }