<?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>Miti&#039;s Blog &#187; debugging</title>
	<atom:link href="http://miti.pricope.com/category/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>http://miti.pricope.com</link>
	<description>about technology</description>
	<lastBuildDate>Fri, 24 Dec 2010 16:42:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Debug Flex and PHP using Flash Builder 4 and PDT</title>
		<link>http://miti.pricope.com/2009/07/09/debug-flex-and-php-using-flash-builder-4-and-pdt/</link>
		<comments>http://miti.pricope.com/2009/07/09/debug-flex-and-php-using-flash-builder-4-and-pdt/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 12:31:20 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
				<category><![CDATA[debugging]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=69</guid>
		<description><![CDATA[It took me more that I would have liked but here’s a screencast on how to debug flex and php applications using Flash Builder 4 and PDT. &#160;]]></description>
			<content:encoded><![CDATA[<p>It took me more that I would have liked but <a href="http://miti.pricope.com/samples/video/debug-flex-and-php-flash-builder-pdt.html">here’s</a> a screencast on how to debug flex and php applications using Flash Builder 4 and PDT.</p>
<p>&#160;</p>
<p><a href="http://miti.pricope.com/samples/video/debug-flex-and-php-flash-builder-pdt.html"><img height="288" src="http://miti.pricope.com/samples/video/Slide01.jpg" width="384" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2009/07/09/debug-flex-and-php-using-flash-builder-4-and-pdt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</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[flash builder]]></category>
		<category><![CDATA[tips & 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 [...]]]></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>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Identifying visual elements in Flex</title>
		<link>http://miti.pricope.com/2008/06/16/identifying-visual-elements-in-flex/</link>
		<comments>http://miti.pricope.com/2008/06/16/identifying-visual-elements-in-flex/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 10:01:20 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
				<category><![CDATA[debugging]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=23</guid>
		<description><![CDATA[I recently started working on a project to internationalize a large Flex App. One of the problems of internationalizing UIs is that in different languages the same text might grow not only horizontally but also vertically (e.g.: In Chinese the default height is often 16 pixels and not 10 or 12 as in most European [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started working on a project to internationalize a large Flex App. One of the problems of internationalizing UIs is that in different languages the same text might grow not only horizontally but also vertically (e.g.: In Chinese the default height is often 16 pixels and not 10 or 12 as in most European languages). So if you have an application that didn&#8217;t take that into account (my case) you need to rethink the layout to accommodate this expansion. But my very first problem when I started to look into that application was that I had no clue where where each visual element is defined and:</p>
<ul>
<li>the application is BIG</li>
<li>The guys that wrote it are on a time zone 10 hours away</li>
</ul>
<p>So I was basically on my own to identify visual elements, figure out what the actual layout is and where it is defined.</p>
<p>So I came up with this trick to get a sense on how this application is built:</p>
<p>In the capture phase, the visual events in AS3 are dispatched from the root ancestor to the target. This means that the Application container receive all events. So I registered a listener on the Application container that analyzes these events, finds the actual target and then displays the entire display stack that contains the target object. This helped me identify what AS class represents which visual element and in what container this element is placed.</p>
<p>Here&#8217;s is my little bit of code that does 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;">public</span> <span style="color: #0000ff;">function</span> initTrace(app:WindowedApplication):<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">    app.addEventListener(MouseEvent.MIDDLE_CLICK,middleClickHandler,<span style="color: #0000ff;">true</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: white; border-bottom-style: none"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">function</span> middleClickHandler(<span style="color: #0000ff;">event</span>:MouseEvent) {</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;">var</span> tm:Object = <span style="color: #0000ff;">event</span>.target;</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;">var</span> tab:String = <span style="color: #006080;">""</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">    traceObj(tab,tm);</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;">var</span> tmParent:DisplayObject = tm <span style="color: #0000ff;">as</span> DisplayObject;</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;">while</span> (tmParent != <span style="color: #0000ff;">null</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">        tab += <span style="color: #006080;">"  "</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">        traceObj(tab,tmParent);</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">        tmParent = tmParent.parent;</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: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">function</span> traceObj(tab:String,obj:Object):<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: white; border-bottom-style: none">    trace(tab + getQualifiedClassName(obj));</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> (obj <span style="color: #0000ff;">is</span> UIComponent) {</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;">var</span> tmUI:UIComponent = obj <span style="color: #0000ff;">as</span> UIComponent;</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">        trace(tab+tmUI.getStyle(<span style="color: #006080;">"fontFamily"</span>) + <span style="color: #006080;">":"</span> + tmUI.getStyle(<span style="color: #006080;">"fontSize"</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: white; border-bottom-style: none">}</pre>
</div>
</div>
<p>You just need to call the initTrace method on Application.applicationComplete:</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;">mx:Application</span> <span style="color: #ff0000;">xmlns:mx</span><span style="color: #0000ff;">="http://www.adobe.com/2006/mxml"</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;">layout</span><span style="color: #0000ff;">="absolute"</span> <span style="color: #ff0000;">applicationComplete</span><span style="color: #0000ff;">="initTrace(this)"</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/06/16/identifying-visual-elements-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging Flex and PHP with Flex Builder and Zend Studio</title>
		<link>http://miti.pricope.com/2008/06/06/debugging-flex-and-php-with-flex-builder-and-zend-studio/</link>
		<comments>http://miti.pricope.com/2008/06/06/debugging-flex-and-php-with-flex-builder-and-zend-studio/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 09:58:12 +0000</pubDate>
		<dc:creator>mpricope</dc:creator>
				<category><![CDATA[debugging]]></category>
		<category><![CDATA[flash builder]]></category>

		<guid isPermaLink="false">http://miti.pricope.com/?p=22</guid>
		<description><![CDATA[So I am a big fan of debugging. I know that for most people this isn&#8217;t exactly what they get out of the bed in the morning, but nevertheless I know that this prevents them going to sleep in the evening. My first thing when I look into a technology and it&#8217;s tools ecosystem is [...]]]></description>
			<content:encoded><![CDATA[<p>So I am a big fan of debugging. I know that for most people this isn&#8217;t exactly what they get out of the bed in the morning, but nevertheless I know that this prevents them going to sleep in the evening. My first thing when I look into a technology and it&#8217;s tools ecosystem is &#8220;how will I debug this?&#8221;. I find more useful to spend some time configuring my environment for debug earlier in the project rather than later, when things might get hotter.</p>
<p>These days I was looking into Flex and PHP and naturally I started by trying to configure my environment so I can debug this. My goal was to be able to to debug both Flex code and PHP code, to track the dataflow through a server request. I&#8217;ve tried different solutions, and here is the simpler one:</p>
<h4>Solution</h4>
<p>First installed Zend Studio for Eclipse (<a title="http://www.zend.com/en/products/studio/downloads" href="http://www.zend.com/en/products/studio/downloads">http://www.zend.com/en/products/studio/downloads</a>). Make sure you install also the Zend Studio Toolbar for your browser.</p>
<p>Next installed the Flex Builder Plugin from (<a title="http://www.adobe.com/cfusion/tdrc/index.cfm?product=flex_eclipse" href="http://www.adobe.com/cfusion/tdrc/index.cfm?product=flex_eclipse">http://www.adobe.com/cfusion/tdrc/index.cfm?product=flex_eclipse</a>) and choose as Eclipse location the folder where you installed Zend Studio (Usually c:\Program Files\Zend\Zend Studio for Eclipse &#8211; 6.0.0\ for my Windows machine). You might get the following warning:</p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/10/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/10/image-thumb.png" border="0" alt="image" width="376" height="375" /></a></p>
<p>You just need to follow the 3 steps and it should be fine.</p>
<p>The next thing is to install the Zend Debugger server. I found a good tutorial <a href="http://www.thierryb.net/pdtwiki/index.php?title=Using_PDT_:_Installation_:_Installing_the_Zend_Debugger#Installing_Zend_Debugger_server">here</a> so I will not get into much detail.</p>
<p>Now we will create a combined Flex + PHP Project:</p>
<ul>
<li>New -&gt; Flex Project</li>
<li>Choose PHP as Application Server Type</li>
</ul>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/10/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/10/image-thumb1.png" border="0" alt="image" width="497" height="484" /></a></p>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/10/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/10/image-thumb2.png" border="0" alt="image" width="497" height="484" /></a></p>
<p>I will use the following MXML File:</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;">="1.0"</span> <span style="color: #ff0000;">encoding</span><span style="color: #0000ff;">="utf-8"</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;">="http://www.adobe.com/2006/mxml"</span> <span style="color: #ff0000;">layout</span><span style="color: #0000ff;">="absolute"</span> <span style="color: #ff0000;">applicationComplete</span><span style="color: #0000ff;">="initApp()"</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.rpc.events.ResultEvent;</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.rpc.http.HTTPService;</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 gateway:HTTPService = new HTTPService();</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">            function initApp() {</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">                gateway.url = "hello.php";</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">                gateway.method = "POST";</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">                gateway.useProxy = false;</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">                gateway.addEventListener(ResultEvent.RESULT, resultHandler);</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">            function sendRequest():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">                gateway.request =  {"name":enteredName.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: #f4f4f4; border-bottom-style: none">                gateway.send();</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">            function resultHandler(e:ResultEvent):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">                myText.text = e.result.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">            }</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">    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">mx:Button</span> <span style="color: #ff0000;">x</span><span style="color: #0000ff;">="301.5"</span> <span style="color: #ff0000;">y</span><span style="color: #0000ff;">="10"</span> <span style="color: #ff0000;">label</span><span style="color: #0000ff;">="Send"</span> <span style="color: #ff0000;">click</span><span style="color: #0000ff;">="sendRequest()"</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:Text</span> <span style="color: #ff0000;">id</span><span style="color: #0000ff;">="myText"</span> <span style="color: #ff0000;">x</span><span style="color: #0000ff;">="10"</span> <span style="color: #ff0000;">y</span><span style="color: #0000ff;">="62"</span> <span style="color: #ff0000;">width</span><span style="color: #0000ff;">="493"</span> <span style="color: #ff0000;">height</span><span style="color: #0000ff;">="181"</span> <span style="color: #ff0000;">fontFamily</span><span style="color: #0000ff;">="Arial"</span> <span style="color: #ff0000;">fontSize</span><span style="color: #0000ff;">="36"</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:Label</span> <span style="color: #ff0000;">x</span><span style="color: #0000ff;">="10"</span> <span style="color: #ff0000;">y</span><span style="color: #0000ff;">="12"</span> <span style="color: #ff0000;">text</span><span style="color: #0000ff;">="Enter Your Name:"</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;">id</span><span style="color: #0000ff;">="enteredName"</span> <span style="color: #ff0000;">x</span><span style="color: #0000ff;">="121"</span> <span style="color: #ff0000;">y</span><span style="color: #0000ff;">="10"</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:Application</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"></pre>
</div>
</div>
<p>and a little hello.php.</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">&lt;?php</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">    $name = $_POST[<span style="color: #006080;">'name'</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">    echo <span style="color: #006080;">"Hello $name !"</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">?&gt;</pre>
</div>
</div>
<p>As a little note, I create the PHP files directly in the bin-debug folder which is a link to the real folder on your local Web Server.</p>
<p>Now to debug the whole thing:</p>
<ul>
<li>From the Flex perspective I choose <strong>Debug As -&gt; Flex Application</strong>.</li>
<li>On the browser go on the Zend Studio Toobar and click on <strong>Debug</strong>.</li>
<li>If there are checked menu items uncheck them first.</li>
<li>Check the <strong>All Pages on this site</strong></li>
</ul>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/10/image6.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-thumb3.png" border="0" alt="image" width="244" height="171" /></a></p>
<ul>
<li>put some breakpoints both in flex and in php code:</li>
</ul>
<p><a href="http://miti.pricope.com/wp-content/uploads/2008/10/image7.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-thumb4.png" border="0" alt="image" width="674" height="198" /></a> <a href="http://miti.pricope.com/wp-content/uploads/2008/10/image8.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-thumb5.png" border="0" alt="image" width="343" height="135" /></a></p>
<ul>
<li>Now when you click the <strong>Send</strong> button in the application you will hit both breakpoints.</li>
</ul>
<p>I will try to get this working also with Flex Builder and PDT and post an eventual solution. I managed to get something working with Zend Server Debugger with it&#8217;s too unstable to call it a solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://miti.pricope.com/2008/06/06/debugging-flex-and-php-with-flex-builder-and-zend-studio/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

