Browse > Home /

| Subcribe via RSS

Flash on the iPhone

October 9th, 2009 | No Comments | Posted in Flash Player, General, Macintosh

So Adobe MAX 2009 is over. Another MAX I missed. :(

This is a quick post on the Flash – iPhone matter that “hits” the web..(one more time)

Since Apple considers the whole web as a non Flash web, Im really glad to see Adobe trying to move forward and putting an “export for iPhone” on the CS5 Flash IDE. What this basically means for me is that I can write an app on the IDE, the way I used to do it and then magically Flash can make it a native iPhone app. I dont really know what the world “magically” means here but even if it works perfectly I can’t keep my eyes closed to the fact that Apple is the dictator that will decide if my app should hit the store or not.

More »

Flex Builder to Flash IDE on Valentine’s day: “I love you baby, lets have some swfs!”

February 22nd, 2009 | No Comments | Posted in Actionscript, Adobe Flash IDE, Adobe Flex

Well “Loaded + Embedded assets in AS3 project” would be a better name for this post..

Flex Builder is an amazing tool for me. Amazing not just because it makes the use of the Flex framework so easy but because it gives me freedom when I’m comparing it to the Flash IDE. Flex Builder IS NOT just for Flex. It is also an amazing actionscript editor, actually the best ActionScript editor that Adobe has ever created.

But as you might have guess a tool that creates swf files without a timeline, a symbols library and all the other cool stuff that Flash IDE has to offer can be really tricky sometimes.

In this post I will explain how can we get both of each IDEs advantages to do the job. Feel free to leave a comment if you think you have a better way to do such stuff.

I must give credits to Ted Patrick for an older post on the subject. (wow he just tweeted “Waking”, this is fun!)

The scenario is that you want to build a pure AS3 project (no Flex framework @ all) but you also want to use some assets that you created on Flash IDE.

First move would be to add all the stuff, like images, sounds, movieclips etc to the library of our lets say “Assets.fla”.

There is no need to have them on stage because the next step is to give a linkageID on each one of them and that should be enough in order to have access from our AS3 project in Flex Builder.

On Flex Builder we create a new Actionscript project and this is where we have to decide about another thing.

EMBEDDED FLA ASSETS or LOADED FLA ASSETS?

Lets start with the Embedded assets from FLA.

Our project’s name is RuntimeFlashEMBEDDED and it will include 3 files.

One is the main project’s file, another one is a separate class for embedding the swf (the code on this one could be easily on our main file but anyway) and the last file is of course the swf exported from Flash IDE file which includes all the assets.

Here is the basic code on the main file of our project:

package {
import flash.display.Sprite;
 
[SWF(backgroundColor="0x000000", frameRate="60", width="900", height="600")]
 
public class RuntimeFlashEMBEDDED extends Sprite
 
{
//EMBEDDED ASSETS
 
private var myMC:Sprite = Includes.MyMovieClip;
private var myJPG:Sprite = Includes.MyJpg;
private var myPNG:Sprite = Includes.MyPNG;
public function RuntimeFlashEMBEDDED()
{
addChild(myMC);
addChild(myJPG);
addChild(myPNG);
}
}
}

Here is the code of the Includes.as file which embeds the specific symbols that I need:

package
{
 
import flash.display.Sprite;
 
public class Includes
 
{
[Embed (source="assets.swf", symbol="myMovieClip")] //*
private static var $MyMovieClip:Class
public static var MyMovieClip:Sprite = new $MyMovieClip();
 
[Embed (source="assets.swf", symbol="myJpg")]
private static var $MyJpg:Class
public static var MyJpg:Sprite = new $MyJpg();
 
[Embed (source="assets.swf", symbol="myPNG")]
private static var $MyPNG:Class
public static var MyPNG:Sprite = new $MyPNG();
}
}

*Even though I Embedded the “myMovieClip” symbol as a Sprite, the animation this movieclip contains is still.. “animated” :)

Next Loaded assets from FLA:

In this case, because we will load the swf library which carries all our assets after the initialization of our app the least we can do it to be sure that the whole swf has been loaded and then start using its symbols.

On the FLA we need a function on the first frame in order to make it capable of talking to our Flex Builder – AS3 code.

It looks like that:

function getInstance( id:String ):MovieClip
{
 
switch ( id ) {
case "myMovieClip":
return new myMovieClip();
case "myJpg":
return new myJpg();
case "myPNG":
return new myPNG();
default:
return new MovieClip();
}
}

This function will be called from our project and all it does is to return one of the library objects so make sure the objects exist on library and have linkageID.

This time since we wont embed anything, the only files that we need in Flex Builder is the main one called RuntimeFlashLOADED and of course the assets.swf.

This is the code:

//LOAD AT RUNTIME

package {
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
 
[SWF(backgroundColor="0x000000", frameRate="60", width="900", height="600")]
 
public class RuntimeFlashLOADED extends Sprite
{
private var _loader:Loader = new Loader;
public function RuntimeFlashLOADED()
{
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.INIT, swfLoaded);
_loader.load(new URLRequest("assets.swf"));
}
 
private function swfLoaded(evt:Event):void
{
var sav:MovieClip = MovieClip(evt.currentTarget.content).getInstance("myMovieClip");
addChild(sav);
}
}
}

