January 19, 2008

Query-string in SWF URL is not good idea

Query-string in SWF URL is bad idea because swf would be downloaded again by browser/client instead of being loaded from browser-cache, it happens if URL becomes non-unique due to the presence of changing query-string in different requests.

Browser does cache data for all URL, unless HTTP response headers (for URL or other resources) instruct not to do caching. If URL is different, browser considers it a new requests and downloads the data again instead of consuming from cache.

We can try to avoid or optimize such cases. In past, developers have used the other way by having random (non-unique) query-string in SWF or XML/asset URL to force reloading of asset/resource instead of using the ones from browser-cache. Though, they could have done things by setting right HTTP headers.

I have noticed some websites where swf URL has a query-string i.e. http://yoursite.com/yourapp.swf?var1=somedata, where value of var1 is not constant rather changes? Obvious reason, I want to pass dynamic data most of time hence using query-string instead of hard-coding it in swf itself.

I also noticed some sites which are using SWFObject and still passing data via query-string instead of flashvars using addVariable (..) instance method of SWFObject.

Another place, I again noticed something similar, AVM+ application loads AVM- (SWF 8 or less) application, let's call it legacy-swf, and passes data via query-string, ok, that is understood there is no other way except writing a light-weight wrapper that uses LocalConnection or query-string approach?

This is very basic thing in web-application development, user-experience can be improved by doing these little things. I hope to write some more observations, no matter how stupid/trivial it sounds to me or other programmers. It's good to post these things in context of flash/flex so beginners, who are not familiar with details of HTTP or other standards, can learn.

Technorati tags: , , , ,

Posted by Abdul Qabiz at 02:25 AM | Comments (8)

January 11, 2008

Flash Platform (flex/flash/air/actionscript) blogs from India

I have been maintaining a list of flex/actionscript/air bloggers on flex_india group. I updated the list today and I would be updating it again next week.

It's nice to see more developers from India are blogging and sharing their knowledge with everyone. There are ( and always have been) very smart and cool developers in India but generally they maintain a low-profile or too busy with work or shy.

Check out the following list, I have used the names of bloggers instead of blog-title because it was for me to do so.

Flex/Flash/AIR bloggers from India

You can bookmark this link.

Technorati tags: , , , ,

Posted by Abdul Qabiz at 12:38 PM | Comments (3)

January 04, 2008

ActionScript compiler in ActionScript

Another interesting project from Metal, he has ported ActionScript compiler (which is part of Tamarin project) to an ActionScript 3.0 library.

He is still working on it, however, he has posted a demo and current version of code. I am sure, this would be pretty useful. I remember of reading a thread on flexcoders about creating mock-objects in ActionScript 3.0, eval-project might prove useful there.

Technorati Tags: , ,

Posted by Abdul Qabiz at 05:26 PM | Comments (3)

TLS 1.0 implementation in ActionScript 3.0

AS3Crypto library now includes (partial) TLS 1.0 implementation, I was also thinking to implement the same for as3httpclient. Now this has been done, I might take a look at code and figure out the possibilities of integrating TLS in as3httpclient.

Thanks to Metal Hurlant for doing all useful/cool projects.

Technorati Tags: , , , ,

Posted by Abdul Qabiz at 05:14 PM | Comments (0)

December 17, 2007

initRIA was cool

It was good to be at initRIA, I met many (known or new) people. The event went fine, we had some good sessions. The following list was the agenda:-

We had couple of more session and some discussions (on Silverlight, AJAX etc) along with the above listed ones. I enjoyed most of the session, there is always something to learn. The most interesting session was by InstaCol guys, who showed us Live-Documents and also shared their experience with Adobe Flex.

I hope, all the slides/presentations (by everyone) would be uploaded to slideshare (preferably) or somewhere.

Around 130+ people were expected to attend (based on registration count) but it seems some fifty people showed up, which is not bad for something that was planned and organized in such a short time-span.

I feel, this is the first event, in India, which is focussed on the Flash Platform at the same time open for talks/discussions on all kind of RIA technologies. I am sure, next time (whenever it happens) we would have enough time to spread the word and developers from different RIA technology background can come up and share their views. As said, it was cool we had discussions on AJAX, Silverlight, AIR, Flex, Flash and RIA in general.

I managed to click some photographs, not really good quality due to my impatient and lazy nature since I have moved to Bangalore :-). Check out photographs.

Thanks to Mrinal Wadhwa of Bangalore FUG for taking the initiative and organizing the event. Thanks to Honeywell guys for a good venue with all facilities.

Technorati tags:

Posted by Abdul Qabiz at 12:41 AM | Comments (0)

December 14, 2007

initRIA - More seats available

There are more seats available for initRIA event, if you have not yet registered, you can register here. You can read more details on Mrinal's blog.

Two more days to go and I am already excited to meet everyone. I hope, I would get well by then.

Technorati tags:

Posted by Abdul Qabiz at 12:44 AM | Comments (0)

December 08, 2007

initRIA - an event for RIA enthusiasts

Bangalore Flex User Group, precisely Mrinal Wadha, is organizing initRIA on Dec 16, 2007. Haven't heard about it? Please read the details.

I hope to see good crowd and sessions there.

Technorati tags: ,

Posted by Abdul Qabiz at 01:04 AM | Comments (0)

November 22, 2007

SWFObject html/javascript generator

I heard about SWFObject html/javascript generator from a colleague. An useful tool for people who want to use Flash/Flex in their blog/webpage and not comfortable writing html/javascript code.

Technorati Tags: , , ,

Posted by Abdul Qabiz at 06:46 PM | Comments (1)

Live Documents office-suite chooses Flash/Flex

Sabeer Bhatia, one of the guys behind Hotmail, has been working on Live Documents, which has been announced a couple of days back. Live Documents is an office-suite for web and desktop (AIR?).

