A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: FlashGuru ? Any news with XML Cookes ?

  1. #1
    The Supreme Shaman and Keeper of Polar Lights
    Join Date
    Apr 2000
    Posts
    1,175
    Hi FlashGuru !

    Sorry i can't connect to where-here last few weeks...
    Is there any news for that subject ?

    2All others: There was post about hidden Flash xml object feature, and i beleive in it, because inside flash5.exe it is possible to find words like GetCookie, setCookie, cookieloaded, cookiePrefs and Save NewDashBoardCookie.

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881

    yes ilya

    heres the biz:

    Good news - there IS an undocumented cookie object. I'll give you the syntax in a bit.

    Bad news - it is for use ONLY in the Flash 5 application. It works with the player that is embedded inside the Flash 5 app - invoked during Test Movie, in Smart Clip custom UIs and in the Dashboard.

    It does not work in a browser. Period. If you want a browser cookie, you must use JavaScript. Period.

    Syntax:

    Cookie.setCookie(data);

    Creates an XML document in the Flash 5>Mmfdata folder. The contents of the document are in the parentheses above. You can store a string ("hello there") or you could certainly store XML data.

    myVariable = Cookie.getCookie();

    Assigns the cookie's contents to your variable. The cookie is read in as XML.

    The title of the cookie file is generated based on the name of the file that created it. You do not have control over what the name of the file is, or where it's stored.

    Why is this object useful? Perhaps when making custom Smart Clip UIs. I don't think it's of much use to most people, but you are welcome to brainstorm cool uses of it.

    Hope that helps!

  3. #3
    The Supreme Shaman and Keeper of Polar Lights
    Join Date
    Apr 2000
    Posts
    1,175
    Hi !

    Hope was so near
    In any way thanks It is one more thing for experimenting with it

  4. #4
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    yeah still useful to know!

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Posts
    130
    Howdy,
    <flashGuru said>
    It does not work in a browser. Period. If you want a browser cookie, you must use JavaScript. Period.

    So does this only work in the Flash development studio or can the xml cookies be put to work in a non-browser based Flash production like stand alone player or projector?

  6. #6
    Senior Member
    Join Date
    Jul 2000
    Posts
    261
    Wow, FlashGuru. Your answer looks so... familiar. It's almost as if I wrote it myself!

    Matt

  7. #7
    Senior Member
    Join Date
    Jul 2000
    Posts
    261
    Originally posted by weinham
    So does this only work in the Flash development studio or can the xml cookies be put to work in a non-browser based Flash production like stand alone player or projector?
    The cookie that we're talking about is only a feature (undocumented) in the player that's embedded inside the Flash 5 application. It's not a feature of any other versions of the player - projector, standalone, browser.

    Do you need to make a local cookie file for a projector? Tell me. I could have an answer for you.

    Matt

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Posts
    130
    Originally posted by Matt Wobensmith
    Do you need to make a local cookie file for a projector? Matt
    Sort of. I'd like a hack where I can write an xml string to a text file on the server. I'd include a date/time stamp associated with the userName. At login I'd compare now vs. then and use that to decide what "new" info to show them. Then I use some functions to carry stats about the user while they're visiting. But it's a poor substitue for a real cookie.

    This is for a projector, not a swf in the browser. Browser bad. Standalone good. I'm interested but just as a curiosity right now. Got hands full w/ trying to make the bomb shared-library/attachMovie() project in a client running as a projector served up.... wait, different discussion. Yeah, I'm interested!

  9. #9
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    matt it was your answer!

  10. #10
    Senior Member
    Join Date
    Jul 2000
    Posts
    261
    Flashguru, I was just teasing you.

    No problems.

    Matt

  11. #11
    Senior Member
    Join Date
    Jul 2000
    Posts
    261
    Disclaimer:
    The following is *undocumented*, *unsupported* and not guaranteed at all to work in all cases. It is also very possibly something that will be removed in future versions of the program. So, do not rely on this feature to stick around. I'm offering it because it may help some of you to get projects done better.

    Tip:
    On Windows, projector, ONLY, you can save the contents of the main timeline's variables into a text file. The syntax:

    fscommand ("save", "filename.txt");

    This is a big data dump, from the main timeline only.

    Obviously, then the thing to do is to use loadVariables to get that data back into the movie at any time.

    If you reprint this message, you must print the disclaimer. If it breaks on you, or if you become too dependant on it working in the future, don't complain, you were warned.

    There's not much else I can say about this "feature", so I'd appreciate people not asking too many questions about it. If you need to use it, now you can. If you don't know how, you probably don't need it.

    Matt

  12. #12
    Senior Member
    Join Date
    Sep 2000
    Posts
    130
    Originally posted by Matt Wobensmith
    Disclaimer:
    The following is *undocumented*, *unsupported* and not guaranteed at all to work in all cases. It is also very possibly something that will be removed in future versions of the program. So, do not rely on this feature to stick around. I'm offering it because it may help some of you to get projects done better.
    fscommand ("save", "filename.txt");
    Thanks for this caution. It'd be nice if the feature stuck around, it's easier than writing...

    fscommand ("exec", "command.com" add chr(9) add "/c" add chr(9) add "echo" add chr(9) add "txtfileText=" add inputText add ">c:\\weinham.txt");

    The only difference I notice is that "save" doesn't cause a commandline window to pop up while "exec" does cause a commandline window to flash on screen for a second. Is there a way to use "exec" w/out popping up a Command Line window?

  13. #13
    You cant really start it invisible, but you can make it minimized to start with. Use the "start /MIN" command along with the "cmd /C"

    try in a command window (dos window)
    cmd /C echo hello > c:\out.txt

    now try this in a command window
    start /MIN cmd /C "echo hello world > c:\out.txt"

    it should run without window interference but with the same results




  14. #14
    Oh,

    this was ran under Windows 2000

    use command.com if cmd.exe doesnt work



  15. #15
    Senior Member
    Join Date
    Sep 2000
    Posts
    130
    Ah, Totally, I'm using Win2K to develop.
    Big Help!
    Thanks!

  16. #16
    What I want to do is output XML to files using the cmd or command. But, I cant seem to output both the QUOTE (") and SPACE and LEFT (<) and RIGHT (>) symbols on the same line. If you have a way to do that would you share?

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