<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.9.2 (http://www.squarespace.com/) on Thu, 11 Mar 2010 02:30:18 GMT--><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><title>AlterLogic Blog</title><subtitle>Blog</subtitle><id>http://www.alterlogic.co.uk/blog/</id><link rel="alternate" type="application/xhtml+xml" href="http://www.alterlogic.co.uk/blog/"/><link rel="self" type="application/atom+xml" href="http://www.alterlogic.co.uk/blog/atom.xml"/><updated>2009-08-11T08:13:25Z</updated><generator uri="http://www.squarespace.com/" version="Squarespace Site Server v5.9.2 (http://www.squarespace.com/)">Squarespace</generator><entry><title>Air TilieList drag bug workaround</title><category term="Air"/><category term="Flex"/><id>http://www.alterlogic.co.uk/blog/2009/1/20/air-tilielist-drag-bug-workaround.html</id><link rel="alternate" type="text/html" href="http://www.alterlogic.co.uk/blog/2009/1/20/air-tilielist-drag-bug-workaround.html"/><author><name>Alex Peretti</name></author><published>2009-01-20T21:45:32Z</published><updated>2009-01-20T21:45:32Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>This fix (more of a workaround really) is regarding a bug raised here</p>
<p><a title="http://bugs.adobe.com/jira/browse/SDK-14156" href="http://bugs.adobe.com/jira/browse/SDK-14156" target="_blank">http://bugs.adobe.com/jira/browse/SDK-14156</a></p>
<p>In Air (even v1.5), when an item is dragged from a TileList, the image data is not visible in the drag icon.</p>
<p><span>To circumvent the issue I created a </span>ListItemDragProxyPro class which allows us to create a custom drag icon for use with the TileList.</p>
<p>Since the drag proxy is completely custom I added a selection counter in the corner (the CircleIndicator component).</p>
<p>Here is an image of what it looks like.</p>
<p><span class="full-image-block ssNonEditable"><span><img src="http://media.alterlogic.co.uk/examples/AirTileListDragBugFix/AirTileListPro.jpg?__SQUARESPACE_CACHEVERSION=1232488161860" alt="" /></span></span></p>
<p>&nbsp;</p>
<p>To test this for yourself please feel free to view source and use it for your own projects.</p>
<p><a href="http://media.alterlogic.co.uk/examples/AirTileListDragBugFix/srcview/index.html" target="_blank">View Source&nbsp;</a>(a .air package is also included with the source)</p>
<p>If you have any questions about the code let me know and I'll go into it in more detail.</p>]]></content></entry><entry><title>Mouse events outside the browser window</title><category term="Flash"/><category term="Flex"/><id>http://www.alterlogic.co.uk/blog/2009/1/20/mouse-events-outside-the-browser-window.html</id><link rel="alternate" type="text/html" href="http://www.alterlogic.co.uk/blog/2009/1/20/mouse-events-outside-the-browser-window.html"/><author><name>Alex Peretti</name></author><published>2009-01-20T19:58:45Z</published><updated>2009-01-20T19:58:45Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>The mouseX and mouseY values are not accurate outside of the web browser window (in Flex or Flash applications), the values stop at the boundaries of the stage.</p>
<p>However, the values do get updated if the mouse button is down. Which is an important thing to notice when creating scrollbars for a Flash application or any draggable UI element.</p>
<p>The other thing to notice is that MOUSE_UP events do not fire outside of the browser window, and the buttonDown property of MouseEvents stay set to buttonDown == true, even though the button was depressed outside the window.</p>
<p>To solve this issue, we can track the MOUSE_LEAVE event, this event usually gets fired when the cursor leaves the stage. But if the mouse button is down, the event gets fired on MOUSE_UP.</p>
<p>No it doesn't make a huge amount of sense but it does work in Flash and Flex, flash player v9 and v10 (probably in previous versions too).</p>
<p>This means that when MOUSE_LEAVE is fired, we can compare the mouse position with the stage size to determine whether the mouse button was depressed outside the browser window.</p>
<p>Play with the example and view the source to see how this works in more detail.</p>
<script type="text/javascript" src="http://media.alterlogic.co.uk/deploy/js/swfobject.js"></script>
<p><div id="MouseEventTestsContent">
		<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">The Flash Plugin Version 9 is required to enter this site. Click here to download.</a>
	</div>

	<script type="text/javascript">
swfobject.embedSWF("http://media.alterlogic.co.uk/examples/MouseEventTests/MouseEventTests.swf", "MouseEventTestsContent", "700", "400", "9.0.0", "http://media.alterlogic.co.uk/deploy/expressInstall.swf")
	</script>
</p>
<a href="http://media.alterlogic.co.uk/examples/MouseEventTests/srcview/index.html" target="_blank">View Source</a>]]></content></entry><entry><title>Flex component clipContent problems and mask gotchas</title><category term="Flex"/><id>http://www.alterlogic.co.uk/blog/2009/1/20/flex-component-clipcontent-problems-and-mask-gotchas.html</id><link rel="alternate" type="text/html" href="http://www.alterlogic.co.uk/blog/2009/1/20/flex-component-clipcontent-problems-and-mask-gotchas.html"/><author><name>Alex Peretti</name></author><published>2009-01-20T15:22:14Z</published><updated>2009-01-20T15:22:14Z</updated><content type="html" xml:lang="en-US"><![CDATA[<script type="text/javascript" src="http://media.alterlogic.co.uk/deploy/js/swfobject.js"></script>
<p>The clipContent property of Flex component doesn't always work as it should, especially when the content which needs clipping is in the negative x and y range.</p>
<p>Drag and move the black box outside of the blue square, and you will see that the clipping doesn't come into play until you release the mouse.&nbsp;</p>
<div id="flashcontent">
		<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">The Flash Plugin Version 9 is required to enter this site. Click here to download.</a>
	</div>

	<script type="text/javascript">
swfobject.embedSWF("http://media.alterlogic.co.uk/examples/CanvasMaskExample/CanvasMaskExample.swf", "flashcontent", "700", "400", "9.0.0", "http://media.alterlogic.co.uk/deploy/expressInstall.swf")
	</script>
<a href="http://media.alterlogic.co.uk/examples/CanvasMaskExample/srcview/index.html" target="_blank">View Source</a>
<p>This was a big problem for my application UI so I figured I would use the mask property of the component. Well it works.... kinda. There are a couple of gotchas I would like to highlight here.</p>
<p>1) Make sure the DisplayObject which will act as a mask is a <span><span style="text-decoration: underline;">child</span></span>, of the DisplayObject being masked</p>
<p>2) If you are using Flex component such as Canvas to do the masking, make sure it has a backgroundColor set otherwise the mask will not be applied properly.</p>
<p><strong>Furthermore</strong>, if you simply want to emulate what clipContent does, it's best to use scrollRect.&nbsp;scrollRect will perform much quicker than setting a mask.</p>
<p>Click the "enable scrollRect" button in the example above and move the black box again to see the difference.</p>]]></content></entry><entry><title>Welcome</title><id>http://www.alterlogic.co.uk/blog/2009/1/7/welcome.html</id><link rel="alternate" type="text/html" href="http://www.alterlogic.co.uk/blog/2009/1/7/welcome.html"/><author><name>Alex Peretti</name></author><published>2009-01-07T19:24:52Z</published><updated>2009-01-07T19:24:52Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>This is a blog about technology, the web and the Flash platform.</p>]]></content></entry></feed>