It is interesting to see, Live Documents chose to use Adobe Flash/Flex as front-end technology.

I read Zoho guys on Flash, I understand, it makes sense to use a technology that doesn't have dependencies, easy to develop with, saves time, provides better experience to user and good for business. If Zoho guys think, they are achieving these goals with technologies of their choice, it's totally fine. I would love to see how they respond to Live Documents release.

But hey, there are some (Live Documents, Buzzword, SlideRocket etc) which think Flash/Flex is cool (faster to develop, easier to use, consistent experience and better for business). 

Technorati Tags: , , , , , , , , , , ,

Posted by Abdul Qabiz at 06:33 PM | Comments (0)

November 09, 2007

Adobe Buzzword

Adobe Buzzword is available, no need for private invite to use it. It took me couple of minutes to register, then I checked out Buzzword; I must say Buzzword rocks!

It has a usable, fast, responsive and sleek user-interface (UI). Buzzword also allows to save documents in different formats (.doc, office-xml etc).

It allows to insert images, tables, comments, notes etc. I loved the ui-interaction for each of these features. I don't know how to express in words without showing the screen-shots, so why don't you check it out :-)

Just wondering, who designed the user-interface of Buzzword?

Technorati Tags: , , ,

Posted by Abdul Qabiz at 11:25 AM | Comments (1)

November 02, 2007

Setting position of Alert control in Flex

It seems, there is no direct way of setting position (x, y) of Alert control in Flex 2. The trivial method (setting x, y) is either buggy or there must be some official way, which I am not aware of.

I found some different ways to do that:-

var alert:Alert = Alert.show("Can you see me on random positions?",
				"I am an Alert box", Alert.YES | Alert.NO, 
				this, alertClickHandler, null, Alert.NO);        
PopUpManager.centerPopUp (alert);
var newX:Number = 200;
var newY:Number = 200;
alert.move (newX, newY)

var alert:Alert = Alert.show("Can you see me on random positions?", 
				"I am an Alert box", Alert.YES | Alert.NO, 
				this, alertClickHandler, null, Alert.NO);        
var newX:Number = 200;
var newY:Number = 200;
callLater (alert.move, [newX, newY]);

Following, to me, sounds like a little expensive because we are asking for the immediate validation.

var alert:Alert = Alert.show("Can you see me on random positions?", 
				"I am an Alert box", Alert.YES | Alert.NO, 
				this, alertClickHandler, null, Alert.NO);   
var newX:Number = 200;
var newY:Number = 200;
alert.validateNow ();
alert.move (newX, newY);

Technorati tags: , , ,

Posted by Abdul Qabiz at 06:33 PM | Comments (3)

October 26, 2007

Aviary tools: Adobe Flex/AIR based Rich Internet Applications (RIA)

I got to know about Aviary through a colleague. I looked at their site and realized, they have some amazing tools (Flex/AIR based), which are editors/generators for image, vector, 3d, video, audio etc. As mentioned, these tools are web-based (flex) and desktop-client (air).

I am yet to look at their tools which are accessible only on invitation. I hope, I would get an invite soon. Why don't you check it out too?

This is one more example to show why entire flash/flex ecosystem is so cool.

Technorati tags: , , , , adobe, createonthefly

Posted by Abdul Qabiz at 01:45 PM | Comments (1)

October 12, 2007

VIM: ActionScript and MXML syntax files

I am sharing VIM syntax files for ActionScript and MXML, which  I was about to share last-year, I got lazy after Manish's post. I hope, these syntax files would provide more (if not better) syntax-highlighting :-)

Click following links to download/see:-

You can refer to Manish's post to learn how to use these files. Instruction applies to any VIM syntax file.

Credit goes to original creators of actionscript.vim and xml.vim. These files were starting points.

Disclaimer:These files work for me, these are not perfect or clean. I would try to clean up, add more (if any missing) syntax and share whenever I get time.

Technorati Tags: , , , , ,

Posted by Abdul Qabiz at 12:59 PM | Comments (4)

October 01, 2007

Adobe acquires Buzzword

Adobe has acquired Buzzword, the word-processor application built using Adobe Flex, by Virtual Ubiquity. It reminds me of Arul's prediction, how some products are good candidates for acquisition by Adobe.

This is really motivating for flex developers. If you can build something cool and useful, Adobe might think of buying it.

Technorati Tags: , ,

Posted by Abdul Qabiz at 02:27 PM | Comments (0)

Adobe Flex 3 beta-2, AIR beta-2 and Media Player prerelease version are available on Labs

Adobe has just released new prerelease builds of Adobe Flex 3, AIR and Media Player (AMP) on labs.adobe.com. I downloaded Adobe Media Player and checking it out, it looks good.

Technorati Tags: , , , , ,

Posted by Abdul Qabiz at 02:16 PM | Comments (0)

August 31, 2007

We need flexibile crossdomain.xml on Google properties

Ali Mills posted about his experience of Google Developer Day. Where, Ali got to know about Google's plan to host a flexible crossdomain.xml on their servers, which would allow third-party flex-flash-web-applications to access Google APIs.

As we know, Youtube also changed it's crossdomain.xml, which broke many third-party flex-flash-applications consuming YouTube's API. I understand, it was more of security reasons; Lesson to be learnt: Never host a crossdomain.xml (which allows all domains) on your main application server.

Similarly, Gdata, Picasa, Google-Calendar etc don't allow all domains, only Google related properties.

I hope, Google guys hear us (Flash/Flex developers) and host a crossdomain.xml (as promised in Google Developer Day) asap.

Yahoo! has a good team of flash/flex developers, that could be the reason, Yahoo! has always been trying their best to satisfy the needs of developers. The most recent update, sure you all have heard of, Flickr now hosts a flexible crossdomain.xml, you can read more on these places:-

