Facebook style Flash interface

by Leon on August 18, 2008

Here is my latest offering of notification alerts to Flash – a Facebook style pop up window that supports basic html formatting.

It seems that the power of Facebook is everywhere (just take a look at flCodr [try clicking on the download link]- its using the Facebox javascript code to create modal dialoge boxes).

I couldn’t resist creating my own version just for Flash. This one is a simple AS2.0 version that uses the tween and easing classes to add a bit of animation aswell.

Take a look at it here and come back for some info about how it works.

Setting it all up

When you open up the .fla you will see the following code on the actions layer:

stop();

#include “copyright.as”
#include “fb_actions.as”

createFeedbackPopUpBox(“Facebook style pop up winodw”,65,82,”This is a nifty little Facebook style pop up window for your Flash applications that is really simple to implement!!<br><br>It even supports basic HTML such as <b>bold</b> and <ul><li>Unordered lists</li></ul>”)

The first include is the copyright notice and must be kept intact. If I see anyone using it online without the notice I will hunt you down and kill you (not literally, but I will be really pissed off!!). This script basically replaces the right click context menu and replaces it with a link back to this site. You can find more scripts for protecting your swf’s over at flCodr.

The second include contains the function’s that allow the thing to work. I could go through everyline but its pretty straighforward. The box is positioned according to the values passed into the function, the box is faded from 0 to 100% alpha, once the fade is completed the text is added.

To remove the opposite process is followed and the box is placed off the screen.

Arguably I could have used the attachMovieClip  and removeMovieClip functions, but this is much simpler, quicker and eaiser.

Making it happen

To make the popup box just call the following function:

createFeedbackPopUpBox(title,xposition,yposition,bodyText)

title – This is the title that gets displayed, contained within quotes. it could easily be a variable name – just loose the quotes.

xposition – The X position of the window on the screen

yposition – The Y position of the window on the screen

bodyText – The string (requires quotes) or variable name that should be displayed as the body text, It can contain basic HTML such as bold, un-ordered lists and hyperlinks.

Thats it – nice and simple.

Grab the files here!

Leave your comment

Required.

Required. Not published.

If you have one.


Additional comments powered by BackType