<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>&apos;Flex-able&apos; Programming</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/" />
<modified>2006-02-22T20:32:57Z</modified>
<tagline> Information on building and deploying Flex technology.</tagline>
<id>tag:weblogs.macromedia.com,2008:/eanderson//29</id>
<generator url="http://www.movabletype.org/" version="3.16">Movable Type</generator>
<copyright>Copyright (c) 2006, eanderson</copyright>
<entry>
<title>Document-Literal Web Services and Flex</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2006/02/document-litera.cfm" />
<modified>2006-02-22T20:32:57Z</modified>
<issued>2006-02-22T20:31:22Z</issued>
<id>tag:weblogs.macromedia.com,2006:/eanderson//29.10194</id>
<created>2006-02-22T20:31:22Z</created>
<summary type="text/plain">Flex 2 supports both RPC and doc-literal web services. If you&apos;re interested in the difference, I found an article on the IBM developer works site to be very helpful (http://www-128.ibm.com/developerworks/library/ws-whichwsdl/). Using xmethods.net I found a simple document-literal web service that,...</summary>
<author>
<name>eanderson</name>

<email>eanderson@macromedia.com</email>
</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>Flex 2 supports both RPC and doc-literal web services.  If you're interested in the difference, I found an article on the IBM developer works site to be very helpful (http://www-128.ibm.com/developerworks/library/ws-whichwsdl/).  Using xmethods.net I found a simple document-literal web service that, given a URL it will return all of the hyperlinks contained in the HTML document.  I then went ahead a built a simple Flex client that consumes the web service.  Note, the web service doesn't allow Flash client access (it has no crossdomain.xml), so I went ahead and use the Flex Enterprise Service proxy service to proxy the communication.  Below you'll find the code and the snippet from my flex-proxy-service.xml that enables the proxying.</p>]]>
<![CDATA[<p>Flex-proxy-services.xml</p>

<p>    &lt;destination id="myDocLitWS"&gt;<br />
        &lt;properties&gt;<br />
            // the location of the wsdl defined for soap proxy services<br />
            &lt;wsdl&gt;http://www.atomic-x.com/xmlservices/HyperlinkExtractor.asmx?wsdl&lt;/wsdl&gt;</p>

<p>            // the soap endpoints available for access defined for soap proxy services<br />
            &lt;soap&gt;http://www.atomic-x.com/xmlservices/HyperlinkExtractor.asmx&lt;/soap&gt;<br />
        &lt;/properties&gt;</p>

<p>        // a specific adapter ref for the destination may be defined<br />
        &lt;adapter ref="soap-proxy"/&gt;<br />
    &lt;/destination&gt;</p>

<p>doc-lit_example.mxml</p>

<p>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" verticalGap="10"&gt;</p>

<p>    &lt;mx:WebService id="myDocLitService" destination="myDocLitWS" result="myGrid.dataProvider=event.result"&gt;<br />
    	&lt;mx:operation name="ExtractUrl"&gt;<br />
	        &lt;mx:request&gt;<br />
	         		&lt;aUrl&gt;{theURL.text}&lt;/aUrl&gt;<br />
	        &lt;/mx:request&gt;<br />
        &lt;/mx:operation&gt;<br />
    &lt;/mx:WebService&gt;</p>

<p>    &lt;mx:HBox&gt;<br />
    	&lt;mx:Label text="Enter a URL and click the button to see all the hyperlinks:"/&gt;<br />
    	&lt;mx:TextInput id="theURL"/&gt;<br />
    &lt;/mx:HBox&gt;<br />
    <br />
 	&lt;mx:Button label="Invoke Web Service" click="myDocLitService.ExtractUrl.send()"/&gt;<br />
   <br />
   &lt;mx:DataGrid id="myGrid" width="100%"/&gt;</p>

<p>&lt;/mx:Application&gt;</p>]]>
</content>
</entry>
<entry>
<title>Adding notes.....</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2006/02/ive_been_thinki.cfm" />
<modified>2006-02-19T17:43:03Z</modified>
<issued>2006-02-19T17:40:24Z</issued>
<id>tag:weblogs.macromedia.com,2006:/eanderson//29.10160</id>
<created>2006-02-19T17:40:24Z</created>
<summary type="text/plain">I&apos;ve been thinking about collaborative work spaces a lot lately. One common collaboration need is for a group of people to add notes as they view an application. The sample below is an extremely basic example of adding a note...</summary>
<author>
<name>eanderson</name>

<email>eanderson@macromedia.com</email>
</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>I've been thinking about collaborative work spaces a lot lately.  One common collaboration need is for a group of people to add notes as they view an application.  The sample below is an extremely basic example of adding a note taking functionality to a basic Flex UI.  </p>

<p>You can go a lot of places with this kind of sample.  For example, you could have notes be saved 'off-line' in a database using messaging and then have them populate every time the application is opened.  Moreover, you can use DataServices to keep all note objects synchronized.  This is sample is very basic, but I'll come back to it in a few days (or weeks) when I have some more time to work on it -- unless you guys build something before then.</p>

<p> </p>

<p>Enjoy!</p>]]>
<![CDATA[<p>NoteTakingSample.mxml</p>

<p>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" layout="horizontal" &gt;</p>

<p>&lt;mx:Script&gt;</p>

<p>&lt;![CDATA[<br />
import Note;</p>

<p>public function addNote(event:Event) {<br />
		var myNote:Note = new Note();<br />
		myNote.x=event.target.x+50;<br />
		myNote.y=event.target.y+50;<br />
		myCanvas.addChild(myNote);<br />
}</p>

<p>public function deleteNote(note:Note) {<br />
	myCanvas.removeChild(note);<br />
}</p>

<p>]]&gt;<br />
&lt;/mx:Script&gt;</p>

<p>    &lt;mx:Model id="myEmployee"&gt;<br />
        &lt;employee employeeId="5"&gt;<br />
            &lt;firstName&gt;John&lt;/firstName&gt;<br />
            &lt;lastName&gt;Smith&lt;/lastName&gt;<br />
            &lt;phone&gt;617-219-3345&lt;/phone&gt;<br />
        &lt;/employee&gt;<br />
    &lt;/mx:Model&gt; <br />
    <br />
   &lt;mx:HBox id="myCanvas"&gt;<br />
	   &lt;mx:Panel id="myPanel" width="100%" height="100%" click="addNote(event)"&gt;<br />
	        &lt;mx:Label id="empid" text="{myEmployee.employee.employeeId}"/&gt;<br />
	        &lt;mx:Label id="fname" text="{myEmployee.employee.firstName}"/&gt;<br />
	        &lt;mx:Label id="lname" text="{myEmployee.employee.lastName}"/&gt;<br />
	        &lt;mx:Label id="phone" text="{myEmployee.employee.phone}"/&gt;<br />
	    &lt;/mx:Panel&gt;      	<br />
   &lt;/mx:HBox&gt;<br />
&lt;/mx:Application&gt;</p>

<p>Note.mxml</p>

<p>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;mx:Canvas xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" backgroundColor="yellow" width="150" borderStyle="outset" height="150"&gt;<br />
	&lt;mx:Script&gt;<br />
		&lt;![CDATA[<br />
			public function minSize() {<br />
				this.height=20;<br />
				this.width=20;	<br />
			}<br />
			public function maxSize() {<br />
				this.height=150;<br />
				this.width=150;	<br />
			}				<br />
			<br />
		]]&gt;<br />
	&lt;/mx:Script&gt;<br />
	&lt;mx:VBox&gt;<br />
		&lt;mx:TextArea backgroundColor="yellow" width="100%" id="myTextArea" click="maxSize()"/&gt;<br />
		&lt;mx:HBox&gt;<br />
		&lt;mx:Button click="Application.application.deleteNote(this)" label="Delete"/&gt;<br />
		&lt;mx:Button click="minSize()" label="Save" /&gt;<br />
		&lt;/mx:HBox&gt;<br />
	&lt;/mx:VBox&gt;<br />
&lt;/mx:Canvas&gt;</p>]]>
</content>
</entry>
<entry>
<title>Updating DataService Manged Data with non-Flex Clients</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2006/02/updating_datase.cfm" />
<modified>2006-02-06T19:37:53Z</modified>
<issued>2006-02-06T19:31:46Z</issued>
<id>tag:weblogs.macromedia.com,2006:/eanderson//29.10065</id>
<created>2006-02-06T19:31:46Z</created>
<summary type="text/plain">One issue when building Flex 2 application is how do you leverage the Data Service features of FES when your data store is updated with a process other then a Flex client. The best way to accomplish this today is...</summary>
<author>
<name>eanderson</name>