Technorati tags: , , , , , , ,

Posted by Abdul Qabiz at 05:46 PM | Comments (3)

August 27, 2007

Adobe Flash Player's Security-Sandbox is very restrictive

Adobe Flash Player Security-Sandbox is very good and we have not heard any major security vulnerabilities so far. However, I think, it can be made more intelligent, I have some use-cases where I can't do anything.

XMLSocket API is cool, since it's inception, developers could create cool applications (multi-player games, chat-apps, presence-apps etc). XMLSocket servers (unity, swocket etc) is needed to comply with a specification in order to work with Flash Player (as a client). Since developers are using/creating custom-servers, they could control various things on server-side, f.ex: configuring right security-permissions, serving right policy-file (crossdomain.xml) etc.

With Binary Socket API, in Adobe Flash runtimes, things have changed a lot. Applications (for Adobe Flash runtimes) can now connect to servers using standard protocols (POP3, SMTP, Databases, HTTP etc). Totally cool feature which allows creation of kick-ass applications (Yahoo! Web Messenger, mySql driver etc). But Adobe Flash Player's security-sandbox is limiting Binary Socket's capabilities.

I have been working on a library (as3httpclient) to do more things (http-status-messages, http-authentication over GET request, support for more http-methods etc) which are not supported by URLLoader API. This library (as3httpclient) doesn't work in deployed web-application because Adobe Flash Player's Security-Sandbox restricts it to.

I have following questions/concerns:-

With standards, we expect flexibility. We can't expect a HTTP server to push policy-file to Flash clients? That's not standard.

Technorati tags: , , , ,

Posted by Abdul Qabiz at 04:52 PM | Comments (2)

August 03, 2007

DataGridDataExporter: Export DataGrid data as CSV

A friend of mine, who is new to Adobe Flex, asked how can Datagrid-data be exported as CSV. I wrote a simple class, with one static-method, to do that. This is very basic implementation of CSV format.

Check out the example or download the code (with example).

DataGridDataExporter.as:

/**
	_________________________________________________________________________________________________________________

DataGridDataExporter is a util-class to export DataGrid's data into different format.
@class DataGridDataExporter (public)
@author Abdul Qabiz (mail at abdulqabiz dot com)
@version 0.01 (2/8/2007)
@availability 9.0+
@usage<code>DataGridDataExporter.<staticMethod> (dataGridReference)</code>
@example
<code>
var csvData:String = DataGridDataExporter.exportCSV (dg);
</code>

__________________________________________________________________________________________________________________

*/
package com.abdulqabiz.utils
{
import mx.controls.DataGrid;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.collections.ArrayCollection;
import mx.collections.XMLListCollection;
import mx.collections.IList;
import mx.collections.IViewCursor;
import mx.collections.CursorBookmark;
public class DataGridDataExporter
{
public static function exportCSV(dg:DataGrid, csvSeparator:String="\t", lineSeparator:String="\n"):String
{
var data:String = "";
var columns:Array = dg.columns;
var columnCount:int = columns.length;
var column:DataGridColumn;
var header:String = "";
var headerGenerated:Boolean = false;
var dataProvider:Object = dg.dataProvider;
var rowCount:int = dataProvider.length;
var dp:Object = null;
var cursor:IViewCursor = dataProvider.createCursor ();
var j:int = 0;
//loop through rows
while (!cursor.afterLast)
{
var obj:Object = null;
obj = cursor.current;
//loop through all columns for the row
for(var k:int = 0; k < columnCount; k++)
{
column = columns[k];
//Exclude column data which is invisible (hidden)
if(!column.visible)
{
continue;
}
data += "\""+ column.itemToLabel(obj)+ "\"";
if(k < (columnCount -1))
{
data += csvSeparator;
}
//generate header of CSV, only if it's not genereted yet
if (!headerGenerated)
{
header += "\"" + column.headerText + "\"";
if (k < columnCount - 1)
{
header += csvSeparator;
}
}
}
headerGenerated = true;
if (j < (rowCount - 1))
{
data += lineSeparator;
}
j++;
cursor.moveNext ();
}
//set references to null:
dataProvider = null;
columns = null;
column = null;
return (header + "\r\n" + data);
}
}
}



DataGridCSVExportExample.mxml:-


<?xml version="1.0"?>
<!-- DataGrid control example. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import com.abdulqabiz.utils.DataGridDataExporter;
private function exportCSV ():void
{
console.text = DataGridDataExporter.exportCSV (dg);
}
]]>

</mx:Script>
<mx:XMLList id="employees">
<employee>
<name>Christina Coenraets</name>
<phone>555-219-2270</phone>
<email>ccoenraets@fictitious.com</email>
<active>true</active>
</employee>
<employee>
<name>Joanne Wall</name>
<phone>555-219-2012</phone>
<email>jwall@fictitious.com</email>
<active>true</active>
</employee>
<employee>
<name>Maurice Smith</name>
<phone>555-219-2012</phone>
<email>maurice@fictitious.com</email>
<active>false</active>
</employee>
<employee>
<name>Mary Jones</name>
<phone>555-219-2000</phone>
<email>mjones@fictitious.com</email>
<active>true</active>
</employee>
</mx:XMLList>
<mx:Panel title="DataGrid Control Example" height="100%" width="100%"
paddingTop="10" paddingLeft="10" paddingRight="10">
<mx:Label width="100%" color="blue"
text="Select a row in the DataGrid control."/>
<mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{employees}">
<mx:columns>
<mx:DataGridColumn dataField="name" headerText="Name"/>
<mx:DataGridColumn dataField="phone" headerText="Phone"/>
<mx:DataGridColumn dataField="email" headerText="Email"/>
</mx:columns>
</mx:DataGrid>
<mx:Button label="Export CSV" click="exportCSV ()"/>
<mx:TextArea id="console" width="100%" height="100%" />
</mx:Panel>
</mx:Application>


