Yeah sure...
/**
* Resets the ADG zoom feature to the browser-cookie stored
value or to 100%
* if there isn't one and then saves 100% to the browser-cookie.
*
* @param event The Event Object.
* @return void
*/
private function zoomMenuReset ( event : Event ) : void
{
var numIndex : Number = 0;
var strCookieScale : String = '';
var objCookieScale : Object;
objCookieScale = CookieUtil.getCookie(
'intFontScalePercentage' );
if ( objCookieScale == null )
strCookieScale = "100"; //If there's no cookie then we
default it to 100%
else
strCookieScale = objCookieScale.toString();
for each ( var Obj : Object in zoomMenu.dataProvider )
{
if ( Obj.scale == Number( strCookieScale ))
break;
else
numIndex++;
}
zoomMenu.selectedIndex = numIndex;
zoomScale.label = zoomMenu.dataProvider[
zoomMenu.selectedIndex ].label;
intFontScalePercentage = zoomMenu.dataProvider[
zoomMenu.selectedIndex ].scale;
zoomScale.close();
CookieUtil.setCookie( 'intFontScalePercentage',
intFontScalePercentage.toString(), 120 );
}
HTH,
Nick
On 27 May 2010 11:48, Nini7016 Nini7016 <[email protected]> wrote:
>
>
> Thank you very much Nick
>
> Could you give an example which shows how do you have done to restore your
> selected value please :) It will be very helpful for me :)
>
> Thank you very much
>
> ------------------------------
> To: [email protected]
> From: [email protected]
> Date: Thu, 27 May 2010 10:51:00 +0100
> Subject: Re: [flexcoders] How to store information in Cookies ???
>
>
> Hi,
>
> Cookies are pretty easy to use, I did something very similar, storing the
> selected value from a Menu.
>
> First things first, download the "CookieUtil" library and plug it into your
> project.
>
> Then you can use CookieUtil.setCookie and CookieUtil.getCookie to set and
> get the values.
>
>
> Hope that helps,
> Nick
>
> --
> Sent by Nick Middleweek ( { email: [email protected], blog:
> http://blog.middleweek.co.uk } );
>
>
>
>
> On 27 May 2010 10:14, Nini7016 Nini7016 <[email protected]> wrote:
>
>
> Hello :)
>
> I have a menu item et i would like to store these information in
> Cookies....I didn't work with Cookies before :( :( ...Do you have any
> example please please ...
> there is a code for the menu item :
> <menuitem label="Option" icon="{newproject}">
> <menuitem label="View" icon="{newproject}" >
> <menuitem label="Proprities" icon="" id="18"
> type="check" toggled="false"/>
> <menuitem label="Macroimage" icon="" id="19"
> type="check" toggled="false"/>
> <menuitem label="UDDI & Navigator" icon="" id="20"
> type="check" toggled="true"/>
> </menuitem>
> </menuitem>
>
> And when the user modifie these infomation by checking an option, i
> would like to store these information .....
>
> Any idea please ...???
>
> Thank you very much :):):)
>
>
>
>
>
>
> ------------------------------
> Vous voulez protéger votre vie privée ? La solution avec Internet Explorer
> 8 <http://clk.atdmt.com/FRM/go/232102477/direct/01/>
>
>
--
Sent by Nick Middleweek ( { email: [email protected], blog:
http://blog.middleweek.co.uk } );