So first we load the swf and when its fully loaded we can call the getInstance() function which lives on the assets.swf !

Flex Builder is way much better in coding AS3 than Flash IDE. Flash IDE is way better for animations, drawings and organizing our visual-audio elements than Flex Builder.

We love them both so why not using them both?

* I promise to use a code colorer plugin soon :)

MTVGreece widgets!

February 22nd, 2009 | No Comments | Posted in Actionscript

I’ve build 2 widgets for Mtv Greece but I didn’t had the time to blog about them so far..
The first one is for my beloved Twitter and the other one is for music.

The twitter widget looks like this:


(you can click on the image to see it)

Special thanks to Paulius Uza for his help on this and especially for the server side which caches the tweets so we don’t have to mess with Twitter’s API limitations.

The radio widget looks like this:


(you can click on the image to see it)

It streams Live Radio from Mtv Greece through Akamai.
On this one I use Ben Stucki’s amazing audio visualizer.

On the demo below the widget plays an mp3 which is located on my server.  The reasons for this are two. The 1st one is because I have no idea if I am allowed to and the 2nd is because I wanted to present the widget on this post as it was originally ment to be. Unfortunately on the live version of this widget, which you can see on MTVGreece.gr, the visualizer is turned off because I get this security violation error. I guess this is because Ben is using the computeSpectrum to read the audio (and create the beautiful visuals) and since this is stream I probably need a crossdomain policy file (right?).

I have to make another post some time for the Akamai Stream – Flash Player communication because there is not much information out there..

Anyway you can click on the visualizer to change mode, all credits for this goes to the man, Ben Stucki and if any error occurs you can blame me. :)
Thanks a lot for sharing your beautiful work Ben.

Oh did I mention that both of them are pure AS3?
No?
Ok both of them are pure AS3 projects!

A nice guy wants to get into my house from my Adobe window (aka Octoshape Grid Delivery enhancement)

December 20th, 2008 | 1 Comment | Posted in Flash Player

After a week or so bookmarked and in between another post I’m preparing (finally a bit technical) I’ve finally found some time to read the very informative post from Flash Magazine about “Plugins for the.. Flash Player“.

It was a few weeks ago when I visited this page on CNN in order to watch a video and suddenly I got a message that looked like that:

I have to admit that I’m not that expert in Flash (Im learning..) but of course I have the latest version installed on all macs @ home (yes my bros’ and parents’ mac on the island too) and my love to the platform is GIANT(wow what a word..). So as you can imaging I was sitting speechless in front of my beautiful Cinema Display wondering.. How did I miss a Flash Player update..?? Then I read the text on the express installation dialog box and I was again like Jack on LOST.. What is this? Where am I? Who are the others? Who is responsible for this and of course what should I do? I mean ok its just the express installation window but what is Octoshape Grid Delivery (which has a beautiful name btw)?

I almost immediately asked my best friend, Twitter, about that. – Don’t worry its ok to call Twitter my best friend as the real ones think that Facecook.. oops Facebook is THE web so.. – @UnitZeroOne reply to me about it and so I almost felt a bit calm.

It is obvious that Flash baby Player uses the express install for installing not only updates for him self but other Adobe goodness but this time was different.. Software for another company wanted to enter my house from my Adobe window. You get the point..

Anyway as you can guess I installed it and then I enjoy CNN but today I read the Flash Magazine’s post and I would like to mention it here just in case anyone else was “terrorized” by this.

A few lines that I would like include here from the original post are:

“Octoshape is developed maintained by a Danish company, located in Copenhagen. The software allows anyone viewing a video stream re-distribute it as well, as part of a Peer to Peer (P2P) network. Everyone that views the stream also offers the stream to other viewers and this offloads the central streaming server allowing for more users as well as huge savings in bandwidth costs. This is not a opt-in solution. If you have the plugin, you are part of the “grid” that broadcasts the stream. The Octoshape add-in for Flash Player will terminate itself about 5 seconds after the flash player has been closed/stopped, so it won’t be a node other than when you use it”

Really fancy, I have to admit!

Laurel Reitman, Sr. Product Manager of Flash Media Server Services asked to FM like that:

“As part of the effort to improve the experience of live events, we have started a technology trial to test grid delivery technology.”

This is great as an idea and technology but I don’t get how the word “trial” fits next to the express installation feature of Flash baby Player. I love Flash Player and Adobe, even more that the fruit company but man this sounds sooo weird. I have to say that I have the debug version so I don’t know if the release version is getting the installation box (but I think it does). To be fair I have to say that Laurel also mentions that:

“Flash Player Express Install functionality is not a general purpose installation mechanism. It is used to distribute Adobe software, such as the developer-initiated player update, Acrobat Connect, and the AIR badge installer, and for security reasons all packages must be digitally signed and delivered from Adobe servers. The Octoshape add-in is delivered during the trial as part of a strategic partnership to test the technology as a way to enhance the live video experience. We have no plans for any further distribution of third party software through the Flash Player.”

I really hope so. I love the baby player so much to see it being accused for problems especially when it’s not related to it (and that is unfortunately already happening for a lot of things).

Anyway the post is really worth reading it because there are more useful information there and for the psycho funs out there you will be able to read the Macromedia word a few times in there. ;)

And YES, it still sounds THAT amazing!