<?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>Andrew's Tech Musings &#187; Flex</title>
	<atom:link href="http://andrewcurioso.com/tag/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewcurioso.com</link>
	<description>Tech, Social Media, PHP, Opinions</description>
	<lastBuildDate>Sat, 04 Sep 2010 12:37:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>A method called &#8216;delete&#8217; in Flex and AS3</title>
		<link>http://andrewcurioso.com/2009/07/a-method-called-delete-in-flex-and-as3/</link>
		<comments>http://andrewcurioso.com/2009/07/a-method-called-delete-in-flex-and-as3/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 05:26:30 +0000</pubDate>
		<dc:creator>Andrew Curioso</dc:creator>
				<category><![CDATA[Flex and AS3]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://andrewcurioso.com/?p=137</guid>
		<description><![CDATA[You are in for a headache if you have try to call a method or create a member variable with the name of a reserved word in Actionscript. It can lead to such fun situations as having variables called: insert; update; deleteSomething. Because calling the third variable &#8220;delete&#8221; may be logical but it is a [...]]]></description>
			<content:encoded><![CDATA[<p>You are in for a headache if you have try to call a method or create a member variable with the name of a reserved word in Actionscript. It can lead to such fun situations as having variables called: insert; update; deleteSomething. Because calling the third variable &#8220;delete&#8221; may be logical but it is a reserved word so that is out of the question. It gets hairier when you don&#8217;t necessarily have control over the object format (such is often the case with remote calls). I ran into this today when trying to call the &#8220;node_delete&#8221; (or &#8220;node.delete&#8221;) method in Drupal via Services and AMFPHP. This is frustrating so I&#8217;m going to show two situations where you could run into this problem and how I fixed them.<br />
<span id="more-137"></span></p>
<h3>Situation #1: A variable named &#8220;new&#8221; in a dynamic class</h3>
<p>You are creating a dynamic object and you need to use a reserved word as a member variable name but you can&#8217;t.<br />
<span class="syntaxhighlighterContainer">
<pre class="brush: jscript;">
var x:Object = new Object;
x.new = &quot;this doesn't work&quot;;
x['new'] = &quot;this works&quot;;
</pre>
<p></span><br />
The first method is a nice way to get <em>1084: Syntax error: expecting identifier before new</em> when you try to compile. Remove that line and use just the second one and you are all set. It is OK to mix and match access methods, as long as you never use dot notation for reserved words.</p>
<h3>Situation #2: A RPC method named delete</h3>
<p>You are making a remote call via the RemoteObject class (such as I was doing with Drupal) and you need to call a method named &#8220;delete&#8221; (or &#8220;new&#8221; for that matter). You naturally try this:<br />
<span class="syntaxhighlighterContainer">
<pre class="brush: jscript;">
var ro:RemoteObject = new RemoteObject;
ro.endpoint = &quot;http://www.example.com/amfphp&quot;;
ro.delete( 1234 );
</pre>
<p></span><br />
You will be promptly greeted by the now familiar 1084 error when you try to compile and using a different notation won&#8217;t work. I&#8217;ll break the solution into multiple parts although it could just as easily be chained together:<br />
<span class="syntaxhighlighterContainer">
<pre class="brush: jscript;">
var op:AbstractOperation = ro.getOperation('delete');
op.send( 12345 );
</pre>
<p></span><br />
Incidentally the result of the &#8220;send&#8221; method is a AsyncToken object (the same object that &#8220;ro.delete()&#8221; would return if delete were not reserved) which can then be used to add responders.</p>
<p>There you have it. Two quick and easy ways to get around methods and properties with reserved words for names.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewcurioso.com/2009/07/a-method-called-delete-in-flex-and-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drop shadow tricks in Flex</title>
		<link>http://andrewcurioso.com/2009/06/drop-shadow-tricks-in-flex/</link>
		<comments>http://andrewcurioso.com/2009/06/drop-shadow-tricks-in-flex/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 15:20:11 +0000</pubDate>
		<dc:creator>Andrew Curioso</dc:creator>
				<category><![CDATA[Flex and AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://andrewcurioso.com/?p=53</guid>
		<description><![CDATA[Every display markup language has its frustrating moments. Adobe Flex isn&#8217;t any exception. I ran into a little trouble a while back when trying to put a drop shadow on a HBox component. Here is the effect that I wanted to achieve: It seems easy enough so let&#8217;s give this a try: &#60;mx:Style&#62; HBox { [...]]]></description>
			<content:encoded><![CDATA[<p>Every display markup language has its frustrating moments. Adobe Flex isn&#8217;t any exception. I ran into a little trouble a while back when trying to put a drop shadow on a HBox component. Here is the effect that I wanted to achieve:</p>
<div id="attachment_57" class="wp-caption alignnone" style="width: 321px"><img class="size-full wp-image-57" title="Flex form with drop shadow header" src="http://andrewcurioso.com/wp-content/uploads/2009/05/picture-6.png" alt="Flex form with drop shadow header" width="311" height="216" /><p class="wp-caption-text">Flex form with drop shadow header</p></div>
<p><span id="more-53"></span></p>
<p>It seems easy enough so let&#8217;s give this a try:<br />
<span class="syntaxhighlighterContainer">
<pre class="brush: xml;">
&lt;mx:Style&gt;
HBox {
  paddingTop: 5;
  paddingBottom: 5;
  paddingLeft: 5;
  paddingRight: 5;
  dropShadowEnabled: true;
}
&lt;/mx:Style&gt;
</pre>
<p></span></p>
<p>Usually the <em>dropShadowEnabled: true</em> would be enough but in this case you may be surprised if you put the above style into an MXML file with an HBox in it. Drop shadows don&#8217;t work on HBox components without some more tweaking. They don&#8217;t work for VBox, FormItem, Canvas, Grid, and Tile either. But dropShadowEnabled works beautifully to create Flex drop shadows on a component like TextInput.</p>
<p>What sets TextInput apart? It has a border by default. That is the key. Put <em>borderStyle: solid</em> in our style sheet then all the sudden our HBox has a drop shadow. Unfortunately it also has a nice one pixel border as well. To fix that we can set the borderThickness to zero and you&#8217;re done.</p>
<p><span class="syntaxhighlighterContainer">
<pre class="brush: xml;">
&lt;mx:Style&gt;
HBox {
  paddingTop: 5;
  paddingBottom: 5;
  paddingLeft: 5;
  paddingRight: 5;
  dropShadowEnabled: true;
  borderThickness: 0;
  borderStyle: solid;
}
&lt;/mx:Style&gt;
</pre>
<p></span></p>
<h3>Quick Two Point Summary</h3>
<ul>
<li>Drop shadows will be hidden if the component doesn&#8217;t have a border.</li>
<li>The border can be zero pixels.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://andrewcurioso.com/2009/06/drop-shadow-tricks-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
