<?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>Flex Примеры, Adobe Flex, Флекс</title>
	<atom:link href="http://flexcookbook.ru/feed/" rel="self" type="application/rss+xml" />
	<link>http://flexcookbook.ru</link>
	<description>Изучаем Flex. Примеры, статьи, рецепты ...</description>
	<lastBuildDate>Wed, 13 May 2009 08:08:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Как сохранить сортировку в DataGrid при изменении DataProvider (Flex)</title>
		<link>http://flexcookbook.ru/2009/05/flex-keeping-the-sort-on-a-datagrid-when-you-change-the-dataprovider/</link>
		<comments>http://flexcookbook.ru/2009/05/flex-keeping-the-sort-on-a-datagrid-when-you-change-the-dataprovider/#comments</comments>
		<pubDate>Wed, 13 May 2009 08:07:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[Sort]]></category>
		<category><![CDATA[COLLECTION_CHANGE]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=63</guid>
		<description><![CDATA[Как сохранить пользовательскую сортировку после обновления данных в Datagrid при помощи события mx.events.CollectionEvent.COLLECTION_CHANGE и свойства sort ArrayCollection [Copy to clipboard][-]View CodeACTIONSCRIPT1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 //Установим [...]]]></description>
			<content:encoded><![CDATA[<p>Как сохранить пользовательскую сортировку после обновления данных в Datagrid при помощи события mx.events.CollectionEvent.COLLECTION_CHANGE и свойства sort ArrayCollection<br />
<span id="more-63"></span></p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('63code2'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('632');">[<span id="632_symbol">-</span>]</a></div><div class="codebox_left"><span id="l63code2"><a href="#" onclick="javascript:showCodeTxt('63code2'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr id="632"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code" id="63code2"><pre class="actionscript"><span style="color: #808080; font-style: italic;">//Установим слушателя события COLLECTION_CHANGE</span>
dataGrid.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>mx.<span style="color: #006600;">events</span>.<span style="color: #006600;">CollectionEvent</span>.<span style="color: #006600;">COLLECTION_CHANGE</span>, onDataGridDataChange, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> currentSort:mx.<span style="color: #006600;">collections</span>.<span style="color: #0066CC;">Sort</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onDataGridDataChange<span style="color: #66cc66;">&#40;</span>evt:CollectionEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
                <span style="color: #808080; font-style: italic;">//получим ссылку на данные</span>
                <span style="color: #000000; font-weight: bold;">var</span> ac:ArrayCollection = dataGrid.<span style="color: #006600;">dataProvider</span> as ArrayCollection;
                <span style="color: #808080; font-style: italic;">//установим слушателя на событие изменения коллекции</span>
                ac.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>CollectionEvent.<span style="color: #006600;">COLLECTION_CHANGE</span>, onCollectionChanged,<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
                <span style="color: #808080; font-style: italic;">//если сортировка была до изменения данных, установим ее</span>
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>currentSort <span style="color: #66cc66;">!</span>= <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    ac.<span style="color: #0066CC;">sort</span> = currentSort;
                    ac.<span style="color: #006600;">refresh</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onCollectionChanged<span style="color: #66cc66;">&#40;</span>evt:CollectionEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>evt.<span style="color: #006600;">kind</span> == CollectionEventKind.<span style="color: #006600;">REFRESH</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> ac:ArrayCollection = evt.<span style="color: #006600;">currentTarget</span> as ArrayCollection;
                       <span style="color: #808080; font-style: italic;">//запомним текущую сортировку</span>
		currentSort = ac.<span style="color: #0066CC;">sort</span>;
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://justinjmoses.wordpress.com/2008/06/26/flex-keeping-the-sort-on-a-datagrid-when-you-change-the-dataprovider/" rel="nofollow">Оригинал решения</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2009/05/flex-keeping-the-sort-on-a-datagrid-when-you-change-the-dataprovider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Как убрать разделитель в заголовке DataGrid (Flex)</title>
		<link>http://flexcookbook.ru/2009/04/removing-the-header-separator-on-the-datagrid-control-in-flex/</link>
		<comments>http://flexcookbook.ru/2009/04/removing-the-header-separator-on-the-datagrid-control-in-flex/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 05:11:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[headerSeparatorSkin]]></category>
		<category><![CDATA[ProgrammaticSkin]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=53</guid>
		<description><![CDATA[Следующий пример о том, как убрать разделительную полосочку в заголовке DataGrid использую стиль headerSeparatorSkin. [Copy to clipboard][-]View CodeMXML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;mx:Application name=&#34;DataGrid_headerSeparatorSkin_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:DataGrid id=&#34;dataGrid&#34; headerSeparatorSkin=&#34;mx.skins.ProgrammaticSkin&#34;&#62; &#60;mx:dataProvider&#62; &#60;mx:ArrayCollection&#62; &#60;mx:Object c1=&#34;1. One&#34; c2=&#34;1. Two&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Следующий пример о том, как убрать разделительную полосочку в заголовке  DataGrid использую стиль  headerSeparatorSkin.<br />
<span id="more-53"></span></p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('53code6'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('536');">[<span id="536_symbol">-</span>]</a></div><div class="codebox_left"><span id="l53code6"><a href="#" onclick="javascript:showCodeTxt('53code6'); return false;">View Code</a>MXML</span></div></td></tr><tr id="536"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code" id="53code6"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;DataGrid_headerSeparatorSkin_test&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:DataGrid</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;dataGrid&quot;</span>
            <span style="color: #000066;">headerSeparatorSkin</span>=<span style="color: #ff0000;">&quot;mx.skins.ProgrammaticSkin&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:dataProvider<span style="font-weight: bold; color: black;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:ArrayCollection<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;1. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;2. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;3. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;4. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;5. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;6. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:ArrayCollection<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:dataProvider<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:DataGrid<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Или же можно установить стиль headerSeparatorSkin с помощью  ActionScript, как на примере ниже:</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('53code7'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('537');">[<span id="537_symbol">-</span>]</a></div><div class="codebox_left"><span id="l53code7"><a href="#" onclick="javascript:showCodeTxt('53code7'); return false;">View Code</a>MXML</span></div></td></tr><tr id="537"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code" id="53code7"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;DataGrid_headerSeparatorSkin_test&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import mx.skins.ProgrammaticSkin;</span>
&nbsp;
<span style="color: #339933;">            private function btn_click(evt:MouseEvent):void {</span>
<span style="color: #339933;">                dataGrid.setStyle(&quot;headerSeparatorSkin&quot;, ProgrammaticSkin);</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;btn&quot;</span>
            <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Set header separator skin&quot;</span>
            <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;btn_click(event);&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:DataGrid</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;dataGrid&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:dataProvider<span style="font-weight: bold; color: black;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:ArrayCollection<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;1. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;2. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;3. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;4. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;5. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;6. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:ArrayCollection<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:dataProvider<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:DataGrid<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Стиль headerSeparatorSkin также можно установить во внешнем .CSS файле или блоке Style, как показано ниже:</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('53code8'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('538');">[<span id="538_symbol">-</span>]</a></div><div class="codebox_left"><span id="l53code8"><a href="#" onclick="javascript:showCodeTxt('53code8'); return false;">View Code</a>MXML</span></div></td></tr><tr id="538"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code" id="53code8"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;DataGrid_headerSeparatorSkin_test&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Style<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        DataGrid {
            headerSeparatorSkin: ClassReference(&quot;mx.skins.ProgrammaticSkin&quot;);
        }
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Style<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:DataGrid</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;dataGrid&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:dataProvider<span style="font-weight: bold; color: black;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:ArrayCollection<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;1. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;2. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;3. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;4. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;5. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> c3=<span style="color: #ff0000;">&quot;6. Three&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:ArrayCollection<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:dataProvider<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:DataGrid<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p><a href="http://blog.flexexamples.com/2009/03/20/removing-the-header-separator-on-the-datagrid-control-in-flex/" rel="nofollow">Источник</a></p>
<p><iframe src="/examples/removing_dg_header/tst.swf" width="100%"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2009/04/removing-the-header-separator-on-the-datagrid-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Как сделать самозакрывающийся Alert (Flex)</title>
		<link>http://flexcookbook.ru/2009/04/%d0%ba%d0%b0%d0%ba-%d1%81%d0%b4%d0%b5%d0%bb%d0%b0%d1%82%d1%8c-%d1%81%d0%b0%d0%bc%d0%be%d0%b7%d0%b0%d0%ba%d1%80%d1%8b%d0%b2%d0%b0%d1%8e%d1%89%d0%b8%d0%b9%d1%81%d1%8f-alert-flex/</link>
		<comments>http://flexcookbook.ru/2009/04/%d0%ba%d0%b0%d0%ba-%d1%81%d0%b4%d0%b5%d0%bb%d0%b0%d1%82%d1%8c-%d1%81%d0%b0%d0%bc%d0%be%d0%b7%d0%b0%d0%ba%d1%80%d1%8b%d0%b2%d0%b0%d1%8e%d1%89%d0%b8%d0%b9%d1%81%d1%8f-alert-flex/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 13:56:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[PopUpManager]]></category>
		<category><![CDATA[removePopUp()]]></category>
		<category><![CDATA[Timer]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=48</guid>
		<description><![CDATA[Как сделать Alert, который закроется самостоятельно через некоторое время при помощи таймер и метода PopUpManager.removePopUp() [Copy to clipboard][-]View CodeMXML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 [...]]]></description>
			<content:encoded><![CDATA[<p>Как сделать Alert, который закроется самостоятельно через некоторое время<br />
при помощи таймер и метода  PopUpManager.removePopUp()<br />
<span id="more-48"></span></p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('48code10'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4810');">[<span id="4810_symbol">-</span>]</a></div><div class="codebox_left"><span id="l48code10"><a href="#" onclick="javascript:showCodeTxt('48code10'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4810"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code" id="48code10"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Alert_PopUpManager_removePopUp_test&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span>
        <span style="color: #000066;">initialize</span>=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
<span style="color: #339933;">            import mx.events.CloseEvent;</span>
<span style="color: #339933;">            import mx.managers.PopUpManager;</span>
&nbsp;
<span style="color: #339933;">            private var alrt:Alert;</span>
<span style="color: #339933;">            private var alrtTimer:Timer;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                alrtTimer = new Timer(5000, 1);</span>
<span style="color: #339933;">                alrtTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeAlert);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function showAlert():void {</span>
<span style="color: #339933;">                alrt = Alert.show(&quot;I'm an Alert control and I will close in 5 seconds unless closed by a user.&quot;, &quot;Self closing Alert&quot;, Alert.OK, this, alrt_close);</span>
<span style="color: #339933;">                alrtTimer.reset();</span>
<span style="color: #339933;">                alrtTimer.start();</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function alrt_close(evt:CloseEvent):void {</span>
<span style="color: #339933;">                alrtTimer.stop();</span>
<span style="color: #339933;">                lbl.text = &quot;Closed by user.&quot;;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function removeAlert(evt:TimerEvent):void {</span>
<span style="color: #339933;">                PopUpManager.removePopUp(alrt);</span>
<span style="color: #339933;">                lbl.text = &quot;Removed by application.&quot;;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Show Alert&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;showAlert();&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Label</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;lbl&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p>
<a href="http://blog.flexexamples.com/2009/04/08/creating-a-self-closing-alert-control-in-flex" ref="nofollow">Оригинал</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2009/04/%d0%ba%d0%b0%d0%ba-%d1%81%d0%b4%d0%b5%d0%bb%d0%b0%d1%82%d1%8c-%d1%81%d0%b0%d0%bc%d0%be%d0%b7%d0%b0%d0%ba%d1%80%d1%8b%d0%b2%d0%b0%d1%8e%d1%89%d0%b8%d0%b9%d1%81%d1%8f-alert-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Как загрузить файл на сервер и при этом получить ответ ) Flex</title>
		<link>http://flexcookbook.ru/2008/11/filereference-class-uploadcompletedata-event-to-capture-data-from-a-server-side-script/</link>
		<comments>http://flexcookbook.ru/2008/11/filereference-class-uploadcompletedata-event-to-capture-data-from-a-server-side-script/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 14:48:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScipt]]></category>
		<category><![CDATA[FileReference]]></category>
		<category><![CDATA[upload()]]></category>
		<category><![CDATA[uploadCompleteData.]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=46</guid>
		<description><![CDATA[В интернете довольно много примеров по тому, как использовать FileReference для отправки файла на сервер, но мало где поясняется, как же все-таки отследить дальнейшую судьбу файла. Ведь событие Event.COMPLETE возникает всего лишь при удачной отправке файла на сервер. Как узнать, удалось ли вашему серверному приложению корректно обработать файл есть еще очень хорошее событие DataEvent.UPLOAD_COMPLETE_DATA которое [...]]]></description>
			<content:encoded><![CDATA[<p>В интернете  довольно много примеров по тому, как использовать FileReference для отправки файла на сервер, но мало где поясняется, как же все-таки отследить дальнейшую судьбу файла. Ведь событие Event.COMPLETE возникает всего лишь при удачной отправке файла на сервер. Как узнать, удалось ли вашему серверному приложению корректно обработать файл<br />
<span id="more-46"></span></p>
<p>есть еще очень хорошее событие DataEvent.UPLOAD_COMPLETE_DATA<br />
которое возникает, если сервер вернул какие-то данные<br />
вот, собственно, и пример использования:</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('46code12'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4612');">[<span id="4612_symbol">-</span>]</a></div><div class="codebox_left"><span id="l46code12"><a href="#" onclick="javascript:showCodeTxt('46code12'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4612"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
</pre></td><td class="code" id="46code12"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span>
        <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span>
        <span style="color: #000066;">creationComplete</span>=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import flash.net.FileReference;</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #339933;">            private var fileRef:FileReference;</span>
<span style="color: #339933;">            private var urlReq:URLRequest;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                fileRef = new FileReference();</span>
<span style="color: #339933;">                fileRef.addEventListener(Event.SELECT, fileRef_select);</span>
<span style="color: #339933;">                fileRef.addEventListener(Event.COMPLETE, fileRef_complete);</span>
<span style="color: #339933;">                fileRef.addEventListener(IOErrorEvent.IO_ERROR, fileRef_ioError);</span>
<span style="color: #339933;">                fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, fileRef_uploadCompleteData);</span>
&nbsp;
<span style="color: #339933;">                urlReq = new URLRequest();</span>
<span style="color: #339933;">                urlReq.url = &quot;http://localhost/uploader.php&quot;;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function fileRef_uploadCompleteData(evt:DataEvent):void {</span>
<span style="color: #339933;">                //Данные с сервера, остальное -дело техники</span>
<span style="color: #339933;">                trace(evt.data)</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function start():void {</span>
<span style="color: #339933;">                fileRef.browse();</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function fileRef_select(evt:Event):void {</span>
<span style="color: #339933;">                fileRef.upload(urlReq);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function fileRef_complete(evt:Event):void {</span>
<span style="color: #339933;">                Alert.show(evt.toString(), evt.type);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function fileRef_ioError(evt:IOErrorEvent):void {</span>
<span style="color: #339933;">                Alert.show(evt.text, evt.type);</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;upload&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;Поехали();&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2008/11/filereference-class-uploadcompletedata-event-to-capture-data-from-a-server-side-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Редактирование элемента в DataGrid по двойному щелчку</title>
		<link>http://flexcookbook.ru/2008/10/datagrid_doubleclick_edit/</link>
		<comments>http://flexcookbook.ru/2008/10/datagrid_doubleclick_edit/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 13:31:39 +0000</pubDate>
		<dc:creator>undr</dc:creator>
				<category><![CDATA[ActionScipt]]></category>
		<category><![CDATA[DataGrid]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=44</guid>
		<description><![CDATA[Потребовалось изменить поведение инлайн редактора в DataGrid так , чтобы редактор активировался не по получении фокуса, а по двойному клику. [Copy to clipboard][-]View CodeACTIONSCRIPT1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 [...]]]></description>
			<content:encoded><![CDATA[<p>Потребовалось изменить поведение инлайн редактора в DataGrid так , чтобы редактор активировался не по получении фокуса, а по двойному клику.</p>
<p><span id="more-44"></span></p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('44code15'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4415');">[<span id="4415_symbol">-</span>]</a></div><div class="codebox_left"><span id="l44code15"><a href="#" onclick="javascript:showCodeTxt('44code15'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr id="4415"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
</pre></td><td class="code" id="44code15"><pre class="actionscript">package my.<span style="color: #006600;">components</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Point</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">DataGrid</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">IListItemRenderer</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">events</span>.<span style="color: #006600;">DataGridEvent</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyDataGrid <span style="color: #0066CC;">extends</span> DataGrid <span style="color: #66cc66;">&#123;</span>
	    <span style="color: #66cc66;">&#91;</span>Inspectable<span style="color: #66cc66;">&#40;</span>category=<span style="color: #ff0000;">&quot;General&quot;</span>, enumeration=<span style="color: #ff0000;">&quot;true,false&quot;</span>, defaultValue=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
	    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> doubleClickStartEdit:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> displayableColumns:<span style="color: #0066CC;">Array</span>;
	    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> displayableColumnsToColumns:<span style="color: #0066CC;">Array</span>;
	    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> MyDataGrid<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	    	<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	    	addEventListener<span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, mouseUpHandler<span style="color: #66cc66;">&#41;</span>;
	    	addEventListener<span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">DOUBLE_CLICK</span>, mouseDoubleClickHandler<span style="color: #66cc66;">&#41;</span>;
	    <span style="color: #66cc66;">&#125;</span>
	    override protected <span style="color: #000000; font-weight: bold;">function</span> mouseUpHandler<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	    	<span style="color: #000000; font-weight: bold;">var</span> tmpEditable:<span style="color: #0066CC;">Boolean</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">editable</span>;
	    	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>doubleClickStartEdit<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	    		<span style="color: #0066CC;">this</span>.<span style="color: #006600;">editable</span> = <span style="color: #000000; font-weight: bold;">false</span>;	
	    	<span style="color: #66cc66;">&#125;</span>
	    	<span style="color: #0066CC;">super</span>.<span style="color: #006600;">mouseUpHandler</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;
	    	<span style="color: #0066CC;">this</span>.<span style="color: #006600;">editable</span> = tmpEditable;
	    <span style="color: #66cc66;">&#125;</span>
	    override protected <span style="color: #000000; font-weight: bold;">function</span> mouseDoubleClickHandler<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	        <span style="color: #000000; font-weight: bold;">var</span> dataGridEvent:DataGridEvent;
	        <span style="color: #000000; font-weight: bold;">var</span> r:IListItemRenderer;
	        <span style="color: #000000; font-weight: bold;">var</span> pos:Point;
&nbsp;
	        r = mouseEventToItemRenderer<span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	        <span style="color: #0066CC;">super</span>.<span style="color: #006600;">mouseDoubleClickHandler</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>r <span style="color: #66cc66;">&amp;&amp;</span> r <span style="color: #66cc66;">!</span>= itemEditorInstance<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	            pos = itemRendererToIndices<span style="color: #66cc66;">&#40;</span>r<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>pos <span style="color: #66cc66;">&amp;&amp;</span> pos.<span style="color: #006600;">y</span> <span style="color: #66cc66;">&gt;</span>= <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&amp;&amp;</span> editable <span style="color: #66cc66;">&amp;&amp;</span> doubleClickStartEdit<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>displayableColumns<span style="color: #66cc66;">&#91;</span>pos.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">editable</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	                    dataGridEvent = <span style="color: #000000; font-weight: bold;">new</span> DataGridEvent<span style="color: #66cc66;">&#40;</span>DataGridEvent.<span style="color: #006600;">ITEM_EDIT_BEGINNING</span>, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
	                    dataGridEvent.<span style="color: #006600;">columnIndex</span> = displayableColumnsToColumns<span style="color: #66cc66;">&#91;</span>pos.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#93;</span>;
	                    dataGridEvent.<span style="color: #006600;">dataField</span> = displayableColumns<span style="color: #66cc66;">&#91;</span>pos.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">dataField</span>;
	                    dataGridEvent.<span style="color: #006600;">rowIndex</span> = pos.<span style="color: #006600;">y</span>;
	                    dataGridEvent.<span style="color: #006600;">itemRenderer</span> = r;
	                    dispatchEvent<span style="color: #66cc66;">&#40;</span>dataGridEvent<span style="color: #66cc66;">&#41;</span>;
	                <span style="color: #66cc66;">&#125;</span>
	            <span style="color: #66cc66;">&#125;</span>
	        <span style="color: #66cc66;">&#125;</span>
	    <span style="color: #66cc66;">&#125;</span>
	    override protected <span style="color: #000000; font-weight: bold;">function</span> updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:<span style="color: #0066CC;">Number</span>,
	                                                  unscaledHeight:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	    	<span style="color: #0066CC;">super</span>.<span style="color: #006600;">updateDisplayList</span><span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;
            	displayableColumns = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span>;
            	displayableColumnsToColumns = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span>;
            	<span style="color: #000000; font-weight: bold;">var</span> n:<span style="color: #0066CC;">int</span> = columns.<span style="color: #0066CC;">length</span>;
            	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> n; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>columns<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">visible</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                    	displayableColumns.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>columns<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
                    	displayableColumnsToColumns.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;
                    <span style="color: #66cc66;">&#125;</span>
            	<span style="color: #66cc66;">&#125;</span>
	    <span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>В приложении использую так:</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('44code16'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4416');">[<span id="4416_symbol">-</span>]</a></div><div class="codebox_left"><span id="l44code16"><a href="#" onclick="javascript:showCodeTxt('44code16'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4416"><td width="1%" class="line_numbers"><pre>1
</pre></td><td class="code" id="44code16"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;view:MyDataGrid</span> <span style="color: #000066;">doubleClickStartEdit</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">doubleClickEnabled</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2008/10/datagrid_doubleclick_edit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Как применить эффект при изменении размера HBox (Flex)</title>
		<link>http://flexcookbook.ru/2008/10/applying-an-effect-when-an-hbox-container-is-resized-in-flex/</link>
		<comments>http://flexcookbook.ru/2008/10/applying-an-effect-when-an-hbox-container-is-resized-in-flex/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 12:27:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HBox]]></category>
		<category><![CDATA[Примеры]]></category>
		<category><![CDATA[Эффекты]]></category>
		<category><![CDATA[resizeEffect]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=43</guid>
		<description><![CDATA[Следующий пример покажет как применить эффект при изменении размера контейнера HBox используя resizeEffect стиль/эффект [Copy to clipboard][-]View CodeMXML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;mx:Application name=&#34;HBox_resizeEffect_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:HDividedBox id=&#34;hDividedBox&#34; width=&#34;100%&#34; height=&#34;100%&#34;&#62; &#60;mx:HBox [...]]]></description>
			<content:encoded><![CDATA[<p>Следующий пример покажет как применить эффект при изменении размера контейнера  HBox<br />
используя resizeEffect стиль/эффект<br />
<span id="more-43"></span></p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('43code20'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4320');">[<span id="4320_symbol">-</span>]</a></div><div class="codebox_left"><span id="l43code20"><a href="#" onclick="javascript:showCodeTxt('43code20'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4320"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="43code20"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;HBox_resizeEffect_test&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span>
        <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:HDividedBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;hDividedBox&quot;</span>
            <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
            <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:HBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;hBox1&quot;</span>
                <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;haloGreen&quot;</span>
                <span style="color: #000066;">resizeEffect</span>=<span style="color: #ff0000;">&quot;Resize&quot;</span>
                <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
                <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:HBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;hBox2&quot;</span>
                <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;haloBlue&quot;</span>
                <span style="color: #000066;">resizeEffect</span>=<span style="color: #ff0000;">&quot;Resize&quot;</span>
                <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
                <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:HDividedBox<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/HBox_resizeEffect_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>также можно задать resizeEffect  при помощи внешнего .CSS или  блока <mx:Style /><br />
как показано ниже</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('43code21'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4321');">[<span id="4321_symbol">-</span>]</a></div><div class="codebox_left"><span id="l43code21"><a href="#" onclick="javascript:showCodeTxt('43code21'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4321"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code" id="43code21"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;HBox_resizeEffect_test&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span>
        <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Style<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        HBox {
            resizeEffect: ClassReference(&quot;mx.effects.Resize&quot;);
        }
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Style<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:HDividedBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;hDividedBox&quot;</span>
            <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
            <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:HBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;hBox1&quot;</span>
                <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;haloGreen&quot;</span>
                <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
                <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:HBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;hBox2&quot;</span>
                <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;haloBlue&quot;</span>
                <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
                <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:HDividedBox<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p>и тоже самое при помощи только ActionScript</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('43code22'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4322');">[<span id="4322_symbol">-</span>]</a></div><div class="codebox_left"><span id="l43code22"><a href="#" onclick="javascript:showCodeTxt('43code22'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4322"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code" id="43code22"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;HBox_resizeEffect_test&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span>
        <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span>
        <span style="color: #000066;">initialize</span>=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import mx.containers.HBox;</span>
<span style="color: #339933;">            import mx.containers.HDividedBox;</span>
<span style="color: #339933;">            import mx.effects.Resize;</span>
&nbsp;
<span style="color: #339933;">            private var hBox1:HBox;</span>
<span style="color: #339933;">            private var hBox2:HBox;</span>
<span style="color: #339933;">            private var hDividedBox:HDividedBox;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                hBox1 = new HBox();</span>
<span style="color: #339933;">                hBox1.percentWidth = 100;</span>
<span style="color: #339933;">                hBox1.percentHeight = 100;</span>
<span style="color: #339933;">                hBox1.setStyle(&quot;backgroundColor&quot;, &quot;haloGreen&quot;);</span>
<span style="color: #339933;">                hBox1.setStyle(&quot;resizeEffect&quot;, Resize);</span>
&nbsp;
<span style="color: #339933;">                hBox2 = new HBox();</span>
<span style="color: #339933;">                hBox2.percentWidth = 100;</span>
<span style="color: #339933;">                hBox2.percentHeight = 100;</span>
<span style="color: #339933;">                hBox2.setStyle(&quot;backgroundColor&quot;, &quot;haloBlue&quot;);</span>
<span style="color: #339933;">                hBox2.setStyle(&quot;resizeEffect&quot;, Resize);</span>
&nbsp;
<span style="color: #339933;">                hDividedBox = new HDividedBox();</span>
<span style="color: #339933;">                hDividedBox.percentWidth = 100;</span>
<span style="color: #339933;">                hDividedBox.percentHeight = 100;</span>
<span style="color: #339933;">                hDividedBox.addChild(hBox1);</span>
<span style="color: #339933;">                hDividedBox.addChild(hBox2);</span>
<span style="color: #339933;">                addChild(hDividedBox);</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p><a href="http://blog.flexexamples.com/2008/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/">Источник</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2008/10/applying-an-effect-when-an-hbox-container-is-resized-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Создание картинки из base64 строки (Flex)</title>
		<link>http://flexcookbook.ru/2008/09/displaying-an-image-saved-as-a-base64-encoded-string-in-flex-3/</link>
		<comments>http://flexcookbook.ru/2008/09/displaying-an-image-saved-as-a-base64-encoded-string-in-flex-3/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 14:54:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Image]]></category>
		<category><![CDATA[Примеры]]></category>
		<category><![CDATA[Base64Decoder]]></category>
		<category><![CDATA[decode()]]></category>
		<category><![CDATA[load()]]></category>
		<category><![CDATA[toByteArray()]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=42</guid>
		<description><![CDATA[Как отобразить картинку вместо ее представления в виде base64 ? об этом ниже Собственно нам потребуются класс mx.utils.Base64Decoder методы decode() , toByteArray(), класс mx.controls.Image метод load() ну и сама base64 строка [Copy to clipboard][-]View CodeMXML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 [...]]]></description>
			<content:encoded><![CDATA[<p>Как отобразить картинку вместо ее представления в виде base64 ?<br />
об этом ниже<br />
<span id="more-42"></span><br />
Собственно нам потребуются<br />
класс  mx.utils.Base64Decoder методы decode() , toByteArray(),<br />
класс mx.controls.Image  метод load()<br />
ну и сама base64 строка</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('42code24'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4224');">[<span id="4224_symbol">-</span>]</a></div><div class="codebox_left"><span id="l42code24"><a href="#" onclick="javascript:showCodeTxt('42code24'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4224"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code" id="42code24"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span>
        <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span>
        <span style="color: #000066;">creationComplete</span>=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import mx.utils.Base64Decoder;</span>
&nbsp;
<span style="color: #339933;">            private var base64Dec:Base64Decoder;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                var byteArr:ByteArray;</span>
&nbsp;
<span style="color: #339933;">                base64Dec = new Base64Decoder();</span>
<span style="color: #339933;">                base64Dec.decode(logo);</span>
&nbsp;
<span style="color: #339933;">                byteArr = base64Dec.toByteArray();</span>
&nbsp;
<span style="color: #339933;">                img.load(byteArr);</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:String</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;logo&quot;</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;logo.txt&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Form</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:FormItem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;image:&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Image</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;img&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:FormItem<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:FormItem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;source:&quot;</span>
                <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
                <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:TextArea</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;textArea&quot;</span>
                    <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;{logo}&quot;</span>
                    <span style="color: #000066;">editable</span>=<span style="color: #ff0000;">&quot;false&quot;</span>
                    <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
                    <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:FormItem<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Form<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Base64Decoder_decode_test/bin/main.html" width="100%" height="500"></iframe></p>
<p><a href="http://blog.flexexamples.com/2008/03/17/displaying-an-image-saved-as-a-base64-encoded-string-in-flex-3/">Источник</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2008/09/displaying-an-image-saved-as-a-base64-encoded-string-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Звуковое сопровождение алерта (Alert) Flex</title>
		<link>http://flexcookbook.ru/2008/09/playing-a-sound-effect-when-an-alert-control-is-displayed-in-flex/</link>
		<comments>http://flexcookbook.ru/2008/09/playing-a-sound-effect-when-an-alert-control-is-displayed-in-flex/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 12:32:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[Примеры]]></category>
		<category><![CDATA[creationCompleteEffect]]></category>
		<category><![CDATA[SoundEffect]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=41</guid>
		<description><![CDATA[Пример ниже расскажет о том, как проиграть встроенный MP3 при отображении алерта (Alert) используя creationCompleteEffect стиль/эффект [Copy to clipboard][-]View CodeMXML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 [...]]]></description>
			<content:encoded><![CDATA[<p>Пример ниже расскажет о том, как проиграть встроенный MP3  при отображении алерта (Alert)<br />
используя  creationCompleteEffect стиль/эффект<br />
<span id="more-41"></span></p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('41code27'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4127');">[<span id="4127_symbol">-</span>]</a></div><div class="codebox_left"><span id="l41code27"><a href="#" onclick="javascript:showCodeTxt('41code27'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4127"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code" id="41code27"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Alert_creationCompleteEffect_test_2&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span>
        <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/iconCritical.png&quot;)]</span>
<span style="color: #339933;">            private var IconCritical:Class;</span>
&nbsp;
<span style="color: #339933;">            private function showAlert():void {</span>
<span style="color: #339933;">                var message:String = &quot;The quick brown fox jumped over the lazy dog.&quot;;</span>
<span style="color: #339933;">                var title:String = &quot;Alert title&quot;;</span>
<span style="color: #339933;">                var a:Alert = Alert.show(message,</span>
<span style="color: #339933;">                            title,</span>
<span style="color: #339933;">                            Alert.OK,</span>
<span style="color: #339933;">                            null,</span>
<span style="color: #339933;">                            null,</span>
<span style="color: #339933;">                            IconCritical);</span>
<span style="color: #339933;">                a.status = Capabilities.version;</span>
<span style="color: #339933;">                a.isPopUp = false;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Style<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        Alert {
            creationCompleteEffect: ding;
        }
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Style<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:SoundEffect</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;ding&quot;</span>
            <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;@Embed('assets/ding.mp3')&quot;</span>
            <span style="color: #000066;">useDuration</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span> 
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;button&quot;</span>
            <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Launch Alert&quot;</span>
            <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;showAlert();&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_2/bin/main.html" width="100%" height="200"></iframe></p>
<p>также можно внедрить MP3, создать SoundEffect и установить creationCompleteEffect в ActionScript, как в следующем примере:</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('41code28'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('4128');">[<span id="4128_symbol">-</span>]</a></div><div class="codebox_left"><span id="l41code28"><a href="#" onclick="javascript:showCodeTxt('41code28'); return false;">View Code</a>MXML</span></div></td></tr><tr id="4128"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code" id="41code28"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Alert_creationCompleteEffect_test_2&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span>
        <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span>
        <span style="color: #000066;">initialize</span>=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import mx.effects.SoundEffect;</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/iconCritical.png&quot;)]</span>
<span style="color: #339933;">            private const IconCritical:Class;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/ding.mp3&quot;)]</span>
<span style="color: #339933;">            private const DingSoundEffect:Class;</span>
&nbsp;
<span style="color: #339933;">            private var ding:SoundEffect;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                ding = new SoundEffect();</span>
<span style="color: #339933;">                ding.source = DingSoundEffect;</span>
<span style="color: #339933;">                ding.useDuration = false;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function showAlert():void {</span>
<span style="color: #339933;">                var message:String = &quot;The quick brown fox jumped over the lazy dog.&quot;;</span>
<span style="color: #339933;">                var title:String = &quot;Alert title&quot;;</span>
<span style="color: #339933;">                var a:Alert = Alert.show(message,</span>
<span style="color: #339933;">                            title,</span>
<span style="color: #339933;">                            Alert.OK,</span>
<span style="color: #339933;">                            null,</span>
<span style="color: #339933;">                            null,</span>
<span style="color: #339933;">                            IconCritical);</span>
<span style="color: #339933;">                a.setStyle(&quot;creationCompleteEffect&quot;, ding);</span>
<span style="color: #339933;">                a.status = Capabilities.version;</span>
<span style="color: #339933;">                a.isPopUp = false;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;button&quot;</span>
            <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Launch Alert&quot;</span>
            <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;showAlert();&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p><a href="http://blog.flexexamples.com/2008/09/10/playing-a-sound-effect-when-an-alert-control-is-displayed-in-flex/">Источник</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2008/09/playing-a-sound-effect-when-an-alert-control-is-displayed-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Как определить слушает ли элемент какое-то событие</title>
		<link>http://flexcookbook.ru/2008/08/determining-if-an-item-is-listening-for-a-specific-even/</link>
		<comments>http://flexcookbook.ru/2008/08/determining-if-an-item-is-listening-for-a-specific-even/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 12:28:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScipt]]></category>
		<category><![CDATA[Обработка событий]]></category>
		<category><![CDATA[addEventListener()]]></category>
		<category><![CDATA[hasEventListener()]]></category>
		<category><![CDATA[removeEventListener()]]></category>
		<category><![CDATA[willTrigger()]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=39</guid>
		<description><![CDATA[Пример ниже о том, как реагирует ли (например Button) на какое-нибудь событие например (FlexEvent.BUTTON_DOWN) при помощи методов hasEventListener() и willTrigger() Согласно документации Flex 3, разница между методами hasEventListener() и willTrigger() состоит в том, что метод hasEventListener() рассматривает только объект которому он принадлежит, а метод willTrigger() рассматривает всю схему обработки событий заданного типа [Copy to clipboard][-]View [...]]]></description>
			<content:encoded><![CDATA[<p>Пример ниже о том, как реагирует ли (например Button)  на какое-нибудь событие<br />
например (FlexEvent.BUTTON_DOWN)<br />
при помощи методов hasEventListener()  и  willTrigger()<br />
<span id="more-39"></span><br />
Согласно  <a href="http://livedocs.adobe.com/flex/3/langref/flash/events/EventDispatcher.html#hasEventListener()">документации</a>  Flex 3, разница между методами hasEventListener()  и willTrigger() состоит в том, что метод  hasEventListener() рассматривает только объект которому он принадлежит,<br />
а метод willTrigger() рассматривает всю схему обработки событий заданного типа</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('39code30'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('3930');">[<span id="3930_symbol">-</span>]</a></div><div class="codebox_left"><span id="l39code30"><a href="#" onclick="javascript:showCodeTxt('39code30'); return false;">View Code</a>MXML</span></div></td></tr><tr id="3930"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
</pre></td><td class="code" id="39code30"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Button_willTrigger_buttonDown_test&quot;</span>
        <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span>
        <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span>
        <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
<span style="color: #339933;">            import mx.events.FlexEvent;</span>
<span style="color: #339933;">            import mx.utils.StringUtil;</span>
&nbsp;
<span style="color: #339933;">            private function verify_click():void {</span>
<span style="color: #339933;">                var listener:Boolean = btn.hasEventListener(FlexEvent.BUTTON_DOWN);</span>
<span style="color: #339933;">                var trigger:Boolean = btn.willTrigger(FlexEvent.BUTTON_DOWN);</span>
<span style="color: #339933;">                var str:String = &quot;hasEventListener() = {0}{1}willTrigger() = {2}&quot;;</span>
<span style="color: #339933;">                Alert.show(StringUtil.substitute(str, listener, &quot;n&quot;, trigger));</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function addEventListener_click():void {</span>
<span style="color: #339933;">                btn.addEventListener(FlexEvent.BUTTON_DOWN, btn_buttonDown);</span>
<span style="color: #339933;">                verify_click();</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function removeEventListener_click():void {</span>
<span style="color: #339933;">                btn.removeEventListener(FlexEvent.BUTTON_DOWN, btn_buttonDown);</span>
<span style="color: #339933;">                verify_click();</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function btn_buttonDown(evt:FlexEvent):void {</span>
<span style="color: #339933;">                Alert.show(evt.type);</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:ApplicationControlBar</span> <span style="color: #000066;">dock</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Verify listeners&quot;</span>
                <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;verify_click();&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Spacer</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;addEventListener()&quot;</span>
                <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;addEventListener_click();&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;removeEventListener()&quot;</span>
                <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;removeEventListener_click();&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:ApplicationControlBar<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;btn&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Button&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p><a href="http://blog.flexexamples.com/2008/08/20/determining-if-an-item-is-listening-for-a-specific-event">Источник</a></p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Button_willTrigger_buttonDown_test/bin/main.html" width="100%" height="200"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2008/08/determining-if-an-item-is-listening-for-a-specific-even/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Как создать редактор (itemEditor) в DataGrid  с двумя полями</title>
		<link>http://flexcookbook.ru/2008/08/%d0%ba%d0%b0%d0%ba-%d1%81%d0%be%d0%b7%d0%b4%d0%b0%d1%82%d1%8c-%d1%80%d0%b5%d0%b4%d0%b0%d0%ba%d1%82%d0%be%d1%80-itemeditor-%d0%b2-datagrid-%d1%81-%d0%b4%d0%b2%d1%83%d0%bc%d1%8f-%d0%bf%d0%be%d0%bb/</link>
		<comments>http://flexcookbook.ru/2008/08/%d0%ba%d0%b0%d0%ba-%d1%81%d0%be%d0%b7%d0%b4%d0%b0%d1%82%d1%8c-%d1%80%d0%b5%d0%b4%d0%b0%d0%ba%d1%82%d0%be%d1%80-itemeditor-%d0%b2-datagrid-%d1%81-%d0%b4%d0%b2%d1%83%d0%bc%d1%8f-%d0%bf%d0%be%d0%bb/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 08:20:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[TextInput]]></category>
		<category><![CDATA[ItemEditor]]></category>

		<guid isPermaLink="false">http://flexcookbook.ru/?p=38</guid>
		<description><![CDATA[Пример ниже о том, как создать редактор поля в DataGrid с двумя полями для ввода, например для ввода Имени/Фамилии в одном столбце приложение: [Copy to clipboard][-]View CodeMXML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 &#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; standalone=&#34;no&#34;?&#62; &#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Пример ниже о том, как создать редактор поля в DataGrid с двумя полями для ввода, например для ввода Имени/Фамилии в одном столбце<br />
<span id="more-38"></span><br />
приложение:</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('38code34'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('3834');">[<span id="3834_symbol">-</span>]</a></div><div class="codebox_left"><span id="l38code34"><a href="#" onclick="javascript:showCodeTxt('38code34'); return false;">View Code</a>MXML</span></div></td></tr><tr id="3834"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="38code34"><pre class="mxml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> <span style="color: #000066;">standalone</span>=<span style="color: #ff0000;">&quot;no&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">xmlns:local</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="font-weight: bold; color: black;">&gt;</span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">		private var arr:Array = [</span>
<span style="color: #339933;">			{ rank: &quot;1&quot;, place: &quot;3&quot;, lead: &quot;Van Amstel, Louis&quot;, follow: &quot;Burke, Cheryl&quot; },</span>
<span style="color: #339933;">			{ rank: &quot;2&quot;, place: &quot;1&quot;, lead: &quot;Weise, David&quot;, follow: &quot;Weise, Valentina&quot; },</span>
<span style="color: #339933;">			{ rank: &quot;3&quot;, place: &quot;2&quot;, lead: &quot;Roberts, Jonathan&quot;, follow: &quot;Trebunskaya, Anna&quot; }</span>
<span style="color: #339933;">		];</span>
&nbsp;
<span style="color: #339933;">	]]&gt;</span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;local:DataGridWithShiftKey</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;dg&quot;</span> <span style="color: #000066;">initialize</span>=<span style="color: #ff0000;">&quot;dg.dataProvider=arr&quot;</span> <span style="color: #000066;">editable</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;local:columns<span style="font-weight: bold; color: black;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:DataGridColumn</span> <span style="color: #000066;">dataField</span>=<span style="color: #ff0000;">&quot;rank&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #000066;">headerText</span>=<span style="color: #ff0000;">&quot;Rank&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:DataGridColumn</span> <span style="color: #000066;">dataField</span>=<span style="color: #ff0000;">&quot;lead&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;160&quot;</span> <span style="color: #000066;">headerText</span>=<span style="color: #ff0000;">&quot;Leader&quot;</span> <span style="color: #000066;">itemEditor</span>=<span style="color: #ff0000;">&quot;DataGridMultiFieldEditor&quot;</span> <span style="color: #000066;">editorDataField</span>=<span style="color: #ff0000;">&quot;fullName&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:DataGridColumn</span> <span style="color: #000066;">dataField</span>=<span style="color: #ff0000;">&quot;follow&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;160&quot;</span> <span style="color: #000066;">headerText</span>=<span style="color: #ff0000;">&quot;Follower&quot;</span> <span style="color: #000066;">itemEditor</span>=<span style="color: #ff0000;">&quot;DataGridMultiFieldEditor&quot;</span> <span style="color: #000066;">editorDataField</span>=<span style="color: #ff0000;">&quot;fullName&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:DataGridColumn</span> <span style="color: #000066;">dataField</span>=<span style="color: #ff0000;">&quot;place&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #000066;">headerText</span>=<span style="color: #ff0000;">&quot;Place&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/local:columns<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/local:DataGridWithShiftKey<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Button</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p>код компонента DataGridWithShiftKey<br />
файл DataGridWithShiftKey.as</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('38code35'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('3835');">[<span id="3835_symbol">-</span>]</a></div><div class="codebox_left"><span id="l38code35"><a href="#" onclick="javascript:showCodeTxt('38code35'); return false;">View Code</a>ACTIONSCIPT</span></div></td></tr><tr id="3835"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code" id="38code35"><pre>package 
{
import flash.events.KeyboardEvent;
import mx.controls.DataGrid;
&nbsp;
/** 
 *  Редактору со множеством полей необходимо состояние c SHIFT
 */
public class DataGridWithShiftKey extends DataGrid
{
&nbsp;
	public function DataGridWithShiftKey()
	{
		super();
	}
&nbsp;
	override protected function createChildren():void
	{
		super.createChildren();
		systemManager.addEventListener(KeyboardEvent.KEY_DOWN, shiftKeyHandler, true, 0, true);
	}
&nbsp;
	private var _shiftKey:Boolean;
&nbsp;
	public function get shiftKey():Boolean
	{
		return _shiftKey;
	}
&nbsp;
	private function shiftKeyHandler(event:KeyboardEvent):void
	{
		_shiftKey = event.shiftKey;
	}
&nbsp;
}
&nbsp;
}</pre></td></tr></table></div>

<p>код редактора с несколькими полями для ввода<br />
файл DataGridMultiFieldEditor.as</p>

<div class="wp_codebox"><table width="100%" ><tr><td colspan="2" class="msgheader"><div class="codebox_right"><a href="###" onclick="copycode($('38code36'));">[Copy to clipboard]</a><a href="###" onclick="toggle_collapse('3836');">[<span id="3836_symbol">-</span>]</a></div><div class="codebox_left"><span id="l38code36"><a href="#" onclick="javascript:showCodeTxt('38code36'); return false;">View Code</a>ACTIONSCRIPT</span></div></td></tr><tr id="3836"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
</pre></td><td class="code" id="38code36"><pre class="actionscript">package 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">FocusEvent</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">DataGrid</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">dataGridClasses</span>.<span style="color: #006600;">DataGridColumn</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">dataGridClasses</span>.<span style="color: #006600;">DataGridListData</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">BaseListData</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">IDropInListItemRenderer</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">IListItemRenderer</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">IDropInListItemRenderer</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">TextInput</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">UIComponent</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">managers</span>.<span style="color: #006600;">IFocusManagerComponent</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/** 
 *  Редактор с двумя полями для DataGrid
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DataGridMultiFieldEditor <span style="color: #0066CC;">extends</span> UIComponent <span style="color: #0066CC;">implements</span> IListItemRenderer, IDropInListItemRenderer, IFocusManagerComponent
<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> DataGridMultiFieldEditor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		addEventListener<span style="color: #66cc66;">&#40;</span>FocusEvent.<span style="color: #006600;">KEY_FOCUS_CHANGE</span>, keyFocusChangeHandler<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> dgOwner:DataGridWithShiftKey;
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> firstNameEditor:TextInput;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> lastNameEditor:TextInput;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> fullName<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span> lastNameEditor.<span style="color: #0066CC;">text</span> + <span style="color: #ff0000;">&quot;, &quot;</span> + firstNameEditor.<span style="color: #0066CC;">text</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _data:<span style="color: #0066CC;">Object</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Object</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span> _data;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		_data = value;
		invalidateProperties<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _listData:BaseListData;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> listData<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:BaseListData
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span> _listData;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> listData<span style="color: #66cc66;">&#40;</span>value:BaseListData<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		_listData = value;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>dgOwner.<span style="color: #006600;">shiftKey</span><span style="color: #66cc66;">&#41;</span>
			lastNameEditor.<span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #b1b100;">else</span>
			firstNameEditor.<span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	override protected <span style="color: #000000; font-weight: bold;">function</span> createChildren<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">super</span>.<span style="color: #006600;">createChildren</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
        firstNameEditor = <span style="color: #000000; font-weight: bold;">new</span> TextInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		addChild<span style="color: #66cc66;">&#40;</span>firstNameEditor<span style="color: #66cc66;">&#41;</span>;
        lastNameEditor = <span style="color: #000000; font-weight: bold;">new</span> TextInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		addChild<span style="color: #66cc66;">&#40;</span>lastNameEditor<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	override protected <span style="color: #000000; font-weight: bold;">function</span> commitProperties<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		dgOwner = owner as DataGridWithShiftKey;
&nbsp;
		<span style="color: #0066CC;">super</span>.<span style="color: #006600;">commitProperties</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> dgColumn:DataGridColumn = dgOwner.<span style="color: #006600;">columns</span><span style="color: #66cc66;">&#91;</span>DataGridListData<span style="color: #66cc66;">&#40;</span>listData<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">columnIndex</span><span style="color: #66cc66;">&#93;</span>;
		<span style="color: #000000; font-weight: bold;">var</span> fullName:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#91;</span>dgColumn.<span style="color: #006600;">dataField</span><span style="color: #66cc66;">&#93;</span>;
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">names</span>:<span style="color: #0066CC;">Array</span> = fullName.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;, &quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		lastNameEditor.<span style="color: #0066CC;">text</span> = <span style="color: #0066CC;">names</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>;
		firstNameEditor.<span style="color: #0066CC;">text</span> = <span style="color: #0066CC;">names</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	override protected <span style="color: #000000; font-weight: bold;">function</span> updateDisplayList<span style="color: #66cc66;">&#40;</span>w:<span style="color: #0066CC;">Number</span>, h:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">super</span>.<span style="color: #006600;">updateDisplayList</span><span style="color: #66cc66;">&#40;</span>w, h<span style="color: #66cc66;">&#41;</span>;
		firstNameEditor.<span style="color: #006600;">move</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
		firstNameEditor.<span style="color: #006600;">setActualSize</span><span style="color: #66cc66;">&#40;</span>w <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>, h<span style="color: #66cc66;">&#41;</span>;
		lastNameEditor.<span style="color: #006600;">move</span><span style="color: #66cc66;">&#40;</span>w <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
		lastNameEditor.<span style="color: #006600;">setActualSize</span><span style="color: #66cc66;">&#40;</span>w <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>, h<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> keyFocusChangeHandler<span style="color: #66cc66;">&#40;</span>event:FocusEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">shiftKey</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>lastNameEditor.<span style="color: #006600;">contains</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">getFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				event.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				firstNameEditor.<span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>firstNameEditor.<span style="color: #006600;">contains</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">getFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				event.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				lastNameEditor.<span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://blogs.adobe.com/aharui/2008/08/datagrid_itemeditor_with_two_i.html">Оригинал</a></p>
<p><iframe src="http://blogs.adobe.com/aharui/DataGridMultiFieldEditor/DataGridMultiFieldEditorTest.swf" width="100%" height="400" ></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://flexcookbook.ru/2008/08/%d0%ba%d0%b0%d0%ba-%d1%81%d0%be%d0%b7%d0%b4%d0%b0%d1%82%d1%8c-%d1%80%d0%b5%d0%b4%d0%b0%d0%ba%d1%82%d0%be%d1%80-itemeditor-%d0%b2-datagrid-%d1%81-%d0%b4%d0%b2%d1%83%d0%bc%d1%8f-%d0%bf%d0%be%d0%bb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