<email>eanderson@macromedia.com</email>
</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>One issue when building Flex 2 application is how do you leverage the Data Service features of FES when your data store is updated with a process other then a Flex client.  The best way to accomplish this today is to use JMS to listen for an broadcast a change notification to all Flex clients to update their data.  In this configuration, each Flex client listen to a JMS queue (using a message consumer) and call fill() when you receive a message that the queue is updated.  The JMS queue is notified of a change by the external application that updateds the data.  Simple as that!</p>

<p>To illustrate this, I've written up a simple example using the FES Sample application the Contact Manager.  </p>]]>
<![CDATA[<p>Below is the JSP code that will add a name to the Contact Manager data store and send a message to a JSP topic.</p>

<p>&lt;%@ page import="samples.contact.Contact,<br />
                 samples.contact.ContactDAO,<br />
                 java.util.Properties,<br />
                 javax.naming.Context,<br />
                 javax.naming.InitialContext,<br />
                 javax.jms.*"%&gt;<br />
&lt;%<br />
/*</p>

<p>Add a name to the contact data base using the DAO.  In a real world application this would be done in a transaction and the<br />
mesage to upate would be sent only when the update is successful.</p>

<p>*/</p>

<p>Contact myContact = new Contact();<br />
myContact.setFirstName("Eric");<br />
myContact.setLastName( "Anderson" );</p>

<p>ContactDAO myDAO = new ContactDAO();<br />
myDAO.create(myContact);<br />
%&gt;</p>

<p>&lt;%</p>

<p>/*</p>

<p>Publish a message to a JMS queue that will key the client to update its data</p>

<p>*/</p>

<p>TopicSession _pubSession = null;<br />
TopicSession _subSession = null;<br />
TopicPublisher _publisher = null;<br />
TopicConnection _connection = null;</p>

<p>String _providerurl = "127.0.0.1:2907";<br />
String _ctxtFactory = "jrun.naming.JRunContextFactory";</p>

<p>Properties p = new Properties();<br />
p.put(Context.PROVIDER_URL, _providerurl);<br />
p.put(Context.INITIAL_CONTEXT_FACTORY, _ctxtFactory);<br />
p.put(Context.SECURITY_PRINCIPAL, "admin");<br />
p.put(Context.SECURITY_CREDENTIALS , "admin");<br />
Context context = new InitialContext(p);<br />
TopicConnectionFactory factory = (TopicConnectionFactory) context.lookup("jms/flex/TopicConnectionFactory");<br />
 _connection = factory.createTopicConnection();<br />
_pubSession = _connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);<br />
_subSession = _connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);<br />
Topic topic = (Topic) context.lookup("jms/topic/flex/simpletopic");<br />
_publisher = _pubSession.createPublisher(topic);<br />
TopicSubscriber subscriber=_subSession.createSubscriber(topic);<br />
_connection.start();</p>

<p>ObjectMessage message = _pubSession.createObjectMessage();<br />
message.setStringProperty("userId", "");<br />
message.setStringProperty("msg", "");<br />
_publisher.publish(message, Message.DEFAULT_DELIVERY_MODE, Message.DEFAULT_PRIORITY, 5 * 60 * 1000);<br />
%&gt;</p>

