Posts Tagged Flash

I am Flash Developer

This isn’t the next article I wanted to write but it was on my list since Flash In The Can Toronto (2010). It comes from all the talks surrounding the refusal from Apple to let Flash on the iPad ( i guess we can just say iOs now).  During that period a lot off people (including me) where uncertain about their future. I mean when someone as powerful as Steve Jobs tells you that your job shouldn’t exist, you think about it twice. Out of the turmoil that ensued, some voices touched me more than others. What they were saying is that they, as developers, weren’t tied to a technology and that if Flash was to disappear tomorrow, they would still have a job. That got me to think. A lot. The next thing that affected me was something I heard at FITC concerning designers. How they don’t call themselves ’Photoshop Designers’ or ‘Corel Draw Designer’ (I tried to think of another product than Adobe but just could come up with Corel Draw (who uses that anyway), but you get the idea). I think this follows a bit the same vibe as the comments from the Flash dudes.

All of this feed my reflexions, I mean I have tried a lot of technologies (all things in perspective, I am still at the start of my career, so I humbly say so). I have tried Java, PHP, MySQL, C, Flash, ActionScript 2 and 3, HTML/JavaScript/Css, Ajax, Asp, C#, Python. And you know what? There is nothing I like better than doing ActionScript 3. I mean the tools help a lot; FDT (yes I said it, I now like FDT) or FlashDevelop for code and Flash CS5 for visual assets. I like the workflow, I like making PSDs alive, I really like using TweenLite to make stuff move, I like figuring out how to build my applications so that they minimize load time and CPU usage (I also like maximizing CPU but don’t tell HTML5 fanatics, they know jack shit about pushing limits, yet, but they will know what I mean when they taste it, which will happen for sure). All of that I can’t get from any other technology to the extent that Flash does it right now.

It’s been 2 months that I am at B-Reel right now. I really love it, but the project that I am doing right now mostly doesn’t involve Flash ( I managed to stick a bit of Robotlegs in there) and is mainly Javascript/Html/Css. I really look forward to doing a Flash project. I really don’t want to do html ever again. I don’t have fun doing it (well I am just speaking about the technology, the project itself is amazing). Also, I feel the world of Flash is so deep and there is so much you can do to get better that if you learn all of the other technologies you can never get truly as good on the Flash Platform as one could be. For all of these reasons, that is why I am Flash Developer, that is my title and I am not ashamed or feel diminished by it. It really defines me.

With that being said, it gives me security. I think I am not alone in this situation. I think Flash gives a mean to express themselves to a lot of people and because of that, you can be sure that these people will produce tons of cool shit with it. And other people will want to see that cool shit. That gives a reason for Flash to be. Someday there will be Flash on the iOs. You can be sure of that (I mean Steve Jobs has an expiration date, right?)

, , , ,

17 Comments


Why Flash is not disappearing

All the debate about Apple vs Adobe really got me thinking lately. Last night , I woke up at 4 in the morning with the idea for this post. It suddenly hit me. Most of the latest trends on the web happened because it was allowed by Flash. If you think about 3D, Augmented Reality and ChatRoulette; all of those could not have happened if Flash didn’t exist and are currently not possible to implement using HTML5.

3D

3D really picked up when Papervision3D ported there library from ActionScript 2 to ActionScript 3. ActionScript 3 made it faster so you could actually do some interesting 3D without automatically killing the user’s CPU. Right after that we saw a wave of Flash website all using 3D in them. I’m not saying that was good; plenty of sites used the 3D for no reason at all except for the fact that it was cool. Now that the hype on 3D as dimmed down, we see better uses of the library. My point is that Flash opened up new possibilities. There are now a few more libraries for 3D (Away3D, Sandy3D, Five3D, etc) and I don’t think those would be possible with the current state of javascript. Right now everybody speaks about HTML5 and the Canvas but, boy, JavaScript is so not on par with ActionScript 3. jQuery makes it better but still. Here is a good example of a site that uses 3D.

3D models in Flash

