<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jandersonfc &#187; Cookie</title>
	<atom:link href="http://www.jandersonfc.com/tag/cookie/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jandersonfc.com</link>
	<description>Apenas mais um #soudev</description>
	<lastBuildDate>Fri, 16 Dec 2011 20:02:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SharedObjects – Cookie para sua app flex</title>
		<link>http://www.jandersonfc.com/sharedobjects-cookie-para-sua-app-flex/</link>
		<comments>http://www.jandersonfc.com/sharedobjects-cookie-para-sua-app-flex/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 01:29:54 +0000</pubDate>
		<dc:creator>jandersonfc</dc:creator>
				<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Cookie]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[SharedOjects]]></category>

		<guid isPermaLink="false">http://www.saberprogramar.com/blog/?p=418</guid>
		<description><![CDATA[Se você procura uma maneira de usar Cookie no flex o SharedObjects pode ser útil, para quem não sabe o SharedObjects é muito fácil de usar e possui essas Características: Assim como o Cookie é gerado um arquivo na máquina do usuário final; Tem extensão .sol; Não é Cookie... não adianta “limpar o Cookie”(sem piadinhas [...]]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><p class="western" style="margin-bottom: 0cm;">Se você procura uma maneira de usar Cookie no flex o SharedObjects pode ser útil, para quem não sabe o SharedObjects é muito fácil de usar e possui essas Características:</p>
<ol>
<li>
<p class="western" style="margin-bottom: 0cm;">Assim como o Cookie é gerado um arquivo na máquina do usuário final;</p>
</li>
<li>
<p class="western" style="margin-bottom: 0cm;">Tem extensão .sol;</p>
</li>
<li>
<p class="western" style="margin-bottom: 0cm;">Não é Cookie... não adianta “limpar o Cookie”(sem piadinhas ao ler essa frase <img src='http://www.jandersonfc.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile SharedObjects – Cookie para sua app flex" class='wp-smiley' title="SharedObjects – Cookie para sua app flex" />  ) do navegador... para limpar tem que ser programado e inserido na aplicação flex... no caso usando o método clear() do objeto instanciado como SharedObjects;</p>
</li>
<li>
<p class="western" style="margin-bottom: 0cm;">Assim como Cookie o usuário final pode bloquear o SharedObjects ou limitar seu tamanho;</p>
</li>
<li>
<p class="western" style="margin-bottom: 0cm;">pode ser guardar Objetos complexo nesse arquivo...só não pode ter métodos.</p>
</li>
</ol>
<p class="western" style="margin-bottom: 0cm;">Vou mostrar um exemplo simples de como usar essa classe, a idéia é fazer uma espécie de Profiles no Flex, o usuário tem 3 states e o último que ele se encontrava antes de fechar o navegador quero que seja aberto. Vamos ao simples código:</p>
<p class="western" style="margin-bottom: 0cm;">Application.mxml</p>
<div class="igBar"><span id="lxml-3"><a href="#" onclick="javascript:showPlainTxt('xml-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-3">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?--&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">creationComplete=&quot;init()&quot; viewSourceURL=&quot;srcview/index.html&quot;<span style="color: #ddbb00;">&amp;gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;nbsp;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;nbsp;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p style="margin-bottom: 0cm;">viu como é simples!</p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showPlainTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">profile = SharedObject.<span style="">getLocal</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"profile"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p style="margin-bottom: 0cm;" align="LEFT">é onde atribuímos o valor do objeto profile, SharedObject.getLocal procura se existe um arquivo com esse nome e pega os valores armazenados no mesmo, se não existe neste momento é criado.</p>
<p style="margin-bottom: 0cm;" align="LEFT">O resto é bem didático vamos nos poupar..rs olha esse exemplo funcionando logo abaixo:</p>
<p><object width="400" height="300" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://saberprogramar.com/flex/ProfileFlex/ProfileFlex.swf" /><embed width="400" height="300" type="application/x-shockwave-flash" src="http://saberprogramar.com/flex/ProfileFlex/ProfileFlex.swf" /></object></p>
<p style="margin-bottom: 0cm;" align="LEFT">faz um teste aí..muda de state Principal para 2 ou 3...fecha o navegador..acesse novamente esse post e você vai perceber que vai abrir no state que você estava por último <img src='http://www.jandersonfc.com/wp-includes/images/smilies/icon_wink.gif' alt="icon wink SharedObjects – Cookie para sua app flex" class='wp-smiley' title="SharedObjects – Cookie para sua app flex" /> </p>
<p style="margin-bottom: 0cm;" align="LEFT">Então fica aí uma dica de uso do SharedObject <img src='http://www.jandersonfc.com/wp-includes/images/smilies/icon_wink.gif' alt="icon wink SharedObjects – Cookie para sua app flex" class='wp-smiley' title="SharedObjects – Cookie para sua app flex" /> </p>
<p style="margin-bottom: 0cm;">Cumps.</p>
</div><div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.jandersonfc.com/sharedobjects-cookie-para-sua-app-flex/">{lang: 'pt-BR'}</g:plusone></div>Similar Posts:<ul><li><a href="http://www.jandersonfc.com/dica1-flex-loop-que-tal-repeater/" rel="bookmark" title="01/09/2009">#Dica1 FLEX &#8211; loop? que tal Repeater?</a></li>

<li><a href="http://www.jandersonfc.com/tirar-acentos-em-flex/" rel="bookmark" title="22/01/2009">Tirar Acentos em Flex</a></li>

<li><a href="http://www.jandersonfc.com/tabnavigator-avancado-em-flex/" rel="bookmark" title="07/11/2008">TabNavigator Avançado em flex (AdvanceTabNavigator)</a></li>

<li><a href="http://www.jandersonfc.com/tutorial-basico-swiz-framework-1-0/" rel="bookmark" title="26/02/2011">Tutorial Básico Swiz Framework 1.0</a></li>

<li><a href="http://www.jandersonfc.com/pegar-codigo-fonte-de-sites-remotos/" rel="bookmark" title="18/04/2009">Pegar Código Fonte de Sites Remotos</a></li>
</ul><!-- Similar Posts took 5.964 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.jandersonfc.com/sharedobjects-cookie-para-sua-app-flex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

