Archive for December, 2006
To bad there is not a Flash Player 9 for Linux PowerPC distros or I would be coding Flex right now. So I am writing this post on my Playstation 3 using Yellow Dog linux 5.0 (the free version was just released today) as the “Other OS” on the box. The installation process was not that terrible hard. I was not able to install the Flash Player 7 or 9, and am not sure there is any Linux PowerPC Flash Players out there, any one know?
I am running off the wired network port, it would be cool if I could find the driver for the wireless card in the Playstation 3 itself. Other quirks is the whole HDMI to DVI only capable of connecting to HDCP ready devices. I am currently doing a 720p out through component into a VGA box converter into my monitor. Its not bad but nothing like true 1080p would be. Been sick for the last couple of days, what a time to get the flu bug, so I haven’t had all the time I wanted to get messing around with the Playstation 3. Maybe you’ll hear more on it later from me for now I am off to play some games.
December 27th, 2006
To promote the newly released Flex Cookbook I am posting here with the title of my lastest Flex Cookbook post. You can find the solution to below question by clicking on the text itself:
How do you create a instance of a component at runtime with only the class name? what about when the class name is dynamic it self?
Go and post samples, rate posts, or add comments and help make the Flex Cookbook a very good hub of information.
December 20th, 2006
I have updated the Cairngorm Store multiple backend example. Along with the updated source code I have deploy a live running example. The 4 backends it supports now is ColdFusion Remoting AMF3, AMFPHP AMF0 using the RemoteObjectAMF0 class, AMFPHP 1.9 AMF3, and ColdFusion WebServices.
See it live here!
Get the source here!
To change the backend of the Cairngorm Store example just select the backend you want from ComboBox and then click on the Refresh Data button. I had to do write some exception code to convert the returned XML data into the ArrayCollection to conform all the backend but besides that it was really easy to integrate all of them into the Services.mxml.
PS: I just installed a new license on the ColdFusion server with a new Apache web server configuration so let me know if there are any issues.
December 19th, 2006
The big news of the day is the Adobe Photoshop CS3 beta release on http://labs.adobe.com. There was also two other updates on labs that are still quite important for Adobe’s engagement platform. Spry is up to prerelease 1.4 and a new addition of JSEclipse.
JSEclipse is a new plugin for the Eclipse environment that helps developers code JavaScript faster and with no errors. With JSEclipse, you can complete a variety of tasks, from editing small sections of code to working with the next big AJAX library or developing plug-ins for a product that embeds JavaScript snippets.
Download and install JSEclipse and improve your JavaScript coding experience with:
* Contextual code completion & shortcuts.
* Project outline and quick navigation through function declarations.
* Syntax highlighting.
* Error reporting.
* Customizable code templates to get you started.
* Support for popular JavaScript libraries (Dojo, Prototype, YUI, Qooxdoo).
* Support for JavaDoc documentation and multi-line comments.
December 15th, 2006
I have created a very basic Flex 2 RolloverImage component that allows you to define the up, over, and down images through CSS.
Here is the guts of how to use the class:
XML:
-
<mx:Style>
-
.firstRollover {
-
upSkin: Embed(source="/assets/arrowGreenUp.png");
-
overSkin: Embed(source="/assets/arrowBlueUp.png");
-
downSkin: Embed(source="/assets/arrowBlueDown.png");
-
}
-
</mx:Style>
-
<renaun:RolloverImage
-
styleName="firstRollover"
-
click="mx.controls.Alert.show( 'click' );" />
-
<renaun:RolloverImage
-
upSkin="@Embed(source='/assets/arrowBlueUp.png')"
-
overSkin="@Embed(source='/assets/arrowBlueDown.png')"
-
downSkin="@Embed(source='/assets/arrowGreenUp.png')"
-
mouseDown="mx.controls.Alert.show( 'mouseDown' );" />
For a live example click here
, the source is available by right clicking on the component or you can find it here.
December 14th, 2006
Note: Just found about about the Flickr deal, it got moved to http://api.flickr.com/crossdomain.xml
I must have missed Flickr shutting down their crossdomain.xml, here is a post by Chris Shiflett. I found the issue when looking at some old Flex Flickr mashup I wrote a while back and realized it was coming back with a security error. Then I noticed the http://flickr.com/crossdomain.xml is gone.
Just recently youtube.com changed their crossdomain.xml also. What is happening???? How will true Flex mashups work? If all the sites restrict their crossdomain.xml then what are we left with. Note: It is still possible to use a proxy server (PHP, ASP etc...) to do the same thing, so why lock down the crossdomain.xml? The proxy server's also cause you to transfer all that bandwidth through your server, basically a double take on the same data.
Another side I have seen is in big corporations like Salesforce. They have a whole platform for building applications that you can sell to people as add ons to the base Salesforce offering. You can find them at http://www.salesforce.com/developer/. But since their crossdomain.xml was locked down you can't build SWF type apps (unless they residue on their servers), this is where Flex could be used to create a lot of special add on widgets (charting, etc...) on top of one of the largest CRM online services in the world. They have not opened up the their crossdomain.xml to the world yet. There is a little something going with *.breezecentral.com though, just check out http://salesforce.com/crossdomain.xml. This is because Adobe or some consultant with Adobe wrote some Adobe Connect (formerly Breeze) Saleforce integration applications I guess. Nice to see Adobe has a relationship Salesforce to get them to change the crossdomain.xml.
Where does this bring us to. Well I think there is a fine line that companies don't understand about the power of the crossdomain.xml. If they have open API, but then restrict access, its a slap in the face for the Flash/Flex of developers. With the rise of RIA's and Flex pushing many cool and complex multi-service mashups it will be a shame if we are all locked out because of mis-information or lack of proper education about the crossdomain.xml and security issues.
Another Note: So can somebody explain the difference of security and using the API to login to Flickr or using the main page? Here is the context:
Chris found that flickr had a crossdomain.xml file setup to allow flash applications to be built using the Flickr API. The problem is that you can write a flash application that would allow almost any action a logged in flickr user could perform.
Flickr has fixed the problem by moving the API endpoint, and crossdomain.xml to api.flickr.com, instead of running under something like flickr.com/api. Now a flash application can't make calls to flickr.com from another domain.
source
Is this a issue of the Flickr open API nothing allowing all the functionality that could be spoofed on the website? Ok fine and dandy makes sense, but that doesn't stop some malicious Flash (or PHP/ASP) Flickr mashup from taking your username and password and using it on the main website wrongly, correct?
Note: CSRF stands for Cross-site Request Forgery
December 13th, 2006
Patrick Mineault has created an alpha update of AMFPHP that now supports AMF3. He is looking for people to test it out. To help with this I have created two simple examples that I have running live on a PHP4/Apache server, as well as have tested on a PHP5/Windows box.
Basic Example
Return Array of VO's Example
You can download the source for both examples by right clicking on the apps or get it here.
Note: To make the amfphp 1.9 alpha code to work with PHP4 there you need to implement a different function for the array_search() when the search needle is a object.
December 12th, 2006
UPDATE: see comments, the skin class works with any UIComponent and checks for many exceptions of different backgroundImage style values. Note backgroundImage values of embedded images only work, embedded SWF's with symbol names throws an error.
I created a RepeatingImage component last month that works nicely for applying repeating images any where in your Flex application. But most repeating image usages are typical implemented as repeating background image for the whole Application. There is no easy way to apply the background image as a style and have it repeat.
You could use the RepeatingImage component to apply a image class on the Canvas of an Application component, but that might not work for non absolute layout apps. The basic code to repeat a bitmap over an graphic area requires BitmapFill. Stefan Richter modified Jemery Lu's code to apply a bitmap image to the Application component through AS code in the Script block. This looks a lot like the RepeatingImage in its approach.
Then in Stefan's comments Maikel Sibbald applied the BitmapFill approach to a borderSkin. This approach makes more sense when you are thinking of just applying a background image on the Application that repeats. The one done side to the code was that it you have to hard code the image source into the custom borderSkin class.
I decided to take that code and modify it so you set the borderSkin and backgroundImage styles on the Application component class to make it work. The trick is the modifications in the custom borderSkin called RepeatedBackground, they RepeatedBackground class locates the backgroundImage style from the parent (which is Application or any other component with borderSkin set to RepeatedBackground) and uses that as the class for the image. It then clears the backgroundImage style on the parent to make sure that that doesn't get drawn.
See for your self, here is the live example and the source code through context help.
December 8th, 2006
I downloaded the latest SDK of Flex to try out coding Flex in Ubuntu (6.06).
Here are the basic steps to try it out:
Download Flex 2 SDK for linux
Extract package to a directory (/home/renaun/Desktop/flexsdk/)
Create simple mxml file called helloworld.mxml
Run the following command:
>/home/renaun/Desktop/flexsdk/bin/mxmlc -o helloworld.swf helloworld.mxml
At this point I got a segmentation fault. Looking at the java version that comes with Ubuntu you see its a gij 1.4.2 JRE.
>java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.0 (Ubuntu 4.1.0-1ubuntu8)
To fix the segmentation fault I had to download a different JRE from Sun. I downloaded both the 1.5.0_10 and 1.4.2_13 self-extracting JREs. I extracted both in the Desktop folder. To change which java executable the mxmlc will run you need to modify the mxmlc shell script it self. On my install it was located at "/home/renaun/Desktop/flexsdk/bin/mxmlc".
I edited the last line in the mxmlc shell script from:
java $VMARGS -jar "$FLEX_HOME/lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" $*
to
/home/renaun/Desktop/jre1.5.0_10/bin/java $VMARGS -jar "$FLEX_HOME/lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" $*
And that fixed the problem (both 1.5.0_10 and 1.4.2_13 work). Now onto some ant build scripts and eclipse integration....
December 6th, 2006
There was a question on the FlashMedia mailing list about how to get id3 info from a NetStream with AS3 code. It is actually just like AS2 with some quirks to watch out for. The first is the supported ID3 tags:
About supported versions of ID3 tags
Flash Media Server supports playback of ID3 text tags in UTF-8, UTF-16, and ISO-8859-1 formats and supports ID3 versions 1.0, 2.3, and 2.4. Only tags that contain text data are supported, such as song title, artist name, comments, and year recorded.
I had a mp3 with ID3 v2.2 tags that did not work until I put in a v1.0 ID3 tag.
The next is the NetStream is not dynamic in AS3 and you use the client property to handle method calls from the server. There will be a onPlayerStatus and onId3 method call the server makes on the NetStream object.
Here is the running example and source code is available through the right click.
December 1st, 2006