<?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"
	>

<channel>
	<title>Miti's Blog</title>
	<atom:link href="http://miti.pricope.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://miti.pricope.com</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Thu, 27 Nov 2008 16:00:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Adobe MAX Europe Discount</title>
		<link>http://miti.pricope.com/2008/11/11/adobe-max-europe-discount/</link>
		<comments>http://miti.pricope.com/2008/11/11/adobe-max-europe-discount/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 20:15:03 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[events]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/2008/11/11/adobe-max-europe-discount/</guid>
		<description><![CDATA[Guess what, just by reading this you can save 240EUR if you want to go to MAX Europe in Milan.To get this discount you just need to use the following registration code: EEB856 (*Additional restrictions apply. Please read the note below!) when you register here. I will be speaking at Milan about Flex + PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Guess what, just by reading this you can save 240EUR if you want to go to MAX Europe in Milan.To get this discount you just need to use the following registration code: EEB856 (*Additional restrictions apply. Please read the note below!) when you register <a href="http://max.adobe.com/eu/register">here</a>. I will be speaking at Milan about Flex + PHP and AIR+Dreamweaver+AJAX but you will have the chance to see a lot of cool new technologies. Hope to see you there!</p>
<p>* Offer good for new Adobe MAX 2008 registrations only. Offer good for Adobe MAX Europe full event pass registration only. The offer applies to an Adobe MAX full event pass only (EUR€840). Offer cannot be combined with any other offer, package or registration code. Offer expires 11:59 pm PDT November 14, 2008. Terms and conditions for Adobe MAX registrations will also apply. Void where prohibited.</p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/11/11/adobe-max-europe-discount/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Playing with Pixel Bender</title>
		<link>http://miti.pricope.com/2008/11/10/playing-with-pixel-bender/</link>
		<comments>http://miti.pricope.com/2008/11/10/playing-with-pixel-bender/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 14:20:10 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[Flash Player 10]]></category>

		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/2008/11/10/playing-with-pixel-bender/</guid>
		<description><![CDATA[As you probably know by now, Flash Player 10 has a new feature for image processing that allows you to perform some really cool effects and blends. Well actually this new feature is a little language for parallel computing. In this post I present some samples that show you how to integrate Pixel Bender with [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably know by now, Flash Player 10 has a new feature for image processing that allows you to perform some really cool effects and blends. Well actually this new feature is a little language for parallel computing. In this post I present some samples that show you how to integrate Pixel Bender with your Flex project from start to finish.</p>
<p>First of all you need the Pixel Bender Toolkit. You can get it from <a href="http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit">here</a>. Second you will need to compile your Flex Project against Flash Player 10. There&#8217;s some documentation <a href="http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10+Beta">here</a>. The whole idea behind my samples is that it took a while for me to put all things together and apply the effects on my Flex elements, and I want to make it easier for you.</p>
<p>In the first project I just made a simple Pixel Bender filter, which replaces the red channel with the blue one, and added it to an image.</p>
<p>Click <a href="http://miti.pricope.com/samples/PBender/first.html" target="_blank">here</a> to see the demo</p>
<p>On the second project I used a filter with some parameters. It doesn&#8217;t do much, just clips a circle from the original image.</p>
<p>Click <a href="http://miti.pricope.com/samples/PBender/second.html" target="_blank">here</a> to see the demo</p>
<p>The next one is a slightly more complex filter that has two input images. I use it to apply an image over a video. </p>
<p>Click <a href="http://miti.pricope.com/samples/PBender/FP10.html" target="_blank">here</a> to see the demo</p>
<p>Finally, because Pixel Bender is basically a number cruncher, I use it to mix two ByteArrays. By chance <img src='http://miti.pricope.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> these two ByteArrays are extracted from two sounds so this is also an example on how you can use Pixel Bender to mix two sounds.</p>
<p>Click <a href="http://miti.pricope.com/samples/PBender/sampleSound.html" target="_blank">here</a> to see the demo (it might take a while before it starts playing because I have to load the sounds first)</p>
<p>You may want to take a look at the <a href="http://miti.pricope.com/samples/PBender/srcview/index.html" target="_blank">source code</a> or <a href="http://miti.pricope.com/samples/PBender/srcview/FP10.zip">download</a> it.</p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/11/10/playing-with-pixel-bender/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GoDaddy - account problems - Anybody can help?</title>
		<link>http://miti.pricope.com/2008/10/13/godaddy-account-problems-anybody-can-help/</link>
		<comments>http://miti.pricope.com/2008/10/13/godaddy-account-problems-anybody-can-help/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 15:15:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=4</guid>
		<description><![CDATA[Some of our sites (mine, Mihai&#8217;s and Cornel&#8217;s) have been down in the last 24-48h due to an account problem with GoDaddy. We had an account (at about 10$/month) with them with an limited HDD quota (about 150MB). Somehow we surpassed that quota without noticing (no big red thing, no warnings) &#8230; and we got [...]]]></description>
			<content:encoded><![CDATA[<p>Some of our sites (mine, <a href="http://corlan.org">Mihai</a>&#8217;s and <a href="http://cornelcreanga.com">Cornel</a>&#8217;s) have been down in the last 24-48h due to an account problem with GoDaddy. We had an account (at about 10$/month) with them with an limited HDD quota (about 150MB). Somehow we surpassed that quota without noticing (no big red thing, no warnings) &#8230; and we got a 7000$ bill. We called support and they say we surpassed our HDD quota by 58% but they didn&#8217;t want to say for how long or any other info. We asked why they didn&#8217;t upgrade at the next account level which is 14$/month, unlimited HDD quota. They say they can do that now . So we paid the new account &#8230; but then they said that we still own them 800$ (don&#8217;t know what computation they did to come up with this) and because of that they can&#8217;t give us access to the old account and they cannot migrate the DB .</p>
<p>I personally believe that this is unacceptable way of doing business.</p>
<p>Because of that it might take some time to get all the posts back (we have some back-ups and long live Google Cache). If anyone lived that before and solved (without paying a ton of money to GoDaddy) &#8230; or can help us in some way we would be more that grateful!</p>
<p>You can see a more romanced post at <a href="http://corlan.org">Mihai&#8217;s Blog</a> as he dealt with them on the phone.</p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/10/13/godaddy-account-problems-anybody-can-help/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Poli 2.0 experiment</title>
		<link>http://miti.pricope.com/2008/10/10/the-poli-20-experiment/</link>
		<comments>http://miti.pricope.com/2008/10/10/the-poli-20-experiment/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 09:03:53 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[events]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=5</guid>
		<description><![CDATA[
Next Thursday, October16th at University Politehnica of Bucharest we (a bunch of people from the University, uberVU, Yahoo and Adobe) will present a new &#8212; and a little bit unusual &#8212; course. The course is about web programming and we want to teach the new old stuff in a little different manner &#8230; at least [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://poli20.org/"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/10/image2.png" border="0" alt="image" width="524" height="217" /></a></p>
<p>Next Thursday, October16th at <strong>University Politehnica of Bucharest</strong> we (a bunch of people from the University, uberVU, Yahoo and Adobe) will present a new &#8212; and a little bit unusual &#8212; course. The course is about web programming and we want to teach the new old stuff in a little different manner &#8230; at least a little different than I was taught in school. If you are a student in Bucharest then you might want to give it a try and attend the opening course which will take place in Politehnica EC105 hall at 14:00h. We also made a little site (<a href="http://poli20.org/">Poli20.org</a>) where we will post stuff as the things roll on.</p>
<p>The course is an experiment because  &#8230; well I will give more info after the first 1-2 courses. I don&#8217;t want to spoil the fun for those who will be there <img src='http://miti.pricope.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Hope to see you next Thursday &#8230; and keep seeing you!</p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/10/10/the-poli-20-experiment/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex Large Book Component</title>
		<link>http://miti.pricope.com/2008/09/10/flex-large-book-component/</link>
		<comments>http://miti.pricope.com/2008/09/10/flex-large-book-component/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 09:05:20 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=6</guid>
		<description><![CDATA[I needed a book control for an AIR app and the best that suited my needs was Ruben Swieringa&#8217;s Flex Book component (many thanks for building this). I had to use this for a 200+ page magazine and I quickly discovered that it worked a little slow for this amount of pages. After a profiling [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a book control for an AIR app and the best that suited my needs was <a href="http://www.rubenswieringa.com/blog/flex-book-component-beta">Ruben Swieringa&#8217;s Flex Book component</a> (many thanks for building this). I had to use this for a 200+ page magazine and I quickly discovered that it worked a little slow for this amount of pages. After a profiling session I realized that what took so long was the Flash pre-render time because all the pages are in the display list (one on top of another). So I wrote a some code to use only 8 pages (4 pairs): the rest are stored in an array. I also added a jumpToPage method to make navigation easier in a 200+ page book.</p>
<p>Still to be done:</p>
<ul>
<li>if you have more than one transparent page one after another it will look very messy because at any given moment the book has only 8 pages. This can be done by configuring how many real pages are stored &#8230; but the logic of navigating through get&#8217;s very nasty.</li>
<li>tearing pages doesn&#8217;t work (not implemented yet)</li>
<li>lot of traces are still enabled</li>
<li>BEWARE of bugs <img src='http://miti.pricope.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Give it a try:</p>
<ul>
<li><a href="http://miti.pricope.com/samples/book/largeBook.html">Demo</a></li>
<li><a href="http://miti.pricope.com/samples/book/srcview/index.html">Source</a></li>
</ul>
<p><a href="http://miti.pricope.com/samples/book/largeBook.html"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/09/image.png" border="0" alt="image" width="244" height="165" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/09/10/flex-large-book-component/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Selenium on AIR</title>
		<link>http://miti.pricope.com/2008/08/17/selenium-on-air/</link>
		<comments>http://miti.pricope.com/2008/08/17/selenium-on-air/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 09:18:38 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[air]]></category>

		<category><![CDATA[ajax]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=7</guid>
		<description><![CDATA[Are you using HTML/JS to build AIR Applications and wondering how to automate functional testing for your app? Here is some news that might put a smile on your face. In few words, the guys across my desk have been tweaking Selenium to work on AIR. Mihai wrote a cool blog post about how you [...]]]></description>
			<content:encoded><![CDATA[<p>Are you using HTML/JS to build AIR Applications and wondering how to automate functional testing for your app? <a href="http://corlan.org/2008/08/15/functional-testing-framework-for-air-ajax-apps-based-on-selenium/">Here</a> is some news that might put a smile on your face. In few words, the guys across my desk have been tweaking Selenium to work on AIR. Mihai wrote a cool blog post about how you can test drive this bit of code so if you are interested please take it for a spin. Don&#8217;t forget to tell us how it was!</p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/08/17/selenium-on-air/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Debug Flex and .NET using ASP.NET Development Server</title>
		<link>http://miti.pricope.com/2008/07/29/debug-flex-and-net-using-aspnet-development-server/</link>
		<comments>http://miti.pricope.com/2008/07/29/debug-flex-and-net-using-aspnet-development-server/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 09:21:30 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[debugging]]></category>

		<category><![CDATA[flex builder]]></category>

		<category><![CDATA[tips &amp; tricks]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=9</guid>
		<description><![CDATA[If you followed my previous post you probably now have a Flex + .NET project that makes a WebService call. If not, here&#8217;s a project you can use testDotNet.zip. To import this in Flex Builder choose File-&#62;Import-&#62;Flex Project and follow the steps.
Next open Visual Web Developer and open a Web Site in the same location [...]]]></description>
			<content:encoded><![CDATA[<p>If you followed my previous post you probably now have a Flex + .NET project that makes a WebService call. If not, here&#8217;s a project you can use <a href="http://miti.pricope.com/wp-content/uploads/2008/07/testdotnet.zip" target="_self">testDotNet.zip</a>. To import this in Flex Builder choose File-&gt;Import-&gt;Flex Project and follow the steps.</p>
<p>Next open Visual Web Developer and open a Web Site in the same location as the Flex Builder project.  Open web.config and make sure you have &lt;compilation debug=&#8221;true&#8221;&gt; (this inserts debugging symbols for the .NET code).</p>
<p>Now we need to use the same ASP.NET Developer Server for both the Flex Builder and Visual Web Developer. Since by default both tools try to start one instance we need a little trick to do that:</p>
<p>Start the MXML project through Flex Builder; this will start ASP.NET Developer Server usually on port 3000. Then go to Visual Web Developer; on Project Property Page (Right Click on the Project in the Solution Explorer) click Start Options and select Use Custom Server and enter <a title="http://localhost:3000/testDotNet/" href="http://localhost:3000/testDotNet/">http://localhost:3000/testDotNet/</a></p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/07/image3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/07/image-thumb3.png" border="0" alt="image" width="582" height="340" /></a></p>
<p>Start also the .NET project just to connect the Visual Web Developer to the ASP.NET Developer Server instance. Now you will be able to debug both Flex and .NET code:</p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/07/image4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/07/image-thumb4.png" border="0" alt="image" width="505" height="388" /></a></p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/07/image5.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/07/image-thumb5.png" border="0" alt="image" width="505" height="358" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/07/29/debug-flex-and-net-using-aspnet-development-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Import Web Service wizard to connect Flex to .NET</title>
		<link>http://miti.pricope.com/2008/07/28/using-import-web-service-wizard-to-connect-flex-to-net/</link>
		<comments>http://miti.pricope.com/2008/07/28/using-import-web-service-wizard-to-connect-flex-to-net/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 09:19:45 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<category><![CDATA[flex builder]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=8</guid>
		<description><![CDATA[Since I was deeply involved in Flex Builder support for working with .NET I thought that it would be a good idea to write some articles on how you can use these technologies together. I will create a &#8220;Hello World&#8221; project but the focus will be on how you can better make use of the [...]]]></description>
			<content:encoded><![CDATA[<p>Since I was deeply involved in Flex Builder support for working with .NET I thought that it would be a good idea to write some articles on how you can use these technologies together. I will create a &#8220;Hello World&#8221; project but the focus will be on how you can better make use of the available tools.</p>
<p>For tooling I will be using Flex Builder and Visual Web Developer 2008 Express Edition (VWD).</p>
<p>First let&#8217;s create a simple ASP.NET Web Service project using VWD:</p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/07/image2.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/07/image-thumb2.png" border="0" alt="image" width="520" height="320" /></a></p>
<p>I slightly modified the HelloWorld method in Service.cs to receive a parameter:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">[WebMethod]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> HelloWorld(String name) {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff;">return</span> <span style="color: #006080;">&#8220;Hello &#8220;</span> + name + <span style="color: #006080;">&#8220;! Nice talking to you!&#8221;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
</div>
</div>
<p>Now let&#8217;s get into Flex Builder and try to get something from the .NET Server. First we will create a new Flex Project on top of the .NET one. To do that click on New-&gt;Flex Project and choose ASP.NET as the server technology:</p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/07/image11.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/07/image11-thumb.png" border="0" alt="image" width="380" height="400" /></a></p>
<p>Make sure the location is the same as the VWD .NET project. Now run the default MXML file to start the ASP.NET Developer Server.</p>
<p>Next we will generate the glue code for calling the Web Service using the Import Web Service Wizard. Choose Data -&gt; Import Web Service (WSDL) from the Flex Builder menu. On the first page the main source folder is selected by default. You can leave it like this. On the second page you need to choose the WSDL URI. When you launched the MXML application the ASP.NET Developer Server should have started by default on port 3000 (see the tray icon). In this case the WSDL URL should be something like <a title="http://localhost:2266/testDotNet2/Service.asmx?WSDL" href="http://localhost:3000/testDotNet/Service.asmx?WSDL">http://localhost:3000/testDotNet/Service.asmx?WSDL</a>.</p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/07/image14.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/07/image14-thumb.png" border="0" alt="image" width="354" height="367" /></a></p>
<p>The third page should look like this:</p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/07/image18.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/07/image18-thumb.png" border="0" alt="image" width="378" height="330" /></a></p>
<p>Now you should have some typed AS classes that provide easy access the .NET Web Service methods. The cool thing about this is that Flex Builder knows now how to do autocompletion on Web Service calls. So making a little application that will showcase this is just too easy:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;?</span><span style="color: #800000;">xml</span> <span style="color: #ff0000;">version</span><span style="color: #0000ff;">=&#8221;1.0&#8243;</span> <span style="color: #ff0000;">encoding</span><span style="color: #0000ff;">=&#8221;utf-8&#8243;</span>?<span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:Application</span> <span style="color: #ff0000;">xmlns:mx</span><span style="color: #0000ff;">=&#8221;http://www.adobe.com/2006/mxml&#8221;</span> <span style="color: #ff0000;">layout</span><span style="color: #0000ff;">=&#8221;absolute&#8221;</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:Script</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        <span style="color: #0000ff;">&lt;!</span>[CDATA[</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            import mx.controls.Alert;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            import generated.webservices.HelloWorldResultEvent;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            import generated.webservices.Service;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            public function sayHello():void {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                var service:Service = new Service();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                service.addhelloWorldEventListener(</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                    function (event:HelloWorldResultEvent):void {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                        Alert.show(event.result);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                    });</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                service.helloWorld(myName.text);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        ]]<span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">mx:Script</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:TextInput</span> <span style="color: #ff0000;">x</span><span style="color: #0000ff;">=&#8221;176&#8243;</span> <span style="color: #ff0000;">y</span><span style="color: #0000ff;">=&#8221;171&#8243;</span> <span style="color: #ff0000;">id</span><span style="color: #0000ff;">=&#8221;myName&#8221;</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:Text</span> <span style="color: #ff0000;">x</span><span style="color: #0000ff;">=&#8221;70&#8243;</span> <span style="color: #ff0000;">y</span><span style="color: #0000ff;">=&#8221;173&#8243;</span> <span style="color: #ff0000;">text</span><span style="color: #0000ff;">=&#8221;Enter Your Name&#8221;</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:Button</span> <span style="color: #ff0000;">x</span><span style="color: #0000ff;">=&#8221;344&#8243;</span> <span style="color: #ff0000;">y</span><span style="color: #0000ff;">=&#8221;171&#8243;</span> <span style="color: #ff0000;">label</span><span style="color: #0000ff;">=&#8221;Click to receive greeting&#8221;</span> <span style="color: #ff0000;">click</span><span style="color: #0000ff;">=&#8221;sayHello()&#8221;</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">mx:Application</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/07/28/using-import-web-service-wizard-to-connect-flex-to-net/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DataGrid - Confirm a Grid change event using an Alert popup</title>
		<link>http://miti.pricope.com/2008/07/09/datagrid-canceling-a-grid-change-event-using-an-alert-popup/</link>
		<comments>http://miti.pricope.com/2008/07/09/datagrid-canceling-a-grid-change-event-using-an-alert-popup/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 10:04:33 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<category><![CDATA[tips &amp; tricks]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=29</guid>
		<description><![CDATA[Today I saw an interesting post on FlexCoders. Suppose you have an editable DataGrid and you want to confirm through an Alert if the change should be made or not. Preventing the change is easy, you just need hook onto the itemEditEnd and call event.preventDefault(). The problem arises when you want to confirm this with [...]]]></description>
			<content:encoded><![CDATA[<p>Today I saw an interesting post on FlexCoders. Suppose you have an editable DataGrid and you want to confirm through an Alert if the change should be made or not. Preventing the change is easy, you just need hook onto the itemEditEnd and call event.preventDefault(). The problem arises when you want to confirm this with the user using an Alert. This is because the Alert.show call is asynchronous. This means that the grid event will complete before the user can choose Yes or No.</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">function</span> editEnd(<span style="color: #0000ff;">event</span>:DataGridEvent):<span style="color: #0000ff;">void</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">  Alert.show(<span style="color: #006080;">&#8220;Do you want to save changes?&#8221;</span>,<span style="color: #006080;">&#8220;Save changes&#8221;</span>,Alert.YES | Alert.NO,<span style="color: #0000ff;">null</span>,<span style="color: #0000ff;">function</span>(ev:CloseEvent):<span style="color: #0000ff;">void</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      <span style="color: #0000ff;">if</span> (ev.detail == Alert.YES) {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        <span style="color: #008000;">//LABEL2: This will be reached long after the LABEL1 has been reached. </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        <span style="color: #008000;">//So at this point the grid has been executed the default behavior for the change event</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    });</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #008000;">//LABEL1: Because of the asynchronous nature this will be reached right after the Alert.show call    </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">}</pre>
</div>
</div>
<p>So my idea of solving this was to save the new value, prevent the default grid behavior of updating the dataProvider and update the data provider manually on the Alert.show closeHandler.</p>
<p>Here is some code that illustrates this:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;?</span><span style="color: #800000;">xml</span> <span style="color: #ff0000;">version</span><span style="color: #0000ff;">=&#8221;1.0&#8243;</span> <span style="color: #ff0000;">encoding</span><span style="color: #0000ff;">=&#8221;utf-8&#8243;</span>?<span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:WindowedApplication</span> <span style="color: #ff0000;">xmlns:mx</span><span style="color: #0000ff;">=&#8221;http://www.adobe.com/2006/mxml&#8221;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        <span style="color: #ff0000;">initialize</span><span style="color: #0000ff;">=&#8221;initData()&#8221;</span> <span style="color: #ff0000;">layout</span><span style="color: #0000ff;">=&#8221;absolute&#8221;</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">  <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:Script</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   <span style="color: #0000ff;">&lt;!</span>[CDATA[</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">       import mx.controls.TextInput;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">       import mx.controls.Alert;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    import mx.collections.*;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    import mx.events.*;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      private var DGArray:Array = [</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">         {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99},</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">         {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99}];</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      [Bindable]</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      public var initDG:ArrayCollection;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      public function initData():void {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">         initDG=new ArrayCollection(DGArray);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      public function editEnd(event:DataGridEvent):void {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">          //Save the data before calling Alert</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        var myEditor:TextInput =</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                    TextInput(event.currentTarget.itemEditorInstance);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        // Get the new value from the editor.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        var newVal:String = myEditor.text;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        var dataObject:Object = event.itemRenderer.data;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        var property:String = event.dataField;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        Alert.show("Do you want to save changes?","Save changes",Alert.YES | Alert.NO,null,function(ev:CloseEvent):void {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            //If we have clicked YES then update the data collection manually</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            if (ev.detail == Alert.YES) {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                  dataObject[property] = newVal.toString();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                  initDG.itemUpdated(dataObject,property);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">          });</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">          //prevent data grid to update his dataProvider collection</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">          event.preventDefault();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   ]]<span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">mx:Script</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:DataGrid</span> <span style="color: #ff0000;">id</span><span style="color: #0000ff;">=&#8221;myGrid&#8221;</span> <span style="color: #ff0000;">width</span><span style="color: #0000ff;">=&#8221;350&#8243;</span> <span style="color: #ff0000;">height</span><span style="color: #0000ff;">=&#8221;200&#8243;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      <span style="color: #ff0000;">dataProvider</span><span style="color: #0000ff;">=&#8221;{initDG}&#8221;</span> <span style="color: #ff0000;">editable</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">itemEditEnd</span><span style="color: #0000ff;">=&#8221;editEnd(event)&#8221;</span> <span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:columns</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">         <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:DataGridColumn</span> <span style="color: #ff0000;">dataField</span><span style="color: #0000ff;">=&#8221;Album&#8221;</span> <span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">         <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:DataGridColumn</span> <span style="color: #ff0000;">dataField</span><span style="color: #0000ff;">=&#8221;Price&#8221;</span> <span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">mx:columns</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">mx:DataGrid</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:DataGrid</span> <span style="color: #ff0000;">id</span><span style="color: #0000ff;">=&#8221;readOnlyGrid&#8221;</span> <span style="color: #ff0000;">width</span><span style="color: #0000ff;">=&#8221;350&#8243;</span> <span style="color: #ff0000;">height</span><span style="color: #0000ff;">=&#8221;200&#8243;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      <span style="color: #ff0000;">dataProvider</span><span style="color: #0000ff;">=&#8221;{initDG}&#8221;</span> <span style="color: #ff0000;">x</span><span style="color: #0000ff;">=&#8221;0&#8243;</span> <span style="color: #ff0000;">y</span><span style="color: #0000ff;">=&#8221;208&#8243;</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:columns</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">         <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:DataGridColumn</span> <span style="color: #ff0000;">dataField</span><span style="color: #0000ff;">=&#8221;Album&#8221;</span> <span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">         <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:DataGridColumn</span> <span style="color: #ff0000;">dataField</span><span style="color: #0000ff;">=&#8221;Price&#8221;</span> <span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">mx:columns</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">mx:DataGrid</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">mx:WindowedApplication</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/07/09/datagrid-canceling-a-grid-change-event-using-an-alert-popup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AS and Flex Project trick</title>
		<link>http://miti.pricope.com/2008/07/07/as-and-flex-project-trick/</link>
		<comments>http://miti.pricope.com/2008/07/07/as-and-flex-project-trick/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 10:03:23 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
		
		<category><![CDATA[flex builder]]></category>

		<category><![CDATA[tips &amp; tricks]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=28</guid>
		<description><![CDATA[A few days ago I was trying to use the FDS AJAX Bridge to push some messages in an AJAX grid. So I created a Flex + WTP + BlazeDS project and went to change the default Application from the default MXML file to my FDMSBridge.as (The 1&#215;1 pixel SWF). Guess what? You can&#8217;t add [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I was trying to use the FDS AJAX Bridge to push some messages in an AJAX grid. So I created a <a href="http://corlan.org/2008/06/05/creating-a-combined-flexjava-project-in-flex-builder-wo-lcdsblazeds/">Flex + WTP + BlazeDS</a> project and went to change the default Application from the default MXML file to my FDMSBridge.as (The 1&#215;1 pixel SWF). Guess what? You can&#8217;t add AS files, only MXML ones</p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/10/image9.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/10/image-thumb6.png" border="0" alt="image" width="532" height="465" /></a></p>
<p>This might be a little bug, but I found a workaround. I manually edited .actionScriptProperties file and in the &lt;application&gt; section added the FDMSBridge.as:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;?</span><span style="color: #800000;">xml</span> <span style="color: #ff0000;">version</span><span style="color: #0000ff;">=&#8221;1.0&#8243;</span> <span style="color: #ff0000;">encoding</span><span style="color: #0000ff;">=&#8221;UTF-8&#8243;</span>?<span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">actionScriptProperties</span> <span style="color: #ff0000;">mainApplicationPath</span><span style="color: #0000ff;">=&#8221;testBlaze.mxml&#8221;</span> <span style="color: #ff0000;">version</span><span style="color: #0000ff;">=&#8221;3&#8243;</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">compiler</span> <span style="color: #ff0000;">additionalCompilerArguments</span><span style="color: #0000ff;">=&#8221;-services &#8220;C:/work/wksp/samples/testBlaze/WebContent/WEB-INF/flex/services-config.xml&#8221; -locale en_US&#8221;</span> <span style="color: #ff0000;">copyDependentFiles</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">enableModuleDebug</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">generateAccessible</span><span style="color: #0000ff;">=&#8221;false&#8221;</span> <span style="color: #ff0000;">htmlExpressInstall</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">htmlGenerate</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">htmlHistoryManagement</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">htmlPlayerVersion</span><span style="color: #0000ff;">=&#8221;9.0.28&#8243;</span> <span style="color: #ff0000;">htmlPlayerVersionCheck</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">outputFolderPath</span><span style="color: #0000ff;">=&#8221;bin-debug&#8221;</span> <span style="color: #ff0000;">rootURL</span><span style="color: #0000ff;">=&#8221;http://localhost:8080/testBlaze&#8221;</span> <span style="color: #ff0000;">sourceFolderPath</span><span style="color: #0000ff;">=&#8221;flex_src&#8221;</span> <span style="color: #ff0000;">strict</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">useApolloConfig</span><span style="color: #0000ff;">=&#8221;false&#8221;</span> <span style="color: #ff0000;">verifyDigests</span><span style="color: #0000ff;">=&#8221;true&#8221;</span> <span style="color: #ff0000;">warn</span><span style="color: #0000ff;">=&#8221;true&#8221;</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">compilerSourcePath</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">libraryPath</span> <span style="color: #ff0000;">defaultLinkType</span><span style="color: #0000ff;">=&#8221;1&#8243;</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">libraryPathEntry</span> <span style="color: #ff0000;">kind</span><span style="color: #0000ff;">=&#8221;4&#8243;</span> <span style="color: #ff0000;">path</span><span style="color: #0000ff;">=&#8221;"</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">libraryPathEntry</span> <span style="color: #ff0000;">kind</span><span style="color: #0000ff;">=&#8221;1&#8243;</span> <span style="color: #ff0000;">linkType</span><span style="color: #0000ff;">=&#8221;1&#8243;</span> <span style="color: #ff0000;">path</span><span style="color: #0000ff;">=&#8221;flex_libs&#8221;</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">libraryPath</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">sourceAttachmentPath</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">compiler</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">applications</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f400; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">application</span> <span style="color: #ff0000;">path</span><span style="color: #0000ff;">=&#8221;FDMSBridge.as&#8221;</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">application</span> <span style="color: #ff0000;">path</span><span style="color: #0000ff;">=&#8221;testBlaze.mxml&#8221;</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">applications</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">modules</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">buildCSSFiles</span><span style="color: #0000ff;">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">actionScriptProperties</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
</div>
<p>Now the FDMSBridge.as should be compiled as a normal Flex application:</p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/10/image10.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://miti.pricope.com/wp-content/uploads/2008/10/image-thumb7.png" border="0" alt="image" width="581" height="364" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/07/07/as-and-flex-project-trick/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
