<?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>Query7 &#187; ActionScript</title>
	<atom:link href="http://query7.com/category/actionscript/feed" rel="self" type="application/rss+xml" />
	<link>http://query7.com</link>
	<description>PHP, Javascript, Python and Web Development</description>
	<lastBuildDate>Sat, 25 Jun 2011 21:29:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Playing with MouseEvent in Flex 3</title>
		<link>http://query7.com/playing-with-mouseevent-in-flex-3</link>
		<comments>http://query7.com/playing-with-mouseevent-in-flex-3#comments</comments>
		<pubDate>Wed, 12 Nov 2008 04:58:12 +0000</pubDate>
		<dc:creator>Amar Shukla</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[AS3 MouseEvent]]></category>
		<category><![CDATA[flex 3]]></category>
		<category><![CDATA[flex 3 tricks]]></category>
		<category><![CDATA[Flex 3 Tutorial]]></category>
		<category><![CDATA[MouseEvent]]></category>
		<category><![CDATA[Playing with Events]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbits.com/?p=281</guid>
		<description><![CDATA[<p>I have come across a very interesting problem while developing a flex application where I have a<br />
button control and I want to call two different functions on  click of the button . The interesting part<br />
is that I want to call two different functions on different events of the same button control, one at<br />
single click and other at double click .<br />
Now what to do in this case as it will always execute the function defined at single click .<br />
So what I am gonna do is to use a Timer using setInterval( ) method and use it to solve this problem.</p>
<p>The code goes here -</p>
<p><code>&#60;?xml version="1.0" encoding="utf-8"?&#62;<br />
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&#62;<br />
&#60;mx:Script&#62;<br />
&#60;![CDATA[<br />
import mx.controls.Alert;<br />
import flash.utils.clearInterval;<br />
private var timeGap:Number = new Number();<br />
private function doubleClick(event:MouseEvent):void {<br />
clearInterval(timeGap);<br />
//put your code here to be executed on double click<br />
Alert.show("double click");<br />
}<br />
private function singleClick(event:MouseEvent):void {<br />
clearInterval(timeGap);<br />
timeGap = setInterval(otherClick, 250);<br />
}<br />
private function otherClick():void {<br />
//put your code here to be executed on single click<br />
Alert.show("first click");<br />
clearInterval(timeGap);<br />
}<br />
]]&#62;<br</code>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I have come across a very interesting problem while developing a flex application where I have a<br />
button control and I want to call two different functions on  click of the button . The interesting part<br />
is that I want to call two different functions on different events of the same button control, one at<br />
single click and other at double click .<br />
Now what to do in this case as it will always execute the function defined at single click .<br />
So what I am gonna do is to use a Timer using setInterval( ) method and use it to solve this problem.</p>
<p>The code goes here -</p>
<p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&gt;<br />
&lt;mx:Script&gt;<br />
&lt;![CDATA[<br />
import mx.controls.Alert;<br />
import flash.utils.clearInterval;<br />
private var timeGap:Number = new Number();<br />
private function doubleClick(event:MouseEvent):void {<br />
clearInterval(timeGap);<br />
//put your code here to be executed on double click<br />
Alert.show("double click");<br />
}<br />
private function singleClick(event:MouseEvent):void {<br />
clearInterval(timeGap);<br />
timeGap = setInterval(otherClick, 250);<br />
}<br />
private function otherClick():void {<br />
//put your code here to be executed on single click<br />
Alert.show("first click");<br />
clearInterval(timeGap);<br />
}<br />
]]&gt;<br />
&lt;/mx:Script&gt;<br />
&lt;mx:Button label="click" x="134" y="94"<br />
click="singleClick(event)"<br />
doubleClickEnabled="true"<br />
doubleClick="doubleClick(event)"/&gt;<br />
&lt;/mx:Application&gt;<br />
</code><br />
Now it&#8217;s the time to explain whats going on inside the code.<br />
On single click and double click events I am invoking two different Alerts to just display a message,<br />
In your case you can  write any code which is to be executed on those click events.</p>
<p>On click, inside the singleClick( ) method, we will reset &amp; initiate the timer which will call the<br />
otherClick( ) method on complete. otherClick( ) method contains actual single Click code.</p>
<p>If doubleClick is not invoked, then the  timer completes and otherClick( ) method is executed.<br />
But if doubleClick is invoked , it will call the doubleClick( ) method, where we will clear the<br />
timer  so the timer will not complete and execute the otherClick( ) method  and thus it will invoke the<br />
doubleClick( ) method.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/playing-with-mouseevent-in-flex-3/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Philosophy of Object Oriented Programming and Software Design</title>
		<link>http://query7.com/philosophy-of-object-oriented-programming-and-software-design</link>
		<comments>http://query7.com/philosophy-of-object-oriented-programming-and-software-design#comments</comments>
		<pubDate>Sat, 01 Nov 2008 14:33:25 +0000</pubDate>
		<dc:creator>yaapa</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Object-Oriented Programming]]></category>
		<category><![CDATA[philosophy]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbits.com/?p=241</guid>
		<description><![CDATA[Now, I am no expert in OOP or software design, but here's a philosophy which might help you make the most of what you know about OOP and software design.]]></description>
			<content:encoded><![CDATA[<p>Now, I am no expert in OOP or software design, but here&#8217;s a philosophy which might help you make the most of what you know about OOP and software design. I have observed and have read reports that people absorb most information when it&#8217;s presented in lists, preferably bulleted. So without any further ramling, I present you my bulleted philosophy of OOP and Software Design.</p>
<ul>
<li>It&#8217;s not how much and what you know; but what you can do with what you know, which&#8217;s important.</li>
</ul>
<ul>
<li>Ability to implement Polymorphism, Inheritance, private, public namespaces, static methods etc is no guarantee you are a good OO developer.</li>
</ul>
<ul>
<li>OOP is useless if you don&#8217;t use it to create good software design (architecture).</li>
</ul>
<ul>
<li>Using packages, classes, etc does not guarantee good software design.</li>
</ul>
<ul>
<li>When designing your software, think of it as an electronic device you are designing.</li>
</ul>
<ul>
<li>Sketch out the &#8216;electronic device&#8217;. Label the different components, list their functionalities.</li>
</ul>
<ul>
<li>Stay hungry, stay foolish.</li>
</ul>
<p>That&#8217;s it for today. I hope you are blessed with more knowledge, and the ability to make the best use of them.  Adios!</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/philosophy-of-object-oriented-programming-and-software-design/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