Augmented Reality

AR was all the buzz last year and 3D is what really made it possible in the browser. AR is a concept that has been around since the 90s but it never picked up until it came to Flash because it made it accessible. For AR you mostly need 3D and a camera. The webcam is easily accessible in Flash and since Flash is so ubiquitous. Now video is possible with HTML5 but webcam won’t happen; maybe HTML6. So as AR evolve we will see tons of new applications coming our way.

GE augmented reality

ChatRoulette

Now ChatRoulette is really interesting. I don’t know if it is going to last or if it is going to disappear or change, but it definitely showed an interesting facet of the internet ( not talking about the impressing number of male exhibitionists out there). ChatRoulette could use the webcam and a media streaming server, but that is not what is happening here. Already all that is not possible in HTML5. What ChatRoulette is using is the new P2P service Stratus by Adobe integrated FlashPlayer 10. That is a new feature in the Flash player that most people are not aware of. What it does is that it connects users directly to send the video without going through the server ( in this case the ChatRoulette server) so it save a lot of money in bandwidth. Is this a cool feature? fuck yeah. Is this close to being included in HTML5? Not in years.

Chatroulette interface

The general conception is tying Flash to video, but that is not all that Flash does right. 3D, AR, and P2P are just some examples I took to illustrate the fact that Flash is pushing the web forward; I can easily think of many more: microphone access, Pixel Bender, ActionScript 3 (so much more fun to work with than JavaScript), AIR, etc. And that is just what is available right now in Flash Player 10. I can’t wait to see what will be available in the future.

, , , , , , , , , , ,

4 Comments


The iPad and me

I don’t really like to do opinion pieces. On the subject of technology, like religion, sometimes it doesn’t really matter what you say; both sides never really listen to each other. I don’t want to add another pointless my side is better than yours article. But I think it is sad when people say that such and such is bad and should die. Like it is currently the case with Flash and the whole iPad brouhaha. What I think these people don’t consider is the human impact behind this.

If Flash was to go away tomorrow, I’d find myself without a job. Well, I’d need time to learn another language and then I’d find another job but it wouldn’t be the same thing. I am really glad I found Flash and ActionScript 3. This is what I want to do for at least the next 5-10 years. What I like about it is that it speaks to both my programmer and creative side. It is also fast-paced; in the web agency world, you move from projects to projects really fast and you have to keep up with technology at the same time. It might seems weird but I really like that; no time to get bored. If it wasn’t for Flash, I don’t think think I would love my job as much as I do.

After the iPad announcement I found myself a bit confused and stressed about my future. The future of Flash seemed uncertain so my future seemed uncertain to. Not uncertain because of the evolution of technology (like HTML5) but because a company decided what the outcome should be. If all Apple products stop supporting Flash, this is not good news to me. What possibilities I had would lessen. Some would say that I shouldn’t tie myself to a technology, I know, and if I have too I will learn something knew, but as I said before I really like Flash. That made me think that it’s not only companies that can choose who gets to live or to fade (technology wise). Us, as developers, can put our weight in the balance too. As long as there will be people producing get content for the Flash platform, it will continue to thrive. If I like Flash that much, I must not be alone and from reading all those article that take Flash’s defense, I think I am right. So I feel more at ease now. The future is still uncertain but certainly less gloomy.

One last thing about the iPad. Zeldman in his post states that the computer of tomorrow is a computer that is dead simple but that in return doesn’t give all powers over it for the sake of usability, like the iPhone and the iPad do. I think that a portion of the population in fact wants that. Right now this portion might be big, but I think it will shrink because it doesn’t consider that the children that are raised right now have never seen the time when there was no computers. These will be way more computer literate than my parents lets say. For that I think a device like the iPad is closer to a toy than to a tool. If it wanted to dominate the netbook market, than it will fail. We don’t really know what is the role the netbook is going to take, but by making one that is limited in its usage, you also reduce your chance of getting it right.

Well that’s all I had to say.

, , ,

6 Comments


How to make Collada model double sided in Papervision3D

Well I searched for this for a little while and even tough it is pretty easy, if I didn’t figure it out at first probably other people had the same absence of mind. Also I find it hard to find example of Papervision3D and know which version was used; you find a lot of examples but you never know if the API changed since then so I am going to do a complete example with the version used.

The version used for this example is 2.1.92.

What I wanted to do was to load a Collada model in Flash an animate it. Every thing was going fine with the test models until I used the real models. You see the real models had holes in them that allowed you to see inside the model. Now if your material is single sided, when looking inside, you are going to see through the material and it will look buggy. The solution to this is just to make all material in your model (you can map multiple textures in one loaded Collada model), but that is not as easy as it sound. I tried a couple of options before hitting myself on the face. What did you learn back with ActionScript 2; wait till something is loaded before trying to modify it. This also applies to loaded models. Once loaded I made a little function that would cycle through all materials and make them double side.

Here is the code for the example :

//create all the actors of a Papervision3D scene
 
var viewport:Viewport3D = new Viewport3D(1000, 800);
addChild(viewport);
 
var renderer:BasicRenderEngine = new BasicRenderEngine();
var camera:Camera3D = new Camera3D();
var scene:Scene3D = new Scene3D();
 
//create the DAE/Collada object and load the model
 
var model:DAE = new DAE(false);
model.load("model.dae");
model.addEventListener(FileLoadEvent.LOAD_COMPLETE , daeLoadComplete, false, 0, true);
scene.addChild(model);
//finally add the enter frame listener to render the scene
 
addEventListener(Event.ENTER_FRAME, render, false, 0, true);
 
function render(event:Event):void{
  renderer.renderScene(scene, camera, viewport);
}
 
//this is where the magic happens, we cycle through all the materials of the model and make them double sided
 
function daeLoadComplete(event:FileLoadEvent):void{
  var matList:MaterialsList;
  var mat:MaterialObject3D;
  matList = model.materials;
  if ( matList ) {
    for each (mat in matList.materialsByName) {
      mat.doubleSided = true;
    }
  }
}

I didn’t include the import statement because I plainly forgot to send them to myself, but I will update this post to add them. Have fun loading models!

, , ,

4 Comments


How to connect to Google Analytics Data API in Flash

In one of my previous post, I explained how to connect to Google Analytics Data API in AIR. The problem with that way of connecting was that it only worked in AIR. In Flash it works locally, but as soon as you put in on your web server it stops working. Not it is cool to build an AIR (desktop) application that pulls data from Google Analytics, but it would also be cool to build a web application that does the same thing. Well I found out how to do just that. It is a bit more complicated because it involves a bit of server side coding, in this case PHP.

How the process works is that first you login to Google Analytics, Google will then send you a token that you must use when asking for data. So we will have two simple PHP files; one to login in and one to ask for data.

The first one looks like this:

<?php
//this file is called get_token.php
$user = $_REQUEST[user];
$pass = $_REQUEST[pass]
 
require_once 'curl.php';
$curl = new Curl;
$response = $curl-&gt;post('https://www.google.com/accounts/ClientLogin', array(accountType => "GOOGLE",  Email =>$user, Passwd => $pass, service => "analytics", source => "zedia-GAStats-0" ));
$tempArray = explode("Auth=", $response);
?>
<root>
	<token><?php echo ($tempArray[1] ); ?></token>
</root>

The second one looks like this:

<?php
//this file is called call_ga.php
require_once 'curl.php';
$url = $_REQUEST["url"];
$token = $_REQUEST["token"];
 
$curl2 = curl_init();
curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl2, CURLOPT_HEADER, "0");
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl2, CURLOPT_URL, $url);
 
curl_setopt($curl2, CURLOPT_HTTPHEADER, array('Authorization: GoogleLogin auth=' . $token));
$response2 = curl_exec($curl2);
echo ($response2);
?>

