dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Flash cookies??

  1. #1
    Junior Member
    Join Date
    Sep 2005
    Posts
    5

    Flash cookies??

    I created a flash header that controls 2 submenus which navigates through a static html based site. The header submenus are placed in 2 separate movie clips that change when you click the appropriate button.

    My goal is to keep the submenu content the same when a user clicks a submenu bttn and is directed to another html page and not to reset the submenu back to the initial submenu choices...

    For example:

    When you 1st land on the home page the flash header submenu is set to "Categories" submenu, the other sub menu set is "My Account" choices. If a user clicks the "My Account" button the categories submenu changes to My account submenu, when a user clicks a "My Account submenu choice he/she is directed to the appropriate page, however since the html based site refreshes itself, it sets the submenu choices back to the initial "categories" submenu, I want it to stay in the "my account" choices, how do i do this??

    I was told that this can be accomplished using flash cookies or shared objects however i have no idea how to implement it.


    thanks in advance

  2. #2
    professional amateur
    Join Date
    Apr 2001
    Location
    Amsterdam
    Posts
    187
    back to work at flashclub.nl.
    Ngezi


  3. #3
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    Feel free to use my Cookie class: http://svn.ydekproductions.com/codeb.../net/Cookie.as

    Basically you can use it like so:
    PHP Code:
    var c:Cookie = new Cookie("site.com_settings");
    c.setVal("settingA""fantastic");

    trace(c.getVal("settingA")); 
    that code would set a cookie called "site.com_settings", and set a variable called "settingA" to a value of "fantastic".

    The benefit of this is that that cookie will be saved on their computer so you can get that "settingA" variable at any point.

    Let me know if you have any questions!

  4. #4
    professional amateur
    Join Date
    Apr 2001
    Location
    Amsterdam
    Posts
    187
    That looks like a simple enough class for you wari7.
    just be carefull to not start using pieces of code you don't understand.
    (read the tutorial to understand what a shared object is anyway )

    Ngezi
    back to work at flashclub.nl.
    Ngezi


  5. #5
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    Yes, you are right, it's a good idea to understand the code you are using... but isn't that the point of using other classes and engines? Do you understand all the physics behind the e fisix engine? Or the 3d math behind papervision?

    I know those are extreme examples, but im happy if i get a piece of code that just gets the job done first, then if i have time or the will-power, ill go back and check it out and see whats going on.

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