+1

iPhone and Flash again

Flex, iPhone

 

 As I will shortly be in the market for a new phone the re-emerging rumours of flash on the iPhone sound good to me.  I've heard some criticism about the iPhone but I still feel that I want one regardless of the issues and hearing more about Adobe and Apple working on a solution gets my hopes up.

www.webkitchen.be/2008/10/01/flash-on-the-iphone-confirmed-we-said-nothing-new/

http://www.flashmagazine.com/news/detail/flash_for_the_iphone_confirmed_at_fotb/

At the moment I'm not really sure what other phones I should be looking at but hope within the next few weeks I hope to make a decision.  Fingers crossed Adobe and Apple work this one out sooner rather then later.

+1

Adding Clickable links and TextArea.html

Flex

I really wanted clickable links in my Twitter pod and I saw how easy Steve did it so I used his really nice regex. 

As per my original design I really wanted my Twitter feed to be a bit less generic so I remove my name from the start of each post and add a date stamp each entry looping over the 10 most recent tweets.

I'm quite happy with the result.

At first I was only using TextArea.text and not getting nice links when I saw there is also TextArea.html this is really nice and I can see many places I can use this regEx in any data centric application.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="180" height="194"
	creationComplete="remoteObject.getData()"  cornerRadius="16" 
	color="#000">
	<mx:RemoteObject id="remoteObject" destination="ColdFusion" source="paulcfc.Twitter" showBusyCursor="true">
		<mx:method name="getData" result="getDataSuccess(event)" />
	</mx:RemoteObject>
	<mx:Script>
		<![CDATA[
			import mx.formatters.DateFormatter;
			import mx.rpc.events.ResultEvent;
			import mx.collections.ArrayCollection;
			
			private var resultData:ArrayCollection;
			
			private function getDataSuccess(e:ResultEvent):void{
				resultData = e.result as ArrayCollection;
				for( var i:int = 0; i < 10; ++i){
					ta.text += niceDateFormatter.format(resultData.getItemAt(i).PUBLISHEDDATE) + 
					": " + resultData.getItemAt(i).CONTENT.replace("paulkukiel: ", "") + "\n\n";
				}
				ta.htmlText = URLsToLinks(ta.text);
			}
			
			private function URLsToLinks(theString:String):String {
	
				// define the RegEx strings
				var URLRE:String = "(https?)://([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+([a-zA-Z]{2,9})(:\\d{1,4})?([-\\w/#~:.?+=&%@~]*)";
				var twitterRE:String = "(?<![\\w\\.])(?<=@)([-\\w]*)(?![\\w\\.])";
				
				// Create the RegEx objects
				var urlPattern:RegExp = new RegExp(URLRE,"ig");
				var twitterPattern:RegExp = new RegExp(twitterRE,"ig");
				
				// replace text in the string that matches the RegEx objects
				var result:String = theString.replace(urlPattern,'<a href="$&" target="_blank"><font color="#0000FF"><u>$&</u></font></a>');
				result = result.replace(twitterPattern,'<a href="http://twitter.com/$&" target="_blank"><font color="#0000FF"><u>$&</u></font></a>');
			
				// return the formatted string
				return result;
			}
			
		]]>
	</mx:Script>
			
			<mx:DateFormatter id="niceDateFormatter" formatString="DD MMM" />
			<mx:LinkButton label="Twitter" textAlign="left" 
				click="navigateToURL(new URLRequest('http://twitter.com/paulkukiel'))" 
				y="0" x="10"/>
			<mx:TextArea id="ta" width="160" height="163" editable="false" y="21" x="10"/>
	
</mx:Application>

+1

Code View

I tried to get my code view working for my Twitter Pod but it seams there is a bug in Flex 3 that wont let me specify the code view source.  Every time I change it Flexbuilder changes it back when it exports the release build.

Here is the code in code block:

CF:

 

<cfcomponent output="false">
	<!--- Get Data --->
	<cffunction name="getData" output="false" access="remote" returntype="query">
		<cfset var local=StructNew()>
		
		<cffeed source="http://twitter.com/statuses/user_timeline/15001308.rss" 
				action="read" query="local.result" />
		
		<cfreturn local.result>
	</cffunction>
</cfcomponent>

AS:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="180" height="194"
	creationComplete="remoteObject.getData()"  cornerRadius="16" 
	viewSourceURL="srcview/index.html" color="#000">
	<mx:RemoteObject id="remoteObject" destination="ColdFusion" source="paulcfc.Twitter" showBusyCursor="true">
		<mx:method name="getData" result="getDataSuccess(event)" />
	</mx:RemoteObject>
	<mx:Script>
		<![CDATA[
			import mx.formatters.DateFormatter;
			import mx.rpc.events.ResultEvent;
			import mx.collections.ArrayCollection;
			
			private var resultData:ArrayCollection;
			
			private function getDataSuccess(e:ResultEvent):void{
				resultData = e.result as ArrayCollection;
				for( var i:int = 0; i < 5; ++i){
					ta.text += niceDateFormatter.format(resultData.getItemAt(i).PUBLISHEDDATE) + 
					": " + resultData.getItemAt(i).CONTENT.replace("paulkukiel: ", "") + "\n\n";
				}
			}
			
		]]>
	</mx:Script>
			
			<mx:DateFormatter id="niceDateFormatter" formatString="DD MMM" />
			<mx:LinkButton label="Twitter" textAlign="left" 
				click="navigateToURL(new URLRequest('http://twitter.com/paulkukiel'))" 
				y="0" x="10"/>
			<mx:TextArea id="ta" width="160" height="163" editable="false" y="21" x="10"/>
	
</mx:Application>

And here is the bug report at Adobe.  It was already entered but I put my vote forward hopefully they fix it.

bugs.adobe.com/jira/browse/FB-13194

+2

Twitter, Flex and Coldfusion

Well I have been playing with a new homepage and wrote a small section of code to display my twitter feeds using CFFEED.  This is a great tag and I was able to in 4 lines of code read my feed and loop over it displaying it nicely. 

It was only a small step to port it into a flex widget which you can see on the side of my blog.  I'll post up the code shortly.

+1

CFEclipse

I've been using CFEclipse for a while now and for CF code I have been noticing some of the helper errors are not quite accurate.  I guess I just don't like seeing errors/warnings in the Problems tab.  Turns out this is really easy to fix here is my example.

I keep getting report is a required attribute warning where its only required for crystal reports ( I'm using ColdFusion reports ).

To fix this goto installpath\plugins\org.cfeclipse.cfml_1.3.1.6\dictionary open the CF8.xml find the node for cfreport and change.  Close and reopen Flexbuilder/Exclipse.

No more errors. :)

+1

Coldfusion Forums

I don't mind browsing an online forum now and then and I really like to have a place I can go to ask questions.  Mailing lists are great but often I tend to skip over alot of emails.  So I did some searching and found the following Coldfusion forums.

DigitalPoint CF Forum

DreaminCode CF Forum

Sitepoint CF Forum

Adobe CF Forum


Search