As you can see to make my calls to Google I am using the cURL library that is usually already installed on your server if you have PHP. Also for the get_token.php I am also using the Curl class, made by Sean Huber, that just makes it easier to work with cURL.  Upload these files to your server. Now that we have the server side figured out, we can move on to the Flash part;  here it is:

package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.text.TextField;
 
public class Main extends Sprite
{
  private var loader:URLLoader;
  private var _loader2:URLLoader;
  private var _textField:TextField;
  private var _token:String;
  private var _buffer:String = "";
  public function Main():void
  {
    loader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, _onTokenLoaded, false, 0, true);
   //this call will load the token
 
    loader.load(new URLRequest("http://www.YOUR_URL_WHERE_THE_PHP_RESIDE.net/get_token.php?user=YOUR_USERNAME&pass=YOUR_PASSWORD"));
 
    _textField = new TextField();
    _textField.height = 300;
    _textField.width = 300;
    _textField.multiline = true;
    _textField.wordWrap = true;
 
    addChild(_textField);
  }
 
  private function _onTokenLoaded(event:Event):void {
    var tempString:String = String(loader.data);
    tempString = tempString.substring(1, tempString.length);
    var tempXML:XML = XML(tempString);
    _token = tempXML.token;
 
    _textField.text = _token;
 
    _loader2 = new URLLoader();
    _loader2.addEventListener(Event.COMPLETE, _onFeedLoaded, false, 0, true);
 
    var request:URLRequest = new URLRequest("http://www.YOUR_URL_WHERE_THE_PHP_RESIDE.net/call_ga.php");
    var urlVar:URLVariables = new URLVariables();
    urlVar.token = _token;
    urlVar.url = "https://www.google.com/analytics/feeds/accounts/default";
    request.data = urlVar;
 
    _loader2.load(request);
  }
 
  private function _onFeedLoaded(event:Event):void {
    _textField.text = String (_loader2.data);
  }
 }
}

What you basically do is that you use your server to do all the communication between the Flash and Google. Everytime you will want a different feed to get different data you will call the call_ga.php file. It is that simple. If you have any question on this feel free to ask them in the comments.

, , , , , ,

12 Comments


An update on Flash SEO

I was just in Jim Corbett Flash Player Internal v2 presentation at FITC and I learned a couple new facts about SEO that I wanted to share.

First, it now seems that Google will be indexing loaded files; that was intented for a while and I will still have to make some experiments to see if it really works but Adobe says it works. Well it doesn’t really work like they would want it to work: when Google sees that the SWF is loading a file, it doesn’t load it in the currently playing Flash file but it makes a note of it and will load and reference that content later. The text in there will still be associated with the previous url, but it won’t play in the right context. That last caveat doesn’t bother me much; my biggest concern was that all the work I do is preloaded by an external preloader, so none of my content was Flash SEO friendly. Now it will get indexed.

Another interesting fact that was kinda hinted in the presentation was that the SEO Flash player is not suppose to index text when it is out of bound of the stage; when the user doesn’t see it. But, if you put a button outside of the viewable area and that button will bring the SWF in a state where text is displaying on the stage(viewable), that text will be indexed. The problem is that the headless player doesn’t check if the button is viewable or not. This is not confirmed and I will also have to make tests on this.

Well I have to get back in there now.

,

3 Comments


PureMVC Skeleton for Flash Applications / Websites

I have done a couple of site using PureMVC and Flash and it seems that at the beginning of a project I’m always doing the same things, creating the ApplicationFacade, the folder structure, the main fla, etc. I thought it might be useful to slap together a generic skeleton for a PureMVC Flash application or website. You can download it here:

PureMVC Flash skeleton

All you have to do is in the src/com folder, rename the folder PROJECT_NAME to your project, and do a find and replace in files for PROJECT_NAME to replace it with what you changed the forlder name to. I didn’t include the PureMVC library in there because I suggest fetching the files from the official PureMVC website so that you always get the latest version. Once you get them, put them in the lib folder and you should be able to compile.

The rar file contains the following:

  • Main.fla, Preload.fla
  • Main.as
  • ApplicationFacade.as
  • StartupCommand.as
  • ApplicationDataProxy.as
  • ApplicationMediator.as
  • IMain.as (Interface so that the preloader can use the init function of Main.as)
  • the folder structure

This should help save half an hour every new PureMVC project.

, ,

4 Comments


Online Awards for Flash Websites

I compiled a small list of award websites at work and I tought it would be usefull to share it here too. I didn’t test any of those yet, so I don’t know which give the best results in term of traffic and visibility but here is what I have right now:

Favorite website awards (you have to pay) (25 words desc)
http://www.thefwa.com/

Dope awards (35 words desc)
http://www.dopeawards.com/

Design Licks
http://www.designlicks.com/

Best Web Gallery
http://bestwebgallery.com/category/flash/

Design Flavr (needs a screenshot of at least 523px)
http://www.designflavr.com/category/flash/

Design Snack (needs a screenshot 389 x 180px)
http://www.designsnack.com/

101 best websites (requires login)
http://101bestwebsites.com/category/flash

Inspiration Up
http://inspirationup.com

Website Design Awards
http://websitedesignawards.com/index.php/category/flash-gallery/

Spyline
http://spyline.de/section/flash

Creative Website Awards
http://www.creativewebsiteawards.com/

Mowsnet Web Awards
http://www.mows.sk/awards/index.php

iBlog
http://iblog.chubzz.com/

Another Bookmark
http://anotherbookmark.com/

Refresh links (nothing new since may 2008)
http://refreshlinks.org.uk/

Flash in the pan (seems outdated nov 2008)
http://www.flash-in-the-pan.org/

Flash Blasted (seems outdated nov 2008)
http://flashblasted.com/

Flash Galleria (seems outdated)
http://www.flashgalleria.com/

New Web Pick (requires a login and does not seem so relevant)
http://www.newwebpick.com/

I classified them by relevance from my first impression,  so as you go down the list, the less relevant and usefull becomes the link. This list will have to be updated as  I compile results from them.

, ,

1 Comment


It’s A Wonderful Life

It is with great pleasure that I present you the Twist Image holiday card : It’s a wonderful life:  The shameless product placement cut. This year’s version of the card is a video where we incorporated elements of our clients. You get to watch the video and at the end you guess how many insertion we did.

Unlike last year I didn’t get to work on the Twist Image card, because I was working on something else (can’t wait to show that), but I can say that this year card is pretty good. A lot of work as been put on the audio, video and the Flash and it paid off in the end. My only contribution on this project was some troubleshooting to include the SWFAddress library.

So here you go again:

It’s a wonderful life:  The shameless product placement cut.

Well stay tuned because I have a whole lot of other posts coming (I have been doing some cool stuff lately, probably have enough content for a post a day this week!). I’m off to rent the second season of Dexter.

, , , , ,

No Comments


Google Analytics For Flash; is it that usefull?

Not too long ago Google released Google Analytics for Flash. My first reaction was one of happiness; finally some attention would be put into Flash analytics. But after looking into it a bit more I found out that Google Analytics for Flash wasn’t such a big deal.

On Google Analytics side, nothing changed; no specific stats just for Flash,  just the good old interface we all know.  On the Flash side, nothing changed much there either; instead of doing this:

1
2
 
ExternalInterface.call("pageTracker._trackPageview('/somepage');");

You now do this:

1
2
tracker = new GATracker( this, "window.PageTracker", "Bridge", false );
tracker.trackPageview( "/somepage");

From the look of it, it’s actually more code than before.

The cool thing about GA for Flash is the ActionScript 3 mode. In that mode, you can call the tracker even if the JavaScript code wasn’t imported in the HTML page the Flash file is embedded. Now that is a possibility that we didn’t have before. So in a context where you do not have control over the HTML you flash will be embedded, this will enable you to do analytics just the same. I have also seen in the road map for the project that they want to implement it for Adobe AIR also; this will be very useful.

What will you be using Google Analytics for Flash for?

, ,

7 Comments