Technorati tags: , , , ,

Posted by Abdul Qabiz at 04:10 PM | Comments (19)

June 27, 2007

Mixercast: on AIR Bus Tour

I just created a mixercast to show all latest pictures, videos and twitter updates of on AIR Bus Tour. Check it, out by clicking following image.

onairbustour.jpg

Technorati tags: , , , ,

Posted by Abdul Qabiz at 05:11 AM | Comments (1)

June 23, 2007

as3httpclient project update

Sometimes back, I posted about as3httpclient project which is an open-source http-protocol-library written in ActionScript 3, not yet completely done. Library has been updated recently by Erik, who has recently joined the project. It's great to have him in the team.

Things that have changed:-

Now as3httpclient can be used for:-

Two important features planned for future release:-

Please check out the project. I would love to hear your feedback/bug-reports/suggestions.

Please get back in touch with me [mail at abdulqabiz dot com], if you want to contribute to the project.

Technorati tags: , ,

Posted by Abdul Qabiz at 01:28 AM | Comments (3)

June 18, 2007

Indian Adobe Flex/Apollo-AIR consultants - Please read

If you are thinking to do serious Flex consulting or already doing it in India, please read this email thread on flex_India list. It's interesting for individuals or groups.

Email thread link:http://tinyurl.com/3xpsbf

Technorati tags: , , , ,

Posted by Abdul Qabiz at 09:57 PM | Comments (1)

June 11, 2007

AIR(Adobe Integrated Runtime) and Flex 3

Apollo, which was the code name for Adobe desktop runtime, would be known as Adobe Integrated Runtime (AIR). Adobe Flex 3 framework would be cached by Adobe Flash Player for better performance (download wise). Latest beta build of Adobe Flash Player 9 has loads of enhancements.

In short, all these bits are available on labs. Download 'em and give your feedback to Adobe.

Posted by Abdul Qabiz at 01:09 PM | Comments (0)

April 28, 2007

Opensource Flex

This is old news by now but I couldn't stop myself writing about it. I am so happy and excited after this announcement. I told to couple of friends, who are total FOSS guys, in my office and I could see a positive smile on their faces.

I can imagine a brighter future of Flex and Flash Platform. I can imagine the kind of tools we would see once Flex/AS compiler code is out.

After MAX 2005, I (and some other folks) had some feeling (intuition) that Adobe might release the flex-framework under open-source license but I had not thought about tools/compilers.

Well done Adobe, keep it up.

Posted by Abdul Qabiz at 01:55 AM | Comments (2)

April 24, 2007

ActionScript 3 HTTPClient Google Project

I have created a Google Project called as3httpclient. The project would host different actionscript-3 classes to extend Adobe Flash Player's capabilities for HTTP/HTTPS related stuff.

I have committed the HTTPURLLoader class . If you are doing something similar or have done any changes to HTTPURLLoader, it would be great if you can merge changes or add new classes related to HTTP/HTTPS.

All the classes in as3httpclient would be licensed under New BSD License.

Posted by Abdul Qabiz at 09:57 PM | Comments (3)

April 23, 2007

Adobe Flex/ActionScript posters are huge

I received Adobe Flex 2 framework and Flash Player 9 API posters. Those are huge but it's easier to read.

Thanks to Adobe for sending it. You can also get one set, link the flex.org from your blog and keep an eye on this page and apply (whenever you can).

Meanwhile, you can download the Flex, ActionScript and Apollo cheatsheats.

Posted by Abdul Qabiz at 07:59 PM | Comments (4)

Adobe Flex-Apollo Seoul Summit photographs

It was good experience to be among the Flex-Apollo leaders from APAC region. I have lot more to write about this event so I would do it in another post, I just wanted to post this group photograph.

Check out more in flickr set.

Posted by Abdul Qabiz at 06:25 PM | Comments (0)

April 17, 2007

Adobe Media Player - Why Media RSS is cool?

I posted about Media RSS sometimes back and now it seems like Adobe Media Player (AMP) would consume RSS 2.0 feeds (with Media RSS extension/module) and do cool things.

I also posted about how something like Democracy Player can be built for Adobe Apollo platform, seems like Adobe Media Player is the answer.

AMP would be cool, I can feel it. It's another platforms for content-distribution. I don't have to think much about integration, just follow the standards (RSS, ATOM, microformats etc) and I am cool. That's the beauty of standards, that's why I love them.

Posted by Abdul Qabiz at 05:06 PM | Comments (0)

April 02, 2007

Constructing YouTube FLV URL on client-side without any server-side script

It seems, there is a easier way of constructing YouTube! FLV URL on client-side without using any server-side script.

We need get the YouTube video_id from any of following places:-

Then, construct a URL like this: http://www.youtube.com/v/V3BsjxDZJM0

Above URL is used in YouTube embed-code. It is basically a server-side redirection that points to YouTube Player (.swf). Above redirects (server-side) to following URL:-
http://www.youtube.com/p.swf?video_id=V3BsjxDZJM0&eurl=&iurl=http%3A//sjc-
static12.sjc.youtube.com/vi/V3BsjxDZJM0/2.jpg&t=OEgsToPDskKzlTMEFZ1jOh40Xc3qOxzQ

As you can see in above URL, it contains "t" param (in red), which is what we need along with video_id to construct YouTube video (FLV) URL, YouTube FLV URL would look like this:-
http://www.youtube.com/get_video.php?video_id=V3BsjxDZJM0&
t=OEgsToPDskKzlTMEFZ1jOh40Xc3qOxzQ

You can check out code below to figure out things your own. You can also check out the example-app.

Flex 2.0/ActionScript 3.0 example:-


<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
	creationComplete="onAppCreationComplete ()"
	horizontalAlign="left"
	width="800"
	height="350">
	<mx:Script>
		<![CDATA[
			import flash.net.*;
			import flash.events.*;
			import flash.display.*;
			private var loader:Loader;
			private var abortId:uint;
			private function onAppCreationComplete ():void
			{
				loader = new Loader ();
			}
			private function startLoading ():void
			{
				var req:URLRequest = new URLRequest ("http://www.youtube.com/v/3IcwG0jUFxU");
				loader.contentLoaderInfo.addEventListener(Event.INIT, handlerLoaderInit);
				loader.load(req);
				logMessage ("Loading YouTube URL..");
			}
			private function handlerLoaderInit (event:Event):void
			
			{
				logMessage ("Loaded, processing: " + loader.contentLoaderInfo.url);
				var urlVars:URLVariables = new URLVariables ();
				urlVars.decode (loader.contentLoaderInfo.url.split("?")[1]);
				logMessage ("Processed:-");
				logMessage ("\t\t video_id:" + urlVars.video_id);
				logMessage ("\t\t t param:" + urlVars.t);
				logMessage ("\t\t thumbnail-url:" + urlVars.iurl);
				var flvURL:String = constructFLVURL (urlVars.video_id, urlVars.t);
				logMessage ("YouTube FLV URL: " + flvURL);
				playVideo (flvURL);
				logMessage ("Started Playing Video...");
				loader.unload(); 
			}
			private function constructFLVURL (video_id:String, t:String):String
			{
				var str:String = "http://www.youtube.com/get_video.php?";
				str += "video_id=" + video_id;
				str += "&t=" + t;
				return str;
			}
			private function playVideo (url:String):void
			{
				player.source = url;
				player.play();
			}
			private function logMessage (message:String):void
			{
				outputText.text += message + "\n";
				trace (message);
			}	
		]]>
	</mx:Script>
	<mx:HBox width="100%">
		<mx:Label text="YouTube Video URL:"/>
		<mx:TextInput id="urlText" width="300"/>
		<mx:Button label="Submit" click="startLoading ()" id="submitButton"/>
	</mx:HBox>
	<mx:HBox width="100%">
	<mx:VBox height="100%">
		<mx:Label text="VideoDisplay:"/>
		<mx:VideoDisplay width="320" height="240" id="player"/>
	</mx:VBox>
		<mx:VBox height="100%" width="100%">
			<mx:Label text="Output:-"/>
			<mx:TextArea id="outputText" width="100%" height="100%"/>
		</mx:VBox>
	</mx:HBox>
</mx:Application>


ActionScript 2.0 code-snippet:-


createEmptyMovieClip ("mc", getNextHighestDepth ());
var _mcl:MovieClipLoader = new MovieClipLoader ();
_mclListener = new Object ();
_mclListener.onLoadStart = function (target:MovieClip)
{
trace ("The URL is: " + target._url);
var _lv:LoadVars = new LoadVars ();
_lv.decode (target._url.split ("?")[1]);
trace ("t param: " + _lv.t);
trace ("video_id: " + _lv.video_id);
trace ("thumbnail: " + _lv.iurl);
trace ("flv url: " + constructFLVURL (_lv.video_id, _lv.t));
_mcl.unloadClip (target);
};
function constructFLVURL (videoId:String, t:String):String
{
var str:String = "http://www.youtube.com/get_video.php?";
str += "video_id=" + videoId;
str += "&t=" + t;
return str;
}
_mcl.addListener (_mclListener);
_mcl.loadClip ("http://www.youtube.com/v/3IcwG0jUFxU", mc);

 [1] Flash clients would require server-side proxy because YouTube changed crossdomain.xml sometimes back.


Posted by Abdul Qabiz at 05:28 PM | Comments (120)

March 24, 2007

Apollo: Use-case analysis

I have been thinking about different use-case for Adobe Apollo platform.

I analysed Democracy Player, which I use a lot for watching and saving videos from web(internet). I can imagine, how much effort would have gone in making it cross-platform (MacOSX/Windows/Linux)?

With Apollo platform, making such things are lot easier, I can develop once and run it on different platforms (Windows, MacOSX, Linux-in-future) in consistent manner. Ok, I am not just repeating which was said for Java-client-applications, it's totally doable, possible and feasible to do that. There are some cool examples FineTune Desktop, YourMinis Desktop etc. Adobe Flash Player has gained the status of true cross-platform, Apollo would also do. I am confident about that.

Though, there are a few things that I would need in Apollo to implement all features of Democracy Player. Things I can't implement as of today (for Apollo Alpha runtime) are:-

I am very hopeful, later releases of Apollo would solve these problems.

Posted by Abdul Qabiz at 09:24 AM | Comments (3)

March 23, 2007

Mac OSX tools for performance/memory profiling

You can use following commands to check the memory/performance/memory-leaks of your applications during development.

If you have XCode and Apple developer tools installed (you get in CD), you can find more tools in /Developer/Applications/Performance Tools

It takes sometime to understand tools, but it's really useful while development. One of the reasons, I started using Mac OSX because it's on top of *nix and there are good free tools that comes with it (in CD/DVD).

You can get lots of Open-Source/FSF tools ported for Mac OSX (and Darwin) using Fink or Darwin Port package management tools.

Posted by Abdul Qabiz at 10:00 AM | Comments (0)

March 12, 2007

Flex and Apollo Videos

Mike Chamber just announced a video site that would feature videos on Flex/Apollo. I feel, videos say more than words. I love watching videos that show tech-stuff.

Check out video.onflex.org

Posted by Abdul Qabiz at 03:10 PM | Comments (0)

Summary of Flex India meeting in Bangalore

We had meeting with John Koch[1] and Flex developers in Bangalore, it went well. It was good to meet developers from different companies (SAP, Adobe, Student etc)/startups (Mogulus, Sunguard) and learn what they are doing, what kind of problems they face etc. It was great to meet some folks (Mrinal, Mogulus guys et al) whom I have been talking to over email/IM.

John Koch talked about different efforts within Adobe for globalization, documentation localization, community development and his experiences with communities in China and Korea. He also shared his vision for Indian Flex/Apollo community and different community programs he is working on.

Earlier to that, John Koch, Manish Jethani and I met for lunch-dinner on Saturday. We talked, around 5-6 hours, on variety of things ranging from Indian culture, Flex/Apollo, community, open-source/FSF, development culture in India and different Adobe community programs for India and South Asia.

BTW! We might be having a website that would aggregate content from local resources (blogs, mailing-lists, job-posts etc) as well as existing resources (flexcoders, flex_india, mxna, apollocoders, dev-net and different blogs). There is no intention to fork knowledge-bases. However, if there are strong reasons (languages, regional etc), there could be separate mailing-list/website.

I believe in having one central place for knowledge-sharing, we already have in form of flexcoders and apollocoders; flex_india is there for announcements, networking and some small discussions. I suggest everyone to use flexcoders for any technical discussion, most probably you would find answers in archives already.

We might be setting up flex-india.org for such things. I would post more details about it in later posts, we would surely need your help, please let us(flex_india) know if you want to volunteer.

[1] Adobe Developer Relation Manager of Asia

Update: I missed mentioning Mrinal's post about meeting. Thanks to Mrinal for helping out with Venue arrangement.

Posted by Abdul Qabiz at 01:45 PM | Comments (4)

March 06, 2007

FlexBook - amazing Flex component

Ely, an architect in Adobe Flex framework team and charting guru, has created FlexBook - an amazing Flex component. It's not just another page-flip component, it's more than that. It can be used in various ways (as container, application, renderer etc), which means it is very customizable.

I just love the different use-cases shown by FlexBook examples. For example FlexBook’s transparent Anatomy shows how it can be used in eLearning context.

Source code would be there soon, meanwhile it's worth checking out FlexBook samples.

BTW! Ely has been creating some amazing components since he has started blogging. It's really inspiring to see how he manages time to do all this out of his busy schedule, that shows how much he must be enjoying doing things, that shows why Adobe Flex charting components are so cool, I can imagine some 3D charting stuff must be going on there :-)

Posted by Abdul Qabiz at 09:50 PM | Comments (0)

March 05, 2007

Open Source Flash Player - My thoughts

I read most of posts on this subject but specifically responded to Ted Leung's post. I am posting my thoughts here for wider audience, so content is slightly changed to address general audience rather than one person.

My question to those who want to see open-source implementation of Flash Player, can they mention some points, which would allow them to do things better if Flash Player would have been open-source?

Anyway, coming back to the subject. I like FSF and Open-Source philosophy, a promoter now. Though, I used to have different thoughts in past. I am always excited to see projects which provide different (free as in beer or freedom) options..

I have been watching Gnash closely. I wonder, how it would make my life better. I can imagine a few good things:-

Some concerns:-

Hence, I hope, Gnash is completed and I also wish it doesn’t compete with Adobe Flash Player in area where Adobe Flash Player already works, specially as a browser-plugin for all supported platforms.

I think, Adobe is more serious about different platforms than Macromedia was, may be Macromedia was smaller in size. I am hopeful and expect better things in coming future. Adobe is committed to do things and if they make some money by selling tools, I don't mind that.

Adobe has different ways (email, prerelease programs, forums, blogs, user-groups etc) to take community feedback and it would be great if everyone can help can help Adobe to come up with features, we would like to see.

BTW! Developers are not required to buy tools. I use VIM and Flex2 SDK to develop applications.

Posted by Abdul Qabiz at 02:40 PM | Comments (2)

January 31, 2007

Bruce Eckel on Adobe Flex

Bruce Eckel, well known for his books (Thinking in Java etc), has written an interesting article where-in he talks about his views about Adobe Flex and other technologies. Thanks to Matt Chotin for posting this link on his blog.

I remember, Bruce Eckel started playing with Adobe Flex in 2005/2006. We saw some mails from him on flexcoders.

Check out the article

Technorati tags: , , ,

Posted by Abdul Qabiz at 05:57 PM | Comments (0)

January 28, 2007

Enabling BitmapData.draw (..) on crossdomain images in Adobe Flash Player 9

Adobe Flash Player 8 and 9 have security-sandbox where-in you can not use BitmapData's draw (..) on crossdomain images, as I mentioned in one of my posts. There is no easy way of doing it with Flash Player 8, you need some kind of shim/library.swf or server-side proxy.

Fortunately, Adobe Flash Player 9 has some APIs (Loader, LoaderContext) to make life easier, provided you have a crossdomain.xml with right permission on the server hosting images.

Say "ServerA" has main application and "ServerB" hosts image files. You need to place crossdomain.xml in root of "ServerB". Just having crossdomain.xml is not sufficient, so you need to do something more:-

  1. Create a LoaderContext instance
  2. Set it's checkPolicyFile = true;
  3. Pass LoaderContext instance to Loader.load (..) method, as shown below.

Note: Following code shows the steps, it's not a working example.


var request:URLRequest = new URLRequest ();
request.url = "http://ServerB/images/foo.jpg";

//This is important step..
var loaderContext:LoaderContext = new LoaderContext ();
loaderContext.checkPolicyFile = true;

var loader:Loader = new Loader ();
loader.load (request, loaderContext);

//now you can draw.
var bitmapData:BitampData = new BitmapData (200, 200);
bitmapData.draw (loader);

Why we need to this? Doing so would instruct Flash Player not to begin downloading the image file until after attempting to download a policy file. If Flash Player successfully finds policy file with right permission, you are set to do Bitmap drawing.

Believe me, that's all you need as long as you meet two criteria (crossdomain.xml and checkPolicyFile=true). I would try to post a working example.

Posted by Abdul Qabiz at 05:47 PM | Comments (14)

January 27, 2007

Some Adobe Flex/Flash related resources from India

I have compiled a list of sites, mailing-list and bloggers from India. Most of them blog about Flash, Flex, RIA Usability, Web 2.0 etc.

Website/groups:-

Blogs:-

Above list is partial. If I have missed something, please feel free to leave the URL (of blog, site, mailing-lists etc) in the comment. I would update the list.

If you are Adobe Flex developer, you might want to register on International Registry of Flexcoders.

Technorati tags: , , , ,

Posted by Abdul Qabiz at 06:17 PM | Comments (26)

January 24, 2007

Flex/ActionScript developers from India - Please read

I am trying to compile a list of Adobe Flex/ActionScript developers from India. If you are one of them, please leave your name and city in comment. I am planning to have a meet or a way (mailing-list etc) to be in contact.

I had planned to start Adobe (Macromedia) Flex user-group in 2005 and I got permissions but things were different then, hence it didn't work well. Now it makes more sense to start working on it. It is also good idea to have platform where we can have more events, meetings etc within India. It is also good way to spread the word (about: Flex/ActionScript/Apollo) in the region and among folks who are not aware of these fantastic technology/tools.

I apologize for posting to a wide audience (MXNA), but this is only to way to find passionate developers :)

Technorati tags: , , ,

Posted by Abdul Qabiz at 11:56 PM | Comments (149)

January 17, 2007

Adobe releases Flash Player 9 for GNU/Linux (x86)

Adobe released Flash Player 9 for GNU/Linux. Please read the system-requirements before complaining about it :)

Go and get it.

PS: Ok, I am using GNU/Linux because I prefer to do that. No intentions to start any flame-war. I am new to FSF and Open-Source world but I like the philosphy behind it.

Technorati tags: , , ,

Posted by Abdul Qabiz at 07:25 PM | Comments (2)

November 27, 2006

Adobe India Developer Olympiad

Are you a student who likes Adobe Flex/Flash/Coldfusion? There is a chance to show your skills by participating in Adobe India Developer Olympiad. You can find more details on Raghu's blog, Manish's blog and ADO page.

Yeah, you need to be a student to participate in this contest. I don't get why this contest not open for all developers in India?

I might be little biased over this, but I always find funny when I see some form like this asking your degree and branch.

Is it necessary? Why can't you just live up with college name? A developer is developer, his/her degree helps him/her to solve problems but not you?
I mean, I am not able to figure out how this information would help in having a successful contest? Asking these details might make some folks think whether they are right one or not. Guys, it's passion that matters for building community not degrees.

I hope this contest goes well and becomes successful. This is first contest of its kind for Adobe Flex/Coldfusion. There was one long back by Macromedia and ZDNetIndia, that was open for all.

Posted by Abdul Qabiz at 05:29 PM | Comments (5)

November 16, 2006

What is Adobe Flex?

Adobe Flex is an IDE for building web applications and rich internet applications.

Nah, I don't say that. I learnt this from Google search result as shown below.

I think, Adobe Flex is set of technologies (Framework, SDK, IDE, FDS etc) that together (or individually) allows you to create Rich Internet Application and more for Adobe Flash Platform.

Hope, Adobe web-team (JD?) is reading this post and correct the meta-description.

Posted by Abdul Qabiz at 01:14 AM | Comments (1)

Searching about Flex made easier

Ted Patrick has been working on a search-engine that would allow us to search different Adobe Flex knowledge-bases (blogs, flexcoders, livedocs, Adobe-Devnet etc) from one place. He has just posted about the search-engine. I would rather let you read his post than rewriting everything here.

Interestingly,this search-engine is developed using Adobe Flex 2.0 and Coldfusion. The source-code is available which would allow you to customize search-engine front-end. I believe, it can be useful for companies who have Adobe Flex development going on and public internet-access is not allowed to employees, yeah there are many such companies :)

Oh yeah, if you write about Adobe Flex on your blog/website. You can get it added to search-engine, it would be indexed too. Follow these instructions.

Posted by Abdul Qabiz at 12:57 AM | Comments (0)

November 13, 2006

Java 5.0 and ActionScript 3.0 syntax comparison

I found this link on richinternet.blog. You can find the comparison between Java 5.0 and ActionScript 3.0 language/syntax. It's helpful for any Java developers who want to try ActionScript 3.0 to build Rich Internet Applications for Adobe Flash Platform.

Comparison link

Posted by Abdul Qabiz at 06:17 PM | Comments (0)

October 30, 2006

Brightcove becomes consumer site

Brightcove has become consumer site. Brightcove has been doing great since it has started. But with this announcement, it would become super cool destination for videos. You can create your own Video channels and believe me it's really easy publishing videos online using Brightcove Console.

Embedding one of videos from Brightcove network, hope you enjoy it :)

 

Posted by Abdul Qabiz at 06:51 PM | Comments (0)

October 19, 2006

Adobe Flash Player 9 beta for Linux

Today is a good day because Flash Platform's reach has increased to more operating system. Adobe Flash Player 9 beta for Linux has been made available on Adobe Labs website. Right now, it supports some selected Linux boxes but I have a feeling that it would also work on FreeBSD, Solaris, Debian etc.

I just tested one of our flash-applications, which I would say is very complex and large application. The application worked like anything and I don't see any difference so far but I am sure there would be some assuming the beta-quality of software. Our flash-application surely covers 50-60% areas of Flash Player API and features. I hope to log some bugs and issues.

