<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1539454903648840250</id><updated>2011-12-02T01:49:28.305-08:00</updated><category term='datatip'/><category term='madeinflex'/><category term='flash'/><category term='charts'/><category term='solution'/><category term='p2p'/><category term='personal'/><category term='tips'/><category term='events'/><category term='stratus'/><category term='flex'/><category term='examples'/><category term='problem'/><title type='text'>Blah blah Flex</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://marcbc.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://marcbc.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Marc Baiges Camprubi</name><uri>http://www.blogger.com/profile/08393403983062991622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1539454903648840250.post-3717243709726185778</id><published>2009-03-03T14:05:00.000-08:00</published><updated>2009-03-07T02:02:41.789-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='stratus'/><category scheme='http://www.blogger.com/atom/ns#' term='p2p'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><title type='text'>File Sharing using Stratus (Part 2: Send file example)</title><content type='html'>&lt;span style=";font-family:verdana;font-size:100%;"  &gt;As described in &lt;a href="http://marcbc.blogspot.com/2009/03/file-sharing-using-stratus-part-1.html"&gt;previous post&lt;/a&gt;, I was experimenting with the new Stratus service introduced by Adobe with the relase 10 of Flash Player.&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;After going over the &lt;a href="http://www.adobe.com/devnet/flashplayer/articles/rtmfp_stratus_app.html"&gt;VideoPhoneLabs example by Jozsef &lt;/a&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;a href="http://www.adobe.com/devnet/flashplayer/articles/rtmfp_stratus_app.html"&gt;Vass&lt;/a&gt;, I was curious about trying to use the same approach for a different need, in this case a binary file transfer, having in mind P2P file sharing in Flash.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Here it is the resulting app:&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;&lt;embed style="font-family: verdana;" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" allowscriptaccess="sameDomain" name="FlexSharingExample" bgcolor="#FFFFFF" quality="high" id="TestDataTipRenderer" src="http://sites.google.com/site/marcbcblog/Home/FileTransferExample.swf" align="middle" height="450" width="450"&gt;&lt;/embed&gt; &lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;noscript  style="font-family:verdana;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FlexSharingExample" width="450" height="450" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;&lt;param name="movie" value="http://sites.google.com/site/marcbcblog/Home/FileTransferExample.swf"&gt;&lt;param name="quality" value="high"&gt; &lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;embed src="http://sites.google.com/site/marcbcblog/Home/FileTransferExample.swf" quality="high" bgcolor="#FFFFFF" width="450" height="450" name="FlexSharingExample" align="middle" play="true" loop="false" quality="high" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/span&gt;&lt;/span&gt;&lt;/noscript&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;Remember Flash 10 or newer is required. Test your current verision &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507"&gt;here&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Notes:&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;By a quick search, I came across &lt;a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&amp;amp;catid=756&amp;amp;threadid=1416794&amp;amp;enterthread=y"&gt;this forum post&lt;/a&gt;  where someone asked about the possibility of doing this and there was the confirmation by using the NetStrea&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;m’s “send()” method to send any kind of content.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;A guy called Kris in Duesseldorf did also introduce his work in that thread, and these posts about transferring Classes between peers were also quite interesting.&lt;br /&gt;&lt;a href="http://krisrok.de/blok/?p=53"&gt;communicating arbitrary data via rtfmp (pt. 1)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://krisrok.de/blok/?p=57"&gt;communicating arbitrary data via rtfmp (pt. 2)&lt;/a&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;So hands on, let’s code a proof of concept that is capable of sending files through peers!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;I. Use case:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;A user will log in into the application using a nick name an&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;d he/she will get a List of other users connected to it. He/she will be able to ch&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;oose one of the connected users, select one of the files in his/her local filesystem and send it to the target peer. He/she (the destination user), will be prompted to accept/deny the new incoming file.&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;This is just a proof of concept and is not intended to work as a production application, so there’s no work related to security, performance or other possible improvements.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;II. User management service:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;As described in the previous post, Stratus is a service used to manage the connection between 2 peers and allow them to communicate directly, but the way one discovers each other, how they meet, is out of scope of the service.&lt;br /&gt;&lt;br /&gt;In Josez Vass example, a “reg.cgi” file with the structure of a python web app is provided, with the idea of people interested in running the example deploying it into his/hers own systems. It’s great he provided this script, b&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;ut it was a subject and a technology totally disconnected from were the example is about, Flex and Stratus.&lt;br /&gt;&lt;br /&gt;I started looking how to deploy this script when I thought that it would be great if I could offer access to it to anyone trying my example, to avoid this non related subject/technology barrier. So it was a great excuse to st&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;art with Python, Django and  Google’s AppEngine, and my first dummy Google AppEngine application came out!&lt;br /&gt;&lt;br /&gt;If you run the example, you’ll be connecting to a Django application hosted in http://stratus-demo-service.appspot.com/ . It’s so simple and, probably, so bad coded, so I’ll keep the code, but feel free to ask for it if&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt; someone wants to check.&lt;br /&gt;&lt;br /&gt;It just implements the same API as Josez’s python script, so if you want to use it to try VideoPhoneLabs application, just  go and change the WebServiceUrl constant in VideoPhoneLabs.mxml file to&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;private const WebServiceUrl:String = "http://stratus-demo-service.appspot.com/"&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;This app has three possible calls:&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;http://stratus-demo-service.appspot.com/?username=myUserName&amp;amp;identity=12345678901234567890&lt;/span&gt; will register the requesting usename with the nearID passed as “identity” in to the syst&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;em. This just stores a triple username-nearID-updatetime into a Django Model (in this case, a google.appengine.ext.db.Model object), that contains those three files. Successive calls with the same username will result in updating this updatetime field, used to timeout unactive users.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;http://stratus-demo-service.appspot.com/?listUsers=true&lt;/span&gt; will retrieve a list of all currently conneceted users. Are considered connected users those that made a “PING” call to the system (a user regi&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;ster call) before than 2 minutes ago (so user connections expire after 2 minutes).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;http://stratus-demo-service.appspot.com/?friends=username1&amp;amp;friends=username2&lt;/span&gt; will retrieve the list of just the given usernames with their ids. This called is provided for compatibility with the VideoPhoneLabs example but it’s not used for the File Sharing one.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_UTai5drmhWg/Sa2v7e0n9GI/AAAAAAAAAC4/j9DXXap4HQw/s1600-h/Picture+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 557px; height: 220px;" src="http://4.bp.blogspot.com/_UTai5drmhWg/Sa2v7e0n9GI/AAAAAAAAAC4/j9DXXap4HQw/s400/Picture+1.png" alt="" id="BLOGGER_PHOTO_ID_5309092972160611426" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;As said before, this is my first Python, Django and AppEngine app, so please don't be very strict if something is not working ;-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;III. File Sharing itself:&lt;/span&gt;&lt;br /&gt;So, with the user management problem solved, I proceed to creat a project to illustrate the file sending functionallity. The structure is similar to the VideoPhoneLabs application, but without the camera/mic setup and managing the user connection to the user management system all in a single .mxml file. I just wanted to make the code easy to follow, so I tried to write it in the execution order, and avoid adding any auxiliar file.&lt;br /&gt;&lt;br /&gt;Then in the file, you’ll see the following structure:&lt;br /&gt;&lt;br /&gt;0. Stratus service connection code. Here, a NetConnection object that handles the connection to the Stratus service is set up.&lt;br /&gt;1. Registering to the user management service. A call to the AppEngine service is done here to register the new nearID provided by the Stratus service in section 0. This code will be called regularly to maintain the user session alive. Once the user is registered, a NetStream “listenerStream” is created to recieve incoming file transfers.&lt;br /&gt;2. Userlist request. The result is parsed into an Array used as binding source for a ComboBox of users.&lt;br /&gt;&lt;br /&gt;This first sections are common for both, sending and recieving users.&lt;br /&gt;&lt;br /&gt;3. Makes the handling for File selection from the browsed file system.&lt;br /&gt;4. Waits for the “Send” button to be pressed. If it is the case and a destination user has been chosen, a NetStream “outgoingStream” is published. This is stream is the one the receiving user will register to to download the transfered file. So once it is published, the sending user asks the receiving if he/she would be so kind to ask it “please”. This sounds ironic, but is the only way of the transfer to start... if the destination user asks it, that is, if the destination user registers to a origin’s user NetStream (in this case, the “outgoingStream” we’ve just created).&lt;br /&gt;5. The recieving user is pinged in his listenerStream then, and he/she answers subscribing to the sender’s “outgoingStream”, published with the name “fileRequest”.&lt;br /&gt;6. The sender recieves some events, and we’ll wait until a NetStream.Play.Start to invoke the desired function:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                switch (event.info.code){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                    case "NetStream.Play.Start":&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                        log(INFO,"Sending "+sendFile.name+" ("&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                            +sendFile.size+" bytes)");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                        outgoingStream.send("receiverFunction", &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                            sendFile.data as ByteArray,userName.text,sendFile.name);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                        break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Receiver “receiverFunction” is called, and the user is prompted to get the file. If he/she answers affirmatively, a new File with the transfered content is stored were the user decided.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So that’s much it! Try the app at the top of the post, entering a username and waiting for someone to connect... or being more realistic, opening a couple of browsers and simulating being two different users :-P&lt;noscript face="verdana"&gt;&lt;/noscript&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sites.google.com/site/marcbcblog/Home/FileTransferExample.mxml"&gt;Here the code&lt;/a&gt;. Any kind of feedback is appreciated :-)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1539454903648840250-3717243709726185778?l=marcbc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcbc.blogspot.com/feeds/3717243709726185778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1539454903648840250&amp;postID=3717243709726185778' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/3717243709726185778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/3717243709726185778'/><link rel='alternate' type='text/html' href='http://marcbc.blogspot.com/2009/03/file-sharing-using-stratus-part-2-send.html' title='File Sharing using Stratus (Part 2: Send file example)'/><author><name>Marc Baiges Camprubi</name><uri>http://www.blogger.com/profile/08393403983062991622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_UTai5drmhWg/Sa2v7e0n9GI/AAAAAAAAAC4/j9DXXap4HQw/s72-c/Picture+1.png' height='72' width='72'/><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1539454903648840250.post-7312483066457482666</id><published>2009-03-01T12:26:00.000-08:00</published><updated>2009-03-06T02:41:26.788-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='stratus'/><title type='text'>File Sharing using Stratus (Part 1: Jozsef Vass example)</title><content type='html'>&lt;span style=";font-family:verdana;font-size:100%;"  &gt;This days I've been playing with the new &lt;a href="http://labs.adobe.com/technologies/stratus/"&gt;Stratus service&lt;/a&gt; introduced by Adobe with the Flash Player 10 release.&lt;br /&gt;&lt;br /&gt;Stratus is a service that enables Flash Player clients to connect directly point to point, to share data (audio, video, binary...)&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.adobe.com/devnet/flashplayer/articles/rtmfp_stratus_app/fig01.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 306px; height: 275px;" src="http://www.adobe.com/devnet/flashplayer/articles/rtmfp_stratus_app/fig01.jpg" alt="" border="0" /&gt;&lt;/a&gt;. Stratus is just an external actor put between both end points that manages the connection, but doesn't deal with the information transfered, as it is illustrated in the following figure published by Jozsef Vass in its article &lt;a href="http://www.adobe.com/devnet/flashplayer/articles/rtmfp_stratus_app.html"&gt;"Stratus service for developing end-to-end applications using RTMFP in Flash Player"&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the article, Jozsef makes an introduction about Stratus and the Real-Time Media Flow Protocol (RTMFP), introduced also in FP10, built on UDP, that is perfectly suited for audio/video transfers and simplifies connections when clients are behind NATs. To make applications that  use this beta service from Adobe, developers have to apply for a &lt;a href="https://www.adobe.com/cfusion/entitlement/index.cfm?e=stratus"&gt;developer key&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The article comes with a source code example which is really illustrative, which is a video conference application built in Flex, using the Stratus service.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_UTai5drmhWg/SasAtHYyv-I/AAAAAAAAACQ/qNSAdmNpznI/s1600-h/chat.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 266px; height: 320px;" src="http://4.bp.blogspot.com/_UTai5drmhWg/SasAtHYyv-I/AAAAAAAAACQ/qNSAdmNpznI/s320/chat.jpg" alt="" id="BLOGGER_PHOTO_ID_5308337360863412194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;You can try it out &lt;a href="http://labs.adobe.com/technologies/stratus/samples/#resources"&gt;here&lt;/a&gt;). Just open a couple of browsers and sign in the application using two different nick names. Once signed, enter your "buddy's" nickname and call him/her to see him/her doing strange faces (as in the picture, me talking to myself).&lt;br /&gt;&lt;br /&gt;The example is really cool, and a great start point for plenty of possible applications where messaging is involved. I found it a little tricky to follow, because there are big code jumps, 2 user scenarios depending on whether one is calling/answering,  and some auxiliar classes to deal with the user login service.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;How does the connection process work?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;I think this is the interesting point in this example. To put both peers in touch, the process is more or less like this:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;User A connects to Stratus service (rtmfp://stratus.adobe.com) using a NetConnection object, from the application that has a specific developer key. The service assigns the User A an ID.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;User A registers this ID into some kind of user manager service. This is independent from Stratus and Adobe, and has to manage the pair User Name - User ID.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;Once registered, User A publishes a listener Stream, that will be waiting for other user connections.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;User B makes the same process as User A about registering.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;User B publishes its listener stream.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;User B decides to call User A, so he/she publishes its media stream, with the audio/video from his/her webcam. At this point, B doesn't know nothing about A, so he/she has to ask te user managment service which ID has the user with name "User B".&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;With the returned ID and through Stratus (by means of the NetConnection object that keeps the connection with Stratus alive), User B reaches User A.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;User A listener StreamHhandler function is called. This is where by accepting the call, User A will subscribe to User B published media stream and at the same time, A will publish his/her  media stream.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;User A will send a notification to B about it's call acceptance, so B will know he/she can subscribe to A's recently published media stream.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;A and B will start chatting, fall in love, or whatever.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;And it works great! So I started thinking about if it could be also used for other purposes as binary data transmition, and of course, I was not the first to think about it. Anyway, &lt;a href="http://marcbc.blogspot.com/2009/03/file-sharing-using-stratus-part-2-send.html"&gt;here comes my example&lt;/a&gt;!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1539454903648840250-7312483066457482666?l=marcbc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcbc.blogspot.com/feeds/7312483066457482666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1539454903648840250&amp;postID=7312483066457482666' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/7312483066457482666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/7312483066457482666'/><link rel='alternate' type='text/html' href='http://marcbc.blogspot.com/2009/03/file-sharing-using-stratus-part-1.html' title='File Sharing using Stratus (Part 1: Jozsef Vass example)'/><author><name>Marc Baiges Camprubi</name><uri>http://www.blogger.com/profile/08393403983062991622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_UTai5drmhWg/SasAtHYyv-I/AAAAAAAAACQ/qNSAdmNpznI/s72-c/chat.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1539454903648840250.post-9118547802834798072</id><published>2008-12-29T00:45:00.000-08:00</published><updated>2008-12-29T07:00:16.888-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='charts'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='solution'/><category scheme='http://www.blogger.com/atom/ns#' term='datatip'/><title type='text'>Keeping DataTips in Charts boundaries</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:verdana;"&gt;Here goes a little trick I used for an application some time ago. The problem was that data tips that are displayed on mouse overing Flex Charts, fly over the Application content, and in some cases do not respect the visible boundaries of it. This effect can be undesired, and a usability problem because can make the information impossible to read in some situations.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The attached application shows the problem in action.&lt;br /&gt;&lt;br /&gt;If you hover the first pair of charts, you'll see the custom created data tip appearing at the right of the central point of the sector being pointed. For the pie on the right, the information is unreadable.&lt;/span&gt; &lt;span style="font-family:verdana;"&gt;The second set of charts, use another data tip renderer implementation that keeps the data tip in the pie boundaries, making the information always visible.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;embed style="font-family: verdana;" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" allowscriptaccess="sameDomain" name="TestDataTipRenderer" bgcolor="#444444" quality="high" id="TestDataTipRenderer" src="http://sites.google.com/site/marcbcblog/Home/position_DataTipRenderer.swf" align="middle" height="475" width="300"&gt;&lt;/embed&gt; &lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;noscript  style="font-family:verdana;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="TestDataTipRenderer" width="300" height="475" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;&lt;param name="movie" value="http://sites.google.com/site/marcbcblog/Home/position_DataTipRenderer.swf"&gt;&lt;param name="quality" value="high"&gt; &lt;param name="bgcolor" value="#444444"&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;embed src="http://sites.google.com/site/marcbcblog/Home/position_DataTipRenderer.swf" quality="high" bgcolor="#444444" width="300" height="475" name="TestDataTipRenderer" align="middle" play="true" loop="false" quality="high" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/span&gt;&lt;/span&gt;&lt;/noscript&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: verdana;" href="http://sites.google.com/site/marcbcblog/Home/position_dataTipRenderer.zip"&gt;Get the source code here.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt; It's so simple, just take care when displaying the data tip in the default position that it fits into its owner chart, and if it's not possible, adjust its position.&lt;/span&gt;  &lt;span style="font-family:verdana;"&gt;Hope it helps!&lt;/span&gt;  &lt;span style="font-family:verdana;"&gt;And if you find a better way to solve the problem... or see anything that could be improved, please write!  ;-)&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1539454903648840250-9118547802834798072?l=marcbc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcbc.blogspot.com/feeds/9118547802834798072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1539454903648840250&amp;postID=9118547802834798072' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/9118547802834798072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/9118547802834798072'/><link rel='alternate' type='text/html' href='http://marcbc.blogspot.com/2008/12/keeping-datatips-in-charts-boundaries.html' title='Keeping DataTips in Charts boundaries'/><author><name>Marc Baiges Camprubi</name><uri>http://www.blogger.com/profile/08393403983062991622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1539454903648840250.post-3928588933732663541</id><published>2008-12-17T00:39:00.000-08:00</published><updated>2008-12-17T10:21:54.962-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='solution'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Webcam picture taking with Flash and AS3</title><content type='html'>&lt;span style=";font-family:verdana;font-size:100%;"  &gt;Long time since last post... It's been nearly 2 months since I changed my &lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;internet provider &lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;at home... and have no &lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;connection yet :-(&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a style="font-family: verdana;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_UTai5drmhWg/SUjHV1SIVNI/AAAAAAAAABw/H4v0NslBZ54/s1600-h/Picture5.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 249px; height: 249px;" src="http://2.bp.blogspot.com/_UTai5drmhWg/SUjHV1SIVNI/AAAAAAAAABw/H4v0NslBZ54/s320/Picture5.png" alt="" id="BLOGGER_PHOTO_ID_5280689740986209490" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;I recently had to implement a cool feature for a project, consisting i&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;n a picture-taker using the webcam, for a user registration process. The&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt; feature has been added recently in Facebook, allowing users to upload pictures and videos directly to their friends' walls.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;Displaying the webcam content in a Flash movie is quite easy:&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;// 1. Access the default camera&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;var cam:Camera = Camera.getCamera();&lt;br /&gt;// 2. Create a video display object&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;var video:Video = new Video(550,400);&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;// 3. Attach the camera to the video display&lt;br /&gt;video.attachCamera(cam);&lt;br /&gt;// 4. Add the video display object to the stage&lt;br /&gt;stage.addChild(video);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;br /&gt;Then, through the BitmapData object, it's possible to take a snapshot at the desired moment drawing the data from the Video object into a ByteArray (and encoding this information using an encoder JPEG/PN&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;G/...). This binary data can be sent to the server, with a URLRequest and there processed by whatever server side technology.&lt;br /&gt;&lt;br /&gt;// 1. Create the req&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;uest object&lt;br /&gt;var req:URLRequest = new URLRequest(remoteURL);&lt;br /&gt;// 2. Specify we're sending binary data&lt;br /&gt;req.contentType = "application/octet-stream";&lt;br /&gt;// 3. Send by POST (GET doesn't allow enough data)&lt;br /&gt;req.method = URLRequestMethod.POST;&lt;br /&gt;// 4. Put the image binary data in the request body&lt;br /&gt;req.data = binaryArray;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a style="font-family: verdana;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_UTai5drmhWg/SUjQ9vuAB7I/AAAAAAAAACA/GQvgrzXl0j8/s1600-h/Picture+1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 217px; height: 143px;" src="http://1.bp.blogspot.com/_UTai5drmhWg/SUjQ9vuAB7I/AAAAAAAAACA/GQvgrzXl0j8/s320/Picture+1.png" alt="" id="BLOGGER_PHOTO_ID_5280700322291910578" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;It's quite easy to get this point. But there's a &lt;span style="font-weight: bold;"&gt;usability issue&lt;/span&gt; with all &lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;this stuff, which is that to access the webcam, Flash needs &lt;span style="font-weight: bold;"&gt;the user authorization&lt;/span&gt;, requested through a dialog. &lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;First thing that drove me crazy, because if the Flash movie doesn't have the &lt;span style="font-weight: bold;"&gt;minimum dimensions (215 x 138)&lt;/span&gt; to show this dialog, there's no advice, but the vid&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;eo won't be displayed. It's clearly explained in t&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;he ActionScript 3 language reference (&lt;a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Camera.html"&gt;link to API&lt;/a&gt;), it's true. My fault, my fault :-P&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;a style="font-family: verdana;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_UTai5drmhWg/SUjRPFNkoqI/AAAAAAAAACI/V0fqZi5LWSQ/s1600-h/Picture+2.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 216px; height: 140px;" src="http://3.bp.blogspot.com/_UTai5drmhWg/SUjRPFNkoqI/AAAAAAAAACI/V0fqZi5LWSQ/s320/Picture+2.png" alt="" id="BLOGGER_PHOTO_ID_5280700620119253666" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;But then, a second usability problem. Camera.getCamera() retrieves the "d&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;e&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;fault" camera in the computer. In my MacBook Pro, Flash detects 3 webcams (even I just have &lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;the built-in one), which are displayed as "FireWire Video","DV Video" and "USB Video Class Video".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;The problem is that just from the "USB Video Class Video" I'm able to capture video images. So it's not just asking for permission to access the webcam to the user, but also requiring him/her to go to the camera tab in the Flash settings menu, to try between this unknown video devices to check which one works? But wait, Facebook is detecting my webcam automatically! Even if I choose one of the non valid... when I try again the "USB Video Class Video" it's being used. So it must be possible to select the correct one somehow. And then I came across this article (&lt;a href="http://sanderkruger.blogspot.com/2007/02/working-with-cameras-in-as3.html"&gt;Sander Kruger's blog&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;Here, the author explains a tricky way to detect the valid one. The basics:&lt;br /&gt;&lt;br /&gt;- Camera.getCameras() returns an array of Camera objects with the system cameras (in my MacBook Pro [FireWire Video, DV Video. USB Video Class Video], so we can know how many are accessible.&lt;br /&gt;- Camera.getCamera() will get the default one (could be any of the system ones, available or not), but there's a second method, Camera.getCamera(String), that retrieves one specifically, from the total we discovered using Camera.getCameras(). The String parameter, represents the index of every camera in the array Camera.getCameras(), [0 to N-1]. So in my case, we can get the USB Video Class Video Cam for example, doing Camera.getCamera("2").&lt;br /&gt;- The Camera object will dispatch a StatusEvent notifying if the user has accepted or rejected the access to the webcam from the Flash built dialog.&lt;br /&gt;- The Camera object will dispatch ActivityEvents when it detects movement in the scene, but only if the camera is attached to a Video object where to be displayed.&lt;br /&gt;&lt;br /&gt;With all this ingredients then you can cook a camera detection process. Once the Camera says it's accessible from the user request dialog (StatusEvent), you can loop over each cam object from Camera.getCameras, adding an activity handler for the ActivityEvents it could dispatch, and attach the Camera to a Video object, that's not added to the Stage (always hidden then). Then starting a Timer, we can give the Camera some time to detect activity... if it was not the case and the countdown finishes, then we should remove the activity event, detach the camera from the video and move to try the next Camera from the Array. Keep looping this way until one of the Cameras gives some activity news... or all of them are checked and none response to activity.&lt;br /&gt;&lt;br /&gt;Hope the experience is helpful to someone :-)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1539454903648840250-3928588933732663541?l=marcbc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcbc.blogspot.com/feeds/3928588933732663541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1539454903648840250&amp;postID=3928588933732663541' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/3928588933732663541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/3928588933732663541'/><link rel='alternate' type='text/html' href='http://marcbc.blogspot.com/2008/12/webcam-picture-taking-with-flash-and.html' title='Webcam picture taking with Flash and AS3'/><author><name>Marc Baiges Camprubi</name><uri>http://www.blogger.com/profile/08393403983062991622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_UTai5drmhWg/SUjHV1SIVNI/AAAAAAAAABw/H4v0NslBZ54/s72-c/Picture5.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1539454903648840250.post-6468475750321357506</id><published>2008-10-24T13:42:00.000-07:00</published><updated>2008-12-17T07:29:17.524-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><title type='text'>WWWWW?</title><content type='html'>So... I was very excited last week about the idea of starting this blog, and I forgot to introduce myself  :-S&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Who?&lt;/span&gt; This is Marc Baiges, Multimedia Engineer by &lt;a href="http://www.salle.url.edu/portal/lasalle/enginyeria-arquitectura/Controller?mvchandler=portals&amp;amp;action=change-language&amp;amp;view=collage&amp;amp;lang=en"&gt;La Salle Engineering School&lt;/a&gt;, Barcelona.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Where?&lt;/span&gt; Born, growed up and living in &lt;a href="http://maps.google.com/maps?f=q&amp;amp;hl=es&amp;amp;geocode=&amp;amp;q=barcelona&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;z=11&amp;amp;g=barcelona&amp;amp;iwloc=addr"&gt;Barcelona&lt;/a&gt;, working at &lt;a href="http://blog.strands.com/"&gt;Strands&lt;/a&gt;.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;What?&lt;/span&gt; I've been working with Java/JEE technologies for almost 3 years and for the last year I've been programming with Flex. I enjoy working with Flex and spend a lot of time reading about it. So I'll try to write about my daily experience with it, the problems I face, solutions I find, examples I see... everything I think is worth sharing with others.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;When?&lt;/span&gt; Heheheh, good one... I'll try to do it regulary, as often as I can, I promise.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Why?&lt;/span&gt; This is the important one. Why... I can think of many reasons why. Three of them:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I'd like to make people know about me. Because community is very impotant in our sector. We're asking for help daily in forums, mailing lists, blogs, etc... and I think it's easier for people to get involved in your business when they know something about you, what you do, remember you for trying to help some others time ago, read once an interesting article you wrote... anything.&lt;/li&gt;&lt;li&gt;I like Flex, as I said before, and like reading about it, evaluating this new graphics library, that other MVC framework... And I don't have so many people to talk about it and feel the need to share it with others!!!&lt;/li&gt;&lt;li&gt;To practice my English. May sound stupid, but is a very important reason for me. I want to improve it so, any mistake I make, anything that sounds "unnatural", please tell me. I'll be very grateful!&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;hope to see you around :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1539454903648840250-6468475750321357506?l=marcbc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcbc.blogspot.com/feeds/6468475750321357506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1539454903648840250&amp;postID=6468475750321357506' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/6468475750321357506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/6468475750321357506'/><link rel='alternate' type='text/html' href='http://marcbc.blogspot.com/2008/10/wwwww.html' title='WWWWW?'/><author><name>Marc Baiges Camprubi</name><uri>http://www.blogger.com/profile/08393403983062991622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1539454903648840250.post-4162301423447992321</id><published>2008-10-23T14:23:00.000-07:00</published><updated>2008-12-29T07:01:44.178-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='madeinflex'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><title type='text'>Flex performance tips</title><content type='html'>One of the most interesting sessions I assisted in MIF Onsite III was "Flex optimization" by &lt;a href="http://www.theklue.com/"&gt;Alberto Alacaraz&lt;/a&gt;. He talked about optimizing Flex applications, performance and memory usage, and some tips to achieve it by using the Flex Profiler.&lt;br /&gt;&lt;br /&gt;Performance/memory usage are both equally important issues while developing successful applications, but focusing in performance, it's a key aspect when talking about user experience. When working with interactive aplications, the user expects an inmediate response to a button click, or a key press, a drag &amp;amp; drop... and if these events fire any inefficient processes, the overall user impression about the application can be damaged.&lt;br /&gt;&lt;br /&gt;Alberto pointed some simple tips to have in mind when coding Flex applications. Very simple things in fact, but I often forget those when coding...&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Remembering ActionScript statements such as "break" or "continue" when iterating in loops can save some precious time. Come on, review &lt;a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/statements.html"&gt;ActionScript3.0 statements&lt;/a&gt;!&lt;/li&gt;&lt;li&gt; Bindings in Flex are very powerful, but involve some overhead we must be aware of. They are very useful to ensure we're displaying the latest data in our views, but do we want to notify the view of every change we make over this data? Perhaps notifying sets of changes, between consistent states could be enough...&lt;/li&gt;&lt;li&gt;The object &lt;a href="http://en.wikipedia.org/wiki/Object_pool"&gt;pool pattern&lt;/a&gt;, that a very elegant way to improve object instantiation times.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here, I try reproduce some of the examples Alberto showed (&lt;a href="http://sites.google.com/site/marcbcblog/Home/performance_tips.zip"&gt;here the source code&lt;/a&gt;):&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="performance_tips" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" height="575" width="100%"&gt;&lt;br /&gt;&lt;param name="movie" value="http://sites.google.com/site/marcbcblog/Home/performance_tips.swf"&gt;&lt;br /&gt;&lt;param name="quality" value="high"&gt;&lt;br /&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;br /&gt;&lt;embed src="http://sites.google.com/site/marcbcblog/Home/performance_tips.swf" name="performance_tips" play="true" loop="false" quality="high" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" align="middle" height="575" width="100%"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;br /&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1539454903648840250-4162301423447992321?l=marcbc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcbc.blogspot.com/feeds/4162301423447992321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1539454903648840250&amp;postID=4162301423447992321' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/4162301423447992321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/4162301423447992321'/><link rel='alternate' type='text/html' href='http://marcbc.blogspot.com/2008/10/flex-performance-tips.html' title='Flex performance tips'/><author><name>Marc Baiges Camprubi</name><uri>http://www.blogger.com/profile/08393403983062991622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1539454903648840250.post-7062752305465192614</id><published>2008-10-19T02:41:00.000-07:00</published><updated>2008-10-19T09:18:00.866-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='madeinflex'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><title type='text'>MadeInFlex OnSite III</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.madeinflex.com/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 199px; height: 74px;" src="http://www.madeinflex.com/mifonsite3/imagen/logo_.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Last friday (October 17th 2008) I had the chance to attend to &lt;a href="http://www.madeinflex.com/mifonsite3/"&gt;MIF OnSite III&lt;/a&gt;, a Flex event that &lt;a href="http://www.madeinflex.com/"&gt;MadeInFlex&lt;/a&gt; (the most active Spanish community in Flex) organized in Madrid. It was a single day event.&lt;br /&gt;&lt;br /&gt;The scheduling:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;KeyNote, by &lt;a href="http://www.duvos.com/"&gt;Enrique Duvós&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Flex Optimization, by &lt;a href="http://www.theklue.com/"&gt;Alberto Alacaraz&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.domestika.org/"&gt;Domestika&lt;/a&gt;, an online community, by &lt;a href="http://www.orangeside.org/"&gt;Borja Delgado&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Advanced Architectures Flex/JEE - RIAlity, by &lt;a href="http://www.carlosrovira.com/"&gt;Carlos Rovira&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.wedtool.com/"&gt;WedTool.com&lt;/a&gt;, a Startup in Flex, by &lt;a href="http://ablesa.wordpress.com/"&gt;Angel Blesa&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Papervision3D for dummies, by &lt;a href="http://www.joangarnet.com/"&gt;Joan Garnet&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The Future, by &lt;a href="http://www.sidedev.net/blog/"&gt;Joseba Alonso&lt;/a&gt; and &lt;a href="http://www.code4net.com/"&gt;Xavi Beumala&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;It was the 3rd edition of this event, having attended the previous ones in Barcelona. There's no possible comparison with events like 360Flex or MAX, neither for its size, nor for big announcements. Adobe speakers leave some comments on how great new things will be announced... in future events, like Max.&lt;br /&gt;&lt;br /&gt;Anyway, it's a great way to see what's going on close to you, what Flex recipe is cooking the neighbour next door.&lt;br /&gt;&lt;br /&gt;For work reasons I missed the "Wedtool" conference, so, a part from that, I really enjoyed Flex Optimization by Alberto Alcaraz , and the one about the close future, with CS4, Gumbo and AIR 1.5. I'll try to reproduce some of the situations Alberto talked about in an upcoming post.&lt;br /&gt;&lt;br /&gt;The Papervision for dummies, was really "entry level". I'm not complaining about it, for some reason Joan Garnet had few time to prepare it and did a good job. The Domestika one was perhaps a little out of  place, but loved the work they've done in the site redisign.&lt;br /&gt;&lt;br /&gt;My overall impression after this 3 events is that the spanish Flex community is not very communicative. I was checking my RSS subscriptions about Flex... and there is just 2 over 40 sites I follow. Man, do we only know how to communicate while in the bar holding a "caña" in our hand??? (I guess is difficult to type in this situation :-P)&lt;br /&gt;&lt;br /&gt;I forgot to mention the event was 100% free, so I'd like to thank the organization for its effort and encourage them to keep on working in building community.&lt;br /&gt;&lt;br /&gt;thanks MadeInFlex.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1539454903648840250-7062752305465192614?l=marcbc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcbc.blogspot.com/feeds/7062752305465192614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1539454903648840250&amp;postID=7062752305465192614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/7062752305465192614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539454903648840250/posts/default/7062752305465192614'/><link rel='alternate' type='text/html' href='http://marcbc.blogspot.com/2008/10/madeinflex-onsite-iii.html' title='MadeInFlex OnSite III'/><author><name>Marc Baiges Camprubi</name><uri>http://www.blogger.com/profile/08393403983062991622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