<p>Now, all you need to do in your contactmgr.mxml is to add a message consumer as so:</p>

<p>&lt;mx:Consumer id="consumer" destination="chat-topic-jms" message="getLatestData()"/&gt;</p>

<p>Make sure that you call consumer.subscribe() so that the client will listen for messages.</p>

<p>Lastly, add the function getLatestData() which will call fill on the DataService.</p>

<p>public function getLatestData():void {<br />
ds.fill(contacts, new Array());<br />
}</p>

<p>Now, you should be able to update the data store with a JSP page and your Flex client will update itself without any polling needed.</p>]]>
</content>
</entry>
<entry>
<title>Flex 2 Remoting</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2006/02/flex_2_remoting.cfm" />
<modified>2006-02-02T16:28:00Z</modified>
<issued>2006-02-02T16:19:09Z</issued>
<id>tag:weblogs.macromedia.com,2006:/eanderson//29.10047</id>
<created>2006-02-02T16:19:09Z</created>
<summary type="text/plain">So wow, am I excited about what is going on over at Labs (http://labs.macromedia.com). The public Flex 2 beta is awesome for so many reasons -- one of which being the fact that I can continue to blog about all...</summary>
<author>
<name>eanderson</name>

<email>eanderson@macromedia.com</email>
</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>So wow, am I excited about what is going on over at Labs (http://labs.macromedia.com).  The public Flex 2 beta is awesome for so many reasons -- one of which being the fact that I can continue to blog about all of the cool Flex 2 stuff we learn here in public.</p>]]>
<![CDATA[<p>As many people have noted Flex 2 has an upgraded RemoteObject (hereafter called RO) service which includes an upgrade of the AMF protocol to AMF3 -- previous versions of Flex RO use AMF0 which was originally available in Flash Remoting.  This AMF upgrade is a good thing in that the latest AMF protocol has improvements in it that make possible Flex Enterprise Services features like data paging, lazy loading of data, and data synchronization between Flex client and server (including the ever so hard to solve conflict management problem we've seen in complex Flex 1.5 applications) among other things.</p>

<p>This same update to remoting is available for Cold Fusion (in beta form) with the CF/Flex connectivity components available here <a href="http://labs.macromedia.com/technologies/cf_flexconnectivity/">CF/Flex Connectivity</a>.  The CF/Flex connectivity beta components includes the CF Flash Remoting update (updating the gateway to AMF3) and a Cold Fusion Event Gateway that allows CF to leverage the Flex Enterprise Services messaging feature to deliver real-time data push, pub/sub messaging and collaboration.</p>

<p>Happy Remoting!</p>]]>
</content>
</entry>
<entry>
<title>Adding Dynamic UI Elements</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2006/01/adding_dynamic.cfm" />
<modified>2006-02-02T16:25:29Z</modified>
<issued>2006-01-29T09:50:13Z</issued>
<id>tag:weblogs.macromedia.com,2006:/eanderson//29.10015</id>
<created>2006-01-29T09:50:13Z</created>
<summary type="text/plain">Hello! After a long hiatus, I have returned to the Flex blog-o-sphere. I won&apos;t torture anyone with the long story where I go MaD; er, I mean I went and worked in Adobe&apos;s Mobile and Device division. Suffice it to...</summary>
<author>
<name>eanderson</name>

<email>eanderson@macromedia.com</email>
</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>Hello!</p>

<p>After a long hiatus, I have returned to the Flex blog-o-sphere.  I won't torture anyone with the long story where I go MaD; er, I mean I went and worked in Adobe's Mobile and Device division.  Suffice it to say I have enough frequent flyer miles to last for a while.  Nevertheless, I'm back now, working on Flex 2.</p>

<p>I've been working on some applications and I wanted to post some information you might find useful.  One technique I use for building dynamic UIs is to add child components programmatically.  The way to do this is to use the addChild method (this works in both AS 2 and AS 3) on a container -- that can either have content in it already or it could be empty.  </p>]]>
<![CDATA[<p>Below is some simple code that adds a custom component to an HBox:</p>

<p>DynamicComponent.mxml</p>

<p>&lt;?xml version="1.0" encoding="utf-8"?&gt;</p>

<p>&lt;mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" backgroundColor="white"&gt; </p>

<p>&lt;mx:Script&gt;</p>

<p>&lt;![CDATA[</p>

<p>public function createBarsToo() {</p>

<p>myHBox.addChild(new CustomComponent()); </p>

<p>} </p>

<p>]]&gt;</p>

<p>&lt;/mx:Script&gt;</p>

<p>&lt;mx:HBox id="myHBox" horizontalGap="3" backgroundColor="red" width="150" height="50"/&gt;</p>

<p>&lt;mx:Button id="myButtonToo" click="createBarsToo()" label="Create Component"/&gt;</p>

<p>&lt;/mx:Application&gt;</p>

<p>CustomComponent.mxml</p>

<p>&lt;?xml version="1.0" encoding="utf-8"?&gt;</p>

<p>&lt;mx:Canvas xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" backgroundColor="blue" cornerRadius="5" width="1" borderStyle="inset" height="50"&gt;</p>

<p>&lt;/mx:Canvas&gt;</p>]]>
</content>
</entry>
<entry>
<title>Dashed Lined Charts</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2005/02/dashed_lined_ch.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2005-02-24T01:55:36Z</issued>
<id>tag:weblogs.macromedia.com,2005:/eanderson//29.7947</id>
<created>2005-02-24T01:55:36Z</created>
<summary type="text/plain">I worked on an interesting problem recently where someone wanted to create dashed line charts. Sounds simple enough, until I did some research and figured out that in Flash there isn’t native support for drawing a dotted (or dashed) line....</summary>
<author>
<name></name>


</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>I worked on an interesting problem recently where someone wanted to create dashed line charts. Sounds simple enough, until I did some research and figured out that in Flash there isn’t native support for drawing a dotted (or dashed) line. So what you have to do is develop some drawing logic that will measure the length of each ‘dash’ and draw it while allowing for some sections to be blank – thereby creating the dashed effect.  I adapted some code I found on the web (I don't remember in my search where I ended-up, so thanks to whoever contributed it) to a line renderer to produce a dashed line chart. Nevertheless, it was a cool learning experience with developing a line renderer.</p>]]>
<![CDATA[<p>I’m not going to post code to the blog any more, I’d rather just expose download files – the fonts and formatting for MXML and AS are too much work to make it look nice. If there are complaints write me an email and I’ll see what I can do. </p>
<p>Below is a sample of what the demo looks like.</p>
<p>
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="500" height="375">
    <param name="movie" value="http://www.markme.com/eanderson/archives/demo/chartdemo.swf">
    <param name="quality" value="high">
    <embed src="http://www.markme.com/eanderson/archives/demo/chartdemo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="375"></embed>
  </object>
</p>
<p>Enjoy!</p>
<p><a href="http|//www.markme.com/eanderson/archives/code/MyDashedLineRenderer.as">Download AS file</a></p>
<p><a href="file:///C|/Documents%20and%20Settings/eanderson/Local%20Settings/Temporary%20Internet%20Files/Content.IE5/S84S9D8E/chartdemo.mxml">Download file</a></p>]]>
</content>
</entry>
<entry>
<title>Overlayed Charts</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2005/02/overlayed_chart.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2005-02-18T14:14:09Z</issued>
<id>tag:weblogs.macromedia.com,2005:/eanderson//29.7946</id>
<created>2005-02-18T14:14:09Z</created>
<summary type="text/plain">I frequently get requests from customers who are interested in displaying multiple charts in the same graph. The code here is a simple example of a line chart on top of a bar chart. Enjoy........</summary>
<author>
<name></name>


</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>I frequently get requests from customers who are interested in displaying multiple charts in the same graph.  The code here is a simple example of a line chart on top of a bar chart.  </p>

<p>Enjoy.....</p>]]>
<![CDATA[<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br><br />
&lt;!-- wrap everything in a canvas --&gt;<br />
<p>&lt;mx:Application xmlns:mx=&quot;http://www.macromedia.com/2003/mxml&quot;&gt;<br><br />
&lt;mx:Script&gt;<br><br />
  var expenses = [{Month: &quot;Jan&quot;, Profit: 2000, Expenses: 1500, Amount:<br><br />
  450, LowPoints: 0, HighPoints: 2030},<br><br />
  {Month: &quot;Feb&quot;, Profit: 1000, Expenses: 200, Amount: 600,<br><br />
  LowPoints: 0, HighPoints: -1220}];<br><br />
&lt;/mx:Script&gt;</p><br />
<p>&lt;mx:VBox xmlns:mx=&quot;http://www.macromedia.com/2003/mxml&quot; height=&quot;100%&quot;<br><br />
  width=&quot;100%&quot; backgroundColor=&quot;white&quot;&gt;</p><br />
<p> &lt;mx:Script&gt;<br><br />
&lt;![CDATA[<br><br />
  var isPrinting:Boolean = true;<br><br />
  function defineLabel( l:String ) : String<br><br />
  {<br><br />
  trace(&quot;Print label &quot;+l+&quot; = &quot;+isPrinting);<br><br />
  if( isPrinting ) return &quot;&quot;;<br><br />
  else return l;<br><br />
  }<br><br />
  <br><br />
  function changeData() {<br><br />
  <br><br />
  expenses = [{Month: &quot;Jan&quot;, Profit: 2000, Expenses:<br><br />
  1500, Amount: 450, LowPoints: 0, HighPoints: 2030},<br><br />
  {Month: &quot;Feb&quot;, Profit: 1000, Expenses: 200, Amount: 600,<br><br />
  LowPoints: 0, HighPoints: -1220},<br><br />
  {Month: &quot;Mar&quot;, Profit: 1500, Expenses: 500, Amount: 300,<br><br />
  LowPoints: 0, HighPoints: 1900},<br><br />
  {Month: &quot;April&quot;, Profit: 100, Expenses: 50, Amount: 150,<br><br />
  LowPoints: 0, HighPoints: 1870}];<br><br />
  <br><br />
  }<br><br />
  ]]&gt;<br><br />
&lt;/mx:Script&gt;</p><br />
<p> &lt;!-- main chart --&gt;<br><br />
&lt;!-- showDataTips is set to true to show datapoint popups --&gt;</p><br />
<p> &lt;mx:CartesianChart id=&quot;myMainChart&quot; styleName=&quot;mainChart&quot;<br><br />
  dataProvider=&quot;{expenses}&quot; <br><br />
  height=&quot;100%&quot; width=&quot;100%&quot; showDataTips=&quot;true&quot;&gt;<br><br />
  <br><br />
&lt;!-- formats grid and prints the axis labels; if categoryField property is blank then<br><br />
  the grid does not get formatted; **********Have not found a way to not print the labels********--&gt;<br><br />
&lt;mx:horizontalAxis&gt;<br><br />
&lt;mx:CategoryAxis categoryField=&quot;Month&quot;<br><br />
  dataProvider=&quot;{expenses}&quot; /&gt;<br><br />
&lt;/mx:horizontalAxis&gt;<br><br />
&lt;mx:horizontalAxisRenderer&gt;<br><br />
&lt;!--mx:AxisRenderer title=&quot;Expenses&quot;<br><br />
  labelFunction=&quot;defineLabel&quot;/ --&gt;<br><br />
&lt;mx:AxisRenderer labelFunction=&quot;defineLabel&quot; /&gt;<br><br />
&lt;/mx:horizontalAxisRenderer&gt;</p><br />
<p> &lt;!-- alternating background color and grid lines --&gt;<br><br />
&lt;mx:backgroundElements&gt;<br><br />
&lt;mx:Array&gt;<br><br />
&lt;mx:GridLines direction=&quot;both&quot; &gt;<br><br />
&lt;mx:verticalFill&gt;<br><br />
&lt;mx:SolidColor color=&quot;#F4F4F4&quot; alpha=&quot;66&quot; /&gt;<br><br />
&lt;/mx:verticalFill&gt;<br><br />
&lt;/mx:GridLines&gt;<br><br />
&lt;/mx:Array&gt;<br><br />
&lt;/mx:backgroundElements&gt;</p><br />
<p> &lt;!-- specify lines to draw the chart data--&gt;<br><br />
&lt;mx:series&gt;<br><br />
&lt;mx:Array&gt;</p><br />
<p> &lt;!-- high/low bars (display behind chart lines --&gt;<br><br />
&lt;mx:ColumnSeries yField=&quot;HighPoints&quot; columnWidthRatio=&quot;.1&quot;<br><br />
  minField=&quot;LowPoints&quot;&gt;<br><br />
&lt;!-- hide shadows on columns --&gt;<br><br />
&lt;mx:renderer&gt;<br><br />
&lt;mx:SimpleBoxRenderer/&gt;<br><br />
&lt;/mx:renderer&gt;<br><br />
&lt;!-- define color and opacity of bars --&gt;<br><br />
&lt;mx:fill&gt;<br><br />
&lt;mx:SolidColor color=&quot;#D5DEDD&quot; alpha=&quot;100&quot;<br><br />
  /&gt;<br><br />
&lt;/mx:fill&gt;<br><br />
&lt;/mx:ColumnSeries&gt;</p><br />
<p> &lt;mx:LineSeries yField=&quot;Profit&quot; name=&quot;Profit&quot;&gt;<br><br />
&lt;!-- hide line shadow --&gt;<br><br />
&lt;mx:renderer&gt;<br><br />
&lt;mx:SimpleLineRenderer /&gt;<br><br />
&lt;/mx:renderer&gt;<br><br />
&lt;!-- specifies thickness and color of line; weight can not be in percent and does not scale --&gt;<br><br />
&lt;mx:stroke&gt;<br><br />
&lt;mx:Stroke color=&quot;0x3F5FC4&quot; weight=&quot;3&quot;<br><br />
  alpha=&quot;100&quot; /&gt;<br><br />
&lt;/mx:stroke&gt;<br><br />
&lt;/mx:LineSeries&gt;<br><br />
&lt;mx:LineSeries yField=&quot;Expenses&quot; name=&quot;Expenses&quot; &gt;<br><br />
&lt;mx:renderer&gt;<br><br />
&lt;mx:SimpleLineRenderer /&gt;<br><br />
&lt;/mx:renderer&gt;<br><br />
&lt;mx:stroke&gt;<br><br />
&lt;mx:Stroke color=&quot;red&quot; weight=&quot;3&quot;<br><br />
  alpha=&quot;100&quot; /&gt;<br><br />
&lt;/mx:stroke&gt;<br><br />
&lt;/mx:LineSeries&gt;<br><br />
&lt;mx:LineSeries yField=&quot;Amount&quot; name=&quot;Amount&quot; &gt;<br><br />
&lt;mx:renderer&gt;<br><br />
&lt;mx:SimpleLineRenderer /&gt;<br><br />
&lt;/mx:renderer&gt;<br><br />
&lt;mx:stroke&gt;<br><br />
&lt;mx:Stroke color=&quot;green&quot; weight=&quot;3&quot;<br><br />
  alpha=&quot;100&quot; /&gt;<br><br />
&lt;/mx:stroke&gt;<br><br />
&lt;/mx:LineSeries&gt;</p><br />
<p> &lt;/mx:Array&gt;<br><br />
&lt;/mx:series&gt;</p><br />
<p> &lt;/mx:CartesianChart&gt;<br><br />
    <br><br />
&lt;mx:Button click=&quot;changeData()&quot; label=&quot;Click here to change data.&quot;&gt;&lt;/mx:Button&gt; &lt;/mx:VBox&gt; &lt;/mx:Application&gt;</p>]]>
</content>
</entry>
<entry>
<title>Creating visual ques for sorting without the sort</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2004/12/creating_visual.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2004-12-15T23:01:39Z</issued>
<id>tag:weblogs.macromedia.com,2004:/eanderson//29.7945</id>
<created>2004-12-15T23:01:39Z</created>
<summary type="text/plain">You can easily leverage the DataGrid’s visual que to indicate when a sort has taken place by using the sortOnHeaderRelease property on the DataGridColumn class. Why would you want to do this? Well, for starters you could have a server-side...</summary>
<author>
<name></name>


</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>You can easily leverage the DataGrid’s visual que to indicate when a sort has taken place by using the sortOnHeaderRelease property on the DataGridColumn class.  Why would you want to do this?  Well, for starters you could have a server-side sorting system that will sort data and return sorted data to the client for display.  Below is some sample code that shows how to do this.</p>]]>
<![CDATA[<p>&lt;mx:DataGrid id=&quot;grid&quot; width=&quot;500&quot; height=&quot;200&quot; dataProvider=&quot;{employeeModel.employee}&quot; &gt;<br><br />
&lt;mx:columns&gt;<br><br />
&lt;mx:Array&gt;<br><br />
&lt;mx:DataGridColumn columnName=&quot;name&quot; headerText=&quot;Name&quot; sortOnHeaderRelease=&quot;false&quot;/&gt;<br><br />
&lt;mx:DataGridColumn columnName=&quot;phone&quot; headerText=&quot;Phone&quot; sortOnHeaderRelease=&quot;false&quot;/&gt;<br><br />
&lt;mx:DataGridColumn columnName=&quot;email&quot; headerText=&quot;Email&quot; sortOnHeaderRelease=&quot;false&quot;/&gt;<br><br />
&lt;/mx:Array&gt;<br><br />
&lt;/mx:columns&gt;<br><br />
&lt;/mx:DataGrid&gt;</p>]]>
</content>
</entry>
<entry>
<title>Using Complex XML in a DataGrid</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2004/12/using_complex_x.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2004-12-10T18:34:47Z</issued>
<id>tag:weblogs.macromedia.com,2004:/eanderson//29.7944</id>
<created>2004-12-10T18:34:47Z</created>
<summary type="text/plain"><![CDATA[ Flex's Data Grid component is a great out of the box component for representing one dimensional data. I&rsquo;ve run into a number of Flex applications that use XML documents to transfer data to and from a Flex application. Somewhat...]]></summary>
<author>
<name></name>


</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p> Flex's Data Grid component is a great out of the box component for representing one dimensional data. I&rsquo;ve run into a number of Flex applications that use XML documents to transfer data to and from a Flex application. Somewhat frequently people have problems representing XML data in Flex list controls. I chalk this up to the fact that XML is such a great way to organize and represent data that it makes it extremely easy to develop a complex data structure in XML. Before a Flex control (like a Data Grid) can consume a complex XML document you need to convert that data into something that Flex can understand. I&rsquo;ve included an example of a complex XML document used in a Data Grid.</p>]]>
<![CDATA[<p> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; <br />
 &lt;mx:Application xmlns:mx=&quot;http://www.macromedia.com/2003/mxml&quot;&gt; <br />
 &lt;mx:Model id=&quot;myModel&quot; source=&quot;mydata.xml&quot;/&gt; <br />
 &lt;mx:DataGrid height=&quot;300&quot; width=&quot;300&quot; dataProvider=&quot;{mx.utils.ArrayUtil.toArray(myModel.SRMData.SRMComposite.SRMRow[0].Z)}&quot;/&gt; <br />
 &lt;/mx:Application&gt; <br />
&nbsp; <br />
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; <br />
 &lt;SRM&gt; <br />
 &lt;SRMData SRMDataSpace=&quot;Main&quot;&gt; <br />
 &lt;SRMComposite n=&quot;RecordSet&quot;&gt; <br />
 &lt;SRMRow&gt; <br />
 &lt;Z name=&quot;Eric Anderson&quot;/&gt; <br />
 &lt;Z name=&quot;Brandon Purcell&quot;/&gt; <br />
 &lt;Z name=&quot;Kurt Mossman&quot;/&gt; <br />
 &lt;Z name=&quot;Lin Lin&quot;/&gt; <br />
 &lt;/SRMRow&gt; <br />
 &lt;SRMRow&gt; <br />
 &lt;x&gt;some other data&lt;/x&gt; <br />
 &lt;/SRMRow&gt; <br />
 &lt;/SRMComposite&gt; <br />
 &lt;/SRMData&gt; <br />
 &lt;/SRM&gt;</p>]]>
</content>
</entry>
<entry>
<title>Debugging the Debug Player</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2004/12/debugging_the_d.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2004-12-08T17:44:35Z</issued>
<id>tag:weblogs.macromedia.com,2004:/eanderson//29.7943</id>
<created>2004-12-08T17:44:35Z</created>
<summary type="text/plain">Ever wonder if you are running the correct version of the Flash Debug player? I have this problem all the time. There is a technote on the Flex support site (http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19245) that shows you what version of the player (debug...</summary>
<author>
<name></name>


</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>Ever wonder if you are running the correct version of the Flash Debug player? I have this problem all the time. There is a technote on the Flex support site (<a href="http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19245">http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19245</a>) that shows you what version of the player (debug or release) and provides instructions on how to install. I also wrote a DevNet article (<a href="http://www.macromedia.com/devnet/flex/articles/client_debug.html">http://www.macromedia.com/devnet/flex/articles/client_debug.html</a>) on debugging application that has additional information on installing and configuring the Flash debug player.</p>]]>

</content>
</entry>
<entry>
<title>Binding XML data to a Bar Chart in Flex</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2004/12/binding_xml_dat.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2004-12-07T16:06:37Z</issued>
<id>tag:weblogs.macromedia.com,2004:/eanderson//29.7942</id>
<created>2004-12-07T16:06:37Z</created>
<summary type="text/plain">I&apos;ve frequently worked with people to be able to integrate XML data (generated by a dynamic source like a JSP or CFM) with a Flex 1.5 chart. The easiest way to make this work is to use an HTTPService to...</summary>
<author>
<name></name>


</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>I've frequently worked with people to be able to integrate XML data (generated by a dynamic source like a JSP or CFM) with a Flex 1.5 chart. The easiest way to make this work is to use an HTTPService to request the dynamic page and then bind the results to an MX Model. The thing that frequently causes developers pain is how to get access to the results object. In general I advocate using the <code>event.result</code> property and then refering to the XML nodes.</p>]]>
<![CDATA[<p>Consider the following XML document that is generated by a CFM.</p>

<p>&lt;volumedata&gt;<br />
                &lt;data&gt;<br />
		&lt;mydata&gt;123&lt;/mydata&gt;<br />
	&lt;/data&gt;<br />
	&lt;data&gt;<br />
		&lt;mydata&gt;1234&lt;/mydata&gt;<br />
	&lt;/data&gt;<br />
	&lt;data&gt;<br />
		&lt;mydata&gt;12345&lt;/mydata&gt;<br />
	&lt;/data&gt;<br />
	&lt;data&gt;<br />
		&lt;mydata&gt;123456&lt;/mydata&gt;<br />
	&lt;/data&gt;<br />
&lt;/volumedata&gt;</p>

<p>To access this data you might use MXML code as follows:</p>

<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />
 &lt;mx:Application xmlns:mx=&quot;http://www.macromedia.com/2003/mxml&quot; creationComplete=&quot;myService.send();&quot;&gt;<br />
 &lt;mx:Model id=&quot;results&quot;&gt;{myService.result.volumedata.data}&lt;/mx:Model&gt;<br />
 &lt;mx:HTTPService id=&quot;myService&quot; url=&quot;http://server/cfusion/report.cfm&quot; showBusyCursor=&quot;true&quot;/&gt;<br />
 &lt;mx:ColumnChart width=&quot;100%&quot; height=&quot;100%&quot; showDataTips=&quot;true&quot; id=&quot;chart&quot; dataProvider=&quot;{results}&quot;&gt;<br />
 &lt;mx:horizontalAxis&gt;<br />
 &lt;mx:CategoryAxis name=&quot;Flex Chart Data&quot; categoryField=&quot;mydata&quot; dataProvider=&quot;{results}&quot;/&gt;<br />
 &lt;/mx:horizontalAxis&gt;<br />
 &lt;mx:series&gt;<br />
 &lt;mx:Array&gt;<br />
 &lt;mx:ColumnSeries yField=&quot;mydata&quot; name=&quot;mydata&quot;/&gt;<br />
 &lt;/mx:Array&gt;<br />
 &lt;/mx:series&gt;<br />
 &lt;/mx:ColumnChart&gt;<br />
 &lt;mx:HBox width=&quot;25%&quot;&gt;<br />
 &lt;mx:Legend dataProvider=&quot;chart&quot; /&gt;<br />
 &lt;/mx:HBox&gt;<br />
 &lt;mx:HBox width=&quot;75%&quot;&gt;<br />
 &lt;mx:Button click=&quot;myService.send()&quot; label=&quot;Update Data&quot; /&gt;<br />
 &lt;/mx:HBox&gt;<br />
 &lt;/mx:Application&gt;</p>]]>
</content>
</entry>
<entry>
<title>New Support Resources Available</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2004/12/new_support_res.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2004-12-07T01:52:07Z</issued>
<id>tag:weblogs.macromedia.com,2004:/eanderson//29.7941</id>
<created>2004-12-07T01:52:07Z</created>
<summary type="text/plain">As a support manager communicating technical information to the Macromedia community is critically important. In comes the new Knowledge Base. The great folks who run the KB project have a blurb on their project here: http://www.macromedia.com/support/knowledgebase/. You can also get...</summary>
<author>
<name></name>


</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>As a support manager communicating technical information to the Macromedia community is critically important.  In comes the new Knowledge Base.  The great folks who run the KB project have a blurb on their project here: <a href="http://www.macromedia.com/support/knowledgebase/">http://www.macromedia.com/support/knowledgebase/</a>. You can also get access to the Flex support center here: <a href="http://www.macromedia.com/support/flex">http://www.macromedia.com/support/flex</a>.</p>]]>

</content>
</entry>
<entry>
<title>Loading and Sending XML Data using the HTTPService</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2004/12/loading_and_sen.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2004-12-06T19:24:28Z</issued>
<id>tag:weblogs.macromedia.com,2004:/eanderson//29.7940</id>
<created>2004-12-06T19:24:28Z</created>
<summary type="text/plain">I&apos;ve been looking at sending and receiving data asyncronously using Flex&apos;s HTTPService and native Flash data loading capabilities. One thing that tripped me up with that xml.load() was an asyscronous data call -- which means you cannot use the result/return...</summary>
<author>
<name></name>


</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>I've been looking at sending and receiving data asyncronously using Flex's HTTPService and native Flash data loading capabilities. One thing that tripped me up with that xml.load() was an asyscronous data call -- which means you cannot use the result/return object until it is completly loaded. One way around this is to use the AS delegate to invoke a function which uses the result. Below is some code.</p>]]>
<![CDATA[<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br><br />
&lt;mx:Application xmlns:mx=&quot;http://www.macromedia.com/2003/mxml&quot;&gt;<br><br />
&lt;mx:Script&gt;<br><br />
    function LoadRequest() {<br><br />
    var myXML = new XML();<br><br />
    myXML.ignoreWhite = true;<br><br />
    myXML.load (&quot;tree.xml&quot;);<br><br />
    myXML.onLoad = mx.utils.Delegate.create(this, function() { myService.send(myXML) });<br><br />
    }<br><br />
    <br><br />
    function ProcResult(event) {<br><br />
    txtDebug.text = event.result;<br><br />
    }<br><br />
    <br><br />
    function ProcFault(errorString, code) {<br><br />
    txtIssuerList.text = errorString + &quot; &quot; + code ;<br><br />
    } <br><br />
&lt;/mx:Script&gt;</code></p><br />
  <p> <code>&lt;mx:Button click=&quot;LoadRequest()&quot; label=&quot;Get and Send Data&quot;/&gt;<br><br />
    <br><br />
&lt;mx:TextArea id=&quot;txtDebug&quot;/&gt;<br><br />
&lt;mx:TextArea id=&quot;txtIssuerList&quot;/&gt;<br><br />
    <br><br />
&lt;mx:HTTPService url=&quot;http://localhost:8700/flex/servlet/test.MyServletPrintln&quot; contentType=&quot;application/xml&quot; method=&quot;post&quot; id=&quot;myService&quot; <br><br />
    fault=&quot;ProcFault(event.fault.faultstring, event.fault.faultcode)&quot; result=&quot;ProcResult(event)&quot;&gt;<br><br />
&lt;/mx:HTTPService&gt;<br><br />
&lt;/mx:Application&gt;</p>]]>
</content>
</entry>
<entry>
<title>Session Access in an Embeded Flex App</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2004/12/session_access.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2004-12-06T12:57:29Z</issued>
<id>tag:weblogs.macromedia.com,2004:/eanderson//29.7939</id>
<created>2004-12-06T12:57:29Z</created>
<summary type="text/plain">Flex applications can easily interact with Java session data from within a JSP by explicitly passing the jsessionid to any HTTP requests that are made to the server. The following is a simple example of how to do this....</summary>
<author>
<name></name>


</author>
<dc:subject>Flex Tips and Tricks</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>Flex applications can easily interact with Java session data from within a JSP by explicitly passing the jsessionid to any HTTP requests that are made to the server. The following is a simple example of how to do this.</p>]]>
<![CDATA[<p> <code>&lt;%@ page session=&quot;true&quot; %&gt; </code><br />
 <code>&lt;%@ taglib uri=&quot;FlexTagLib&quot; prefix=&quot;mm&quot; %&gt; </code><br />
   <code>&lt;% </code><br />
  <code> Integer num = new Integer(22100); </code><br />
  <code> session.putValue(&quot;num&quot;,num); </code><br />
  <code> %&gt; </code><br />
   <code>&lt;html&gt;&lt;body&gt; </code><br />
   <code>&lt;h3&gt;Introduction&lt;/h3&gt; </code><br />
   <code>&lt;p&gt;This is an example of writing MXML in a JSP.&lt;/p&gt; </code><br />
   <code>&lt;h3&gt;My App&lt;/h3&gt;</code><br />
  <code>&lt;mm:mxml border=&quot;1&quot;&gt; </code><br />
   <code>&lt;mx:Application xmlns:mx=&quot;http://www.macromedia.com/2003/mxml&quot; creationComplete=&quot;myService.send();&quot;&gt; </code><br />
   <code>&lt;mx:HTTPService url=&quot;test.jsp;jsessionid=&lt;%=session.getId()%&gt;&quot; id=&quot;myService&quot;/&gt; </code><br />
   <code>&lt;mx:Label text=&quot;&lt;%= session.getAttribute(&quot;num&quot;) %&gt;&quot;/&gt; </code><br />
   <code>&lt;mx:Label text=&quot;&lt;%= session.getId() %&gt;&quot;/&gt; </code><br />
   <code>&lt;/mx:Application&gt; </code><br />
   <code>&lt;/mm:mxml&gt;&lt;br&gt; </code><br />
   <code>&lt;/body&gt; </code><br />
  <code>&lt;/html&gt;</p>]]>
</content>
</entry>
<entry>
<title>Flex License Tool Usage</title>
<link rel="alternate" type="text/html" href="http://weblogs.macromedia.com/eanderson/archives/2004/12/flex_license_to.cfm" />
<modified>2005-07-01T21:08:13Z</modified>
<issued>2004-12-05T14:07:47Z</issued>
<id>tag:weblogs.macromedia.com,2004:/eanderson//29.7938</id>
<created>2004-12-05T14:07:47Z</created>
<summary type="text/plain">Flex servers are licensed per CPU, however, each Flex web application that is running on a given machine has to have a license key installed to function properly. I wrote an article that was circulate to Macromedia customer service that...</summary>
<author>
<name></name>


</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.macromedia.com/eanderson/">
<![CDATA[<p>Flex servers are licensed per CPU, however, each Flex web application that is running on a given machine has to have a license key installed to function properly.  I wrote an article that was circulate to Macromedia customer service that details how to use the Flex license tool to install a new key, as well as provides some information on how to debug a problem you are having.</p>]]>
<![CDATA[<p>How to Use the Flex License Tool </p><br />
<p>To install a new trial edition for Flex follow these steps:</p><br />
<ol><br />
  <li>Get a new trial license key from Macromedia customer service or Macromedia sales.</li><br />
  <li>Bring up a command prompt (terminal window on UNIX) and navigate to the {flex.rootdir}/bin directory. On Windows the default installation directory for Flex is c:\Program Files\Macromedia\Flex. The customer&rsquo;s Flex location may vary depending on where they installed the product.</li><br />
  <li>Use the licensetool.exe to insert the new key. The following is an example of the syntax used to enter the new key.</li><br />
</ol><br />
<p>licensetool &ndash;install {license key} {Flex application directory}</p><br />
<p>Figure One shows an example of using the licensetool.exe to install the new license key for the Flex default application. In this installation {flex.rootdir} is located at C:\App-Servers\Flex.</p><br />
<p>Below is an example of the message that the license tool will output after successfully installing a license key.</p><br />
<blockquote><br />
  <p><em>C:\eanderson\App-Servers\Macromedia\Flex\bin&gt;licensetool -install FEDxxx-xxxxx-c:\eanderson\app-servers\macromedia\flex\jrun4\servers\default\flex</em></p><br />
  <p><em>The license key was successfully installed.</em></p><br />
  <p><em>Retrieving licensing information, please wait ...</em></p><br />
  <p><em>- Flex 1.0 Full Commercial Edition enabled</em></p><br />
  <p><em>C:\eanderson\App-Servers\Macromedia\Flex\bin&gt;</em></p><br />
</blockquote><br />
<p><strong>What to do is you have a problem </strong></p><br />
<p>If you have problems when using the tool, check the following:</p><br />
<ol><br />
  <li>The license tool will create an error message. This should tell you what is wrong with the tool. The most common issues are either the license key is not valid, or the path to the Flex application is not correct.</li><br />
  <li>If the new key is valid and the path to the Flex application is correct you can manually edit the license file by replacing the existing key in the license.properties file located at {flex.root}/WEB-INF/flex/license.properties. Note, editing the file by hand can create problems with your Flex server. If you enter the wrong key into the file you server will default to a developer edition (limited to 5 IP addresses).</li><br />
</ol><br />
<p>When editing the license.properties file by hand, you will see there is nothing added to the &lsquo;sn=&rsquo; property. The following is an example of what the file will look like if no license key is installed.</p><br />
<p> sn=</p><br />
<p>To add the license key by hand you would edit the license.properties file and set &ldquo;sn=&rdquo; to the license key as shown in the example below:</p><br />
<p> sn=FED100-XXXXX-XXXXX-XXXXX </p><br />
<p>When editing the file by hand be sure not to include any extra spaces or line returns after the last number in the key as it will prevent the license key from being installed correctly.</p><br />
<p>Note, when change the license key (using either the licensetool.exe or by manually editing the license.properties file) you must restart the Flex server before the change takes effect</p>]]>
</content>
</entry>

</feed>