Thanks to Adobe, Mike Melanson, Tinic Uro and entire team for working hard for this. I am happy, really happy to see how better Flash Platform is getting...

Posted by Abdul Qabiz at 04:12 PM | Comments (1)

October 05, 2006

Fullscreen mode coming in Adobe Flash Player 9 update

I just noticed Colin Moock's post and was surprised to see an amazing feature, fullscreen mode in browser/plugin version of Adobe Flash Player 9 in it's coming update.

You can find more info at Colin's blog.

Posted by Abdul Qabiz at 05:42 AM | Comments (0)

September 07, 2006

Flex 2: CursorPool for cursor management

Someone on Flexcoders asked what is the best practice to manage cursors. I, myself, don't know but I thought something and implemented. As I always say, quick and dirty but can be better. I know, there are lots of things I can do but this is something very basic..

CursorPool class basically let's you register components and kind of cursor you want to show when mouse is over the component. You have to register once and now CursorPool would take care of switching mouse cursor whenever mouse is over different components.

Check out code and demo :)

Update: I have also posted code on JAM, it would appear once Ted approves. You can see it there also.

Posted by Abdul Qabiz at 01:32 AM | Comments (1)

June 28, 2006

Adobe Flex 2.0 released

Adobe Flex 2 has been released, I got to know from Matt's blog. With this release Flex.org has also been announced.

Check out Flex.org for more information.

Download Flex 2.0 (Free SDK or FlexBuilder 2.0 trial)

Update: Raghu ( a friend and engineer in Adobe Flex team) blogged about Flex 2.0 release. He also posted the picture of "About Flex Builder 2.0" screen. I can see my name there also, it feels great that Flex team remembered me for my contributions. Though I left couple of months before this release but I am super excited and feeling great as if I am still part of that team.

technorati tags:, , ,

Blogged with Flock

Posted by Abdul Qabiz at 11:25 AM | Comments (4)

Adobe Flash Player 9 released

Adobe Flash Player 9 has been released finally. All Flash/Flex developers/designers have been waiting for it.

Adobe Flash Player 9 has totally overhauled virtual machine with a better language (ActionScript 3 or AS3), JIT compiler, better garbage collector, new display-list architecture, binary-sockets and much more.

It is indeed party time, like I said in my thanks note, a few days back.

Download/Install Adobe Flash Player 9

technorati tags:, ,

Blogged with Flock

Posted by Abdul Qabiz at 11:05 AM | Comments (0)

Are you a Flex developer? Register

Tariq Ahmed sent me link of flexcoders.net. Which is a site that hosts International Registery of Flex developers (flexcoders).

If you are a Flex developer, register yourself.

Blogged with Flock

Posted by Abdul Qabiz at 10:30 AM | Comments (0)

June 20, 2006

Loading JavaScript file(s) using HTTPService/URLLoader

In my previous post, I talked about JavaScript Flex 2 component that can inject Javascript code in HTML wrapper's context.
I wanted to let you all know that you can load Javascript files (.js) using HTTPService (or flash.net.URLLoader) in Flex2/AS3 projects and inject it.

Example Flex 2.0 code:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="com.abdulqabiz.utils.*" width="100%" height="100%" creationComplete="onAppInit ()">
<mx:Script>
<![CDATA[
import flash.external.ExternalInterface;
import mx.events.*;
import mx.rpc.events.*;
import mx.rpc.http.HTTPService;
import com.abdulqabiz.utils.JavaScript;
private var javascript:JavaScript;
private var service:HTTPService;
private function onAppInit ():void
{
service = new HTTPService ();
service.url = "test.js";
service.useProxy = false;
service.resultFormat = "text";
service.addEventListener ("result", injectJavaScript);
service.send ();
}
private function injectJavaScript (event:ResultEvent):void
{
javascript = new JavaScript ();
javascript.source = String(event.result);
trace ("javascript injected: " + event.result);
}
private function invokeSayHelloWorld ():void
{
ExternalInterface.call ("sayHelloWorld");
}
private function invokeSaySomething (str:String):void
{
ExternalInterface.call ("saySomething", str);
}
]]>
</mx:Script>
<mx:Button label="invoke javascript saySomething () function" click="invokeSaySomething ('Hey, how are you?')"/>
<mx:Button label="invoke javascript sayHelloWorld () function" click="invokeSayHelloWorld ()"/>
</mx:Application>

Test.js used in example:

//test.js
var myName = "Abdul Qabiz";
function saySomething (str)
{
alert (str);
}
function sayHelloWorld ()
{
alert ("Hello World!");
}

You would need JavaScript.as (with proper package directory structure) and test.js (code posted above) in place to make above example to work.

I am thinking to load FABridge using this approach. I know, it's practically of no use except keeping code and logic at one place.

Posted by Abdul Qabiz at 08:58 PM | Comments (3)

June 16, 2006

JavaScript injection through ActionScript

In my previous post , I showed how can you inject JavaScript using ActionScript or MXML. I can think of following:-

- Request server-side script to send a JavaScript (for specific browser) as string and using JavaScript class, I can inject it in HTML.

I need to test it on various browsers and platforms. I would try to post some examples, that make sense :)

Posted by Abdul Qabiz at 04:49 AM | Comments (1)

A MXML component that embeds JavaScript in html

I know subject line is confusing but I am not able to think a better one. I have written a Adobe Flex 2.0 component(JavaScript.as), which can be used as MXML tag in Flex 2.0 applications. You can write JavaScript code as text of this MXML tag. When your application loads, all that JavaScript code would be exported to HTML container's context.

Confused? Let code speak rather than me :)

Sample MXML application using this component (test.mxml):-


<mx:Application xmlns:mx="http:/