Friday, September 29, 2006

LFPUG September meeting


Stephen Downs did it again!
thanks Tink! it was a great meeting last night.
Was great to catch up with the flash geeks, all these cool people who come every month or so to these presentations.
This time, Daniel and me took a bus from work and in less than 15 minutes we were at the place just on time for Rich's fabulous presentation on Flash Lite 2.
Couple of beers later we had another good presentation, Johannes Nel gave us an introduction on binding data on flex.
More beers later and under the lovely London's rain I got home at around 2am.
When I left the pub after 1am, the guys were still there...
oh God! these meetings are dangerous!

btw, I'm just testing Google Video; a new camcorder is arriving soon so hopefully the next meeting video will be much better.

Salut!

Skypeweb bug


Reading the SkypeWeb developer notes, I have confirmed that only and if only I have my computer on, the SkypeWeb server will be able to get my status and then will create the respective XML, image and text.
I think is a bug because from my point of view, my computer doesn't need to be on to allow the SkypeWeb servers to detect my status.
why?
well, the XML I'm using to get my online status and show it in a flash movie, is created "upon request" but if the computer is off, the SkypeWeb server can not create any XML as no data was collected from my computer, therefor it returns an old XML, the last one generated that might be wrong.
I'm wondering why is not created in such way that if no data is retrieved then generates an XML showing the "offline" option...

Thanks to altrove and chespi for their feedback and help on this matter.
And please guys at the Skype forums, do you mind confirming this issue?
Is Skypeweb still beta?

salut!

Sunday, September 24, 2006

Flash is following me!


call it paranoia, coincidence or big brothers eye!
The other day my partner and me went for a walk and just down the road we found this lovely pub. What do you think was the first thing in my mind?
oh God! so many years in love with this tool and I can still remember when the pink colour was associated with flash, 4 and 5...
So, for me, that's the flash logo and is staring at me!

Friday, September 22, 2006

Connecting two Flash Movies

The idea of this post is to explain the basic on how to use the class LocalConnection that helps us to communicate two different flash movies on the same html page.
Steps:
- Create a new flash movie and call it "my_sender"
- Create a button on the stage with instance name "my_btn"
- First frame actionscript:

function my_function(my_parameter:String):Void {
var my_lC:LocalConnection = new LocalConnection();
my_lC.send("test_LC", "change_copy", my_parameter);
delete my_lC;
}
my_btn.onRollOver = function() {
my_function("You are rolling over a button on another SWF!")
};
my_btn.onRollOut = function() {
my_function("Rolled Out");
};

I have a function with a string as a parameter and inside I'm declaring my localConnection and sending three parameters:
- the name of my localConnection (test_LC)
- a method name
- the name of my parameter
I'm calling my_function when rolling over and out my_btn but my_function can be called in any other event.
That's it! save, publish and put on an html page.

Next steps:
- Create another flash movie and call it "receiver"
- Create a dynamic text field with instance name "my_copy"
- Add the following actionscript on the first frame of the main timeline:

my_copy.text = "This is a dynamic text box"
var my_lC:LocalConnection = new LocalConnection();
my_lC.change_copy = function(my_parameter:String) {
my_copy.text = my_parameter
};
my_lC.connect("test_LC");


Put a string to show on my text field on load so we know where the text box is;
Add an instance of the localConnection class with the variable "my_LC".
Then I use the parameters sent by my first movie to give a new value to my_copy;
And connect to the "localConnection" created.

That's it!
See the example below:







Second Movie





The localConnection class can be very useful and can help us for instance with the flow when loading different flash movies on the same html page, we can start loading another movie as soon as the first one has finished loading.

Salut!

Tuesday, September 19, 2006

Add to Technorati favourites Flash button


Playing again a bit with flash and after my "add to del.icio.us" flash button I've done an "add to my Technorati favourites" flash button.
It can be used on any website, you just need to put the following script where you want the button to be shown:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="technorati" width="100" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" height="50" align="middle">

<
param value="always" name="allowScriptAccess"/>
<
param value="http://overloadstudios.co.uk/ewa/technorati.swf" name="movie"/><param value="high" name="quality"/><param value="transparent" name="wmode"/><embed pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" allowscriptaccess="always" align="middle" type="application/x-shockwave-flash" height="50" src="http://overloadstudios.co.uk/ewa/technorati.swf" width="100" wmode="transparent" name="technorati"/>
<
/embed></object>

The only thing I don't like about these "add to my favourites" buttons from Technorati is that they open the link on the same page and if you don't want to add the blog, you don't come back to the blog itself but to your technorati account.
Anyway, I might change the graphics later.

Salut

Friday, September 15, 2006

Flash Skype Status - Part III


My friend Sebastian Recabarren pointed me out a little problem about my Skype Status flash widget. He asked me who was lying or his Skype or my blog.
Browser's cache memory!
I though this problem was only when the user goes online through a proxy server, which keeps everything in its cache, but seems like flash always takes the image from the browsers cache even if there is no proxy server in between.
To avoid this problem, we can use an XML provided by SkypeWeb instead of loading the image.
The XML is available from:
http://mystatus.skype.com/userID.xml

That data is easy to pull from flash and then show the right status attaching the right movieclip.
What I did is, instead of

image01.loadMovie("http://mystatus.skype.com/smallclassic/yourID");

I'm loading the XML as follows:

function loadXML(loaded:Boolean):Void {
if (loaded) {
xmlNode =
this.firstChild;
my_status = xmlNode.childNodes[0].childNodes[2].childNodes;
attachStatus();
}
else {
trace("XML not loaded!");
}
}
xmlData =
new XML();
xmlData.ignoreWhite =
true;
xmlData.onLoad = loadXML;
xmlData.load("http://mystatus.skype.com/myID.xml");
function attachStatus():Void {
image01.loader_mc.attachMovie(my_status,"status",1)
}

I have added 6 movieclips showing the different possible status, each of them have a linkage identifier name depending on the status. To add an identifier to a movieclip just right click on it (in the library) and select "linkage properties", tick the "Export for actionscript" option and change the identifier to its equivalent skype status, ie: Not Available
Voila!
Testing locally everything works fine.
But, as usual when debugging, there is a new problem: cross domain policies.
Due to security reasons, any online flash application cannot load data from a different server and my experiment doesn't work online.
My mate Stephen Downs (Tink) pointed me out the solution:

It is possible to get round the sandbox by loading the XML into some PHP or something on your server and then loading it into Flash from there. Tricks the player into thinking your serving it


and my colleague Thomas Van Steenwinckel gave me a hand with the php and together we put the following script on my server:

<?
header("Content-type: text/xml; charset=utf-8");
$filename = "http://mystatus.skype.com/myID.xml" ;
$dataFile = fopen($filename, "r" );
if ( $dataFile )
{
while (!feof($dataFile))
{
$buffer = fgets($dataFile, 4096);
echo $buffer;
}
fclose($dataFile);
}
else
{
die( "fopen failed for $filename" ) ;
}
?>

Now on flash I'm loading the XML created by this php instead of the one provided by skypeWeb and my blog shows the right status of my Skype account.
Nice way to get rid of the cross domain issues.

PD: Just in case, remember to update to the latest Skype.

Salut!

-- IMPORTANT UPDATE --
Part I
Part II
Free Skype Status Flash Button

and the latest one of this series:
Easy Skype status in Flash
---------

Thursday, September 14, 2006

Free add to del.icio.us Flash button

I've changed the actionscript on my "add to del.icio.us" flash movie so now it takes the title and the web address from where the flash movie is embedded into.
For example, if you go to http://tinosrestaurant.co.uk you can see that they have embedded my "add to del.icio.us" flash button and when clicking it, it opens the usual "tag this page" pop-up window from del.icio.us...
If you want to put it on any of your websites, just add the following script where you want the button to be shown:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="delicious" width="100" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" height="50" align="middle">

<
param value="always" name="allowScriptAccess"/>
<
param value="http://overloadstudios.co.uk/ewa/delicious.swf" name="movie"/><param value="high" name="quality"/><param value="transparent" name="wmode"/><embed pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" allowscriptaccess="always" align="middle" type="application/x-shockwave-flash" height="50" src="http://overloadstudios.co.uk/ewa/delicious.swf" width="100" wmode="transparent" name="delicious"/>
<
/embed></object>

If in case you want to create your own flash del.icio.us button, follow the instructions on my previous post.

Monday, September 11, 2006

Flash add to del.icio.us


The usual way to have the "add to del.icio.us" option on a website is using html calling a pop-up window with the "post" page from del.icio.us passing a couple of variables to help filling in the form.

Using flash is the same, is just a matter of calling a pop-up and passing the value of the variables...
As you can see on the example on the right side of my blog, when pressing the del.icio.us flash button, it opens the "post" page with two text boxes already filled.

What I did is:
- Created a button on the stage with instance name "add2delicious" and on another layer put the following actionscript:

add2delicious.onPress = function() {
getURL("javascript:void(window.open
('http://del.icio.us/post?url=http://overloadstudios.blogspot.com
&title=Ernesto Quezada s Blog','popup','toolbar=no,
location=no,status=no,menubar=no, scrollbars=no,resizable=no,
width=700,height=400'))");
};

- Publish your swf for flash player 7 as for flash player 8 the pop-up just doesn't work;
and that's it!
I had to take out the single quote in "Ernesto Quezada's Blog" as the single quote is a restricted character on this script.

Salut!

Friday, September 08, 2006

Flash Skype Status - Part II



Ok, now I've got my Skype status shown on my website but... what?
does anyone know my Skype ID? can anyone then call me? or at least start a conversation with me?
Yes they can, we need to add only a couple of lines to our actionscript to allow people to interact with us, if we have the latest Skype
There is one limitation, we have no control on the image as it comes from the Skype server so we can't add animation...
well, actually we can!

What I did is, I created another movieclip inside of my already existent "image01" movieclip and called it (instance name) "loader_mc".
If we want our movieclip to move 1 pixel when the mouse is over, we need to update our script as follows:

image01.loader_mc.loadMovie("http://mystatus.skype.com/smallclassic/myID");
image01.onRollOver = function() {
this._y += 1;
};
image01.onRollOut = function() {
this._y -= 1;
};

and if we want an event to happen when the user clicks on the icon, we just add:

image01.onPress = function() {
getURL("skype:myID?chat");
};


so people can have a chat with me through Skype if I'm online or leave a message if I'm not.
There are more options and all of them are explained on the Advanced Skype Links.

Hey! there are many things to experiment with using Skype and Actionscript, just go for it! for example, I added a sound and a little colour effect when rolling-over.

By the way, if anyone reading this knows of any colour syntax plug-in for blogger, please let me know!

Salut

-- IMPORTANT UPDATE --
Part I
Part III
Free Skype Status Flash Button

and the latest one of this series:
Easy Skype status in Flash
---------

Wednesday, September 06, 2006

Flash Skype Status - Part I



The other day, reading my mate Elmer Zinkhann's blog I noticed he has a little Skypes icon showing his status.
I went to the Skype's website and after following a couple of links and adding a bit of my creativity, I ended up with a little flash that shows my status and allows you to start a chat with me if I'm online or leave me a message if not.
What I did is as follows:

Apart from being sure you have the latest SKYPE installed,

- First, allow your status to be shown on the web, following these simple instructions.
- Then select the look the button will have using the skype buttons wizard.
- When getting the code, paste the javascript bit on the html page that has the swf embeded
- The image address is what you will use in flash to show your status.
- Create a very small new movie in flash, mine is 120 x 50 pixels.
- Create a movieclip and give it an instance name, ie "image01".
- In the first frame of your movie add the following actionscript:

image01.loadMovie("http://mystatus.skype.com/smallclassic/yourID");

And that's it!
of course, you will change the image address you got when using the skype buttons wizard.
Upload your swf to your server and embed it into the html page you need to display it.

Bear in mind that if you are behind a proxy, the image will not update properly as flash loads the image from the cache.

Salut!

-- UPDATE --
Part II
Part III
Free Skype Status Flash Button

and the latest one of this series:
Easy Skype status in Flash
---------

Friday, September 01, 2006

4 years in London!

Barajas Airport, Madrid - 1st September 2002. I had two airplane tickets in my hands, one to go back to my country El Salvador and another one to continue my adventure in Europe.
The idea was to come to England just for 6 months to learn English so I took the plane to Gatwick Airport and kept the other ticket in my pocket.
2 and a half hours later I was on a train from Gatwick to Victoria Station, Central London...
So, I've been here in London for exactly 4 years now and just because I'm still learning English, I'm still in England!
Well, actually is because of my girlfriend, she thinks my country is a bit too far, so we have decided to settle down here.

salut!