PDA

View Full Version : Just Finished! Alert Component Class


Sleeve
07-24-2006, 11:21 PM
I couldn't believe that the built in Alert component was 80k+ in Flash 8 so I build my own at only 4k!

The entire Component is built using AS 2.0 and the drawing API for all graphics, gradients, buttons and more.

Some key features include:

1. Build in styles manager supports any and all text formatting with setStyle(name:String, style:Object).
2. Modal and nonmodal support.
3. Supports any number of buttons with labels of your choice.
4. Alert width is setable. Button width and height is setable.
5. Alert Height adjusts automatically based on message length and button height.
6. Designate a listener function which is passed a button ID param by the Alert class to easily identify which button is pressed.
7. Draggable with framerate independent motion.
8. Tab supported buttons.
9. 100% AS based, nothing to drag on stage!
10. More.

Class and example .fla attached.

Any comments or questions are welcome!

MichaelxxOA
07-24-2006, 11:25 PM
Seems pretty cool, I messed with it for a bit :P

Good job, thanks for the contribution.

Michael

Sleeve
07-24-2006, 11:40 PM
I built a ComboBox that filters the contents as you type too. Built much the same way and inspired by the autocomplete textfield function that someone built...

1250 lines of code without comments. Only 13k! I should post that one too after I comment it.

baigorri
08-11-2006, 04:14 PM
Very cool

good work

jfbaro
06-06-2007, 04:22 PM
Hi Sleeve

I am trying to use your Alert component, but I need to make it work on FP7.

I made some really simple changes (most of them are simple comments).

It works, but the look is awful now.
And also I have to click in the TEXT to make the button work...not good

I am really new to Flash, so I would appreciate if you could help me with that.

Cheers

Sleeve
06-06-2007, 04:42 PM
I may be wrong but I think the FP7 doesn't support filters. That may be why it looks terrible. Why do you need it to play in FP7?

jfbaro
06-06-2007, 06:35 PM
Hi Sleeve,

Thanks for replying! :)

I've made some really "crap" changes on it (even hard coded colours.. Jez!!), just to make it works, but my changes don't fit with your code. The look is still not good though!!

We run Flash on embedded devices, where FP7 is the only option.

I am sending you the code I've changed...please don't shout at me...;)

I know the changes I made are crap, but I was just playing with the code in order to try to understand it.

THe problems I had were:

No gradient: Partially soved;
Button not changing in any of its events (over, press...) it looked like an static image; (Working now, but crap code)
Unable to change colour for the header;

Your code looked really nice to me and I would like to keep the same standard, but due my lack of knowledge with AS (also lack of time) I couldn't make it right. Sorry about that.

Thanks

jfbaro
06-07-2007, 06:19 PM
Hi Sleeve,

If you have a chance, could you please check the changes I made.

I think it will be pretty easy for you to solve it.

Sorry for bothering

Thanks

jfbaro
06-12-2007, 12:19 PM
Anyone?

scott_euser
03-12-2008, 06:23 PM
Hi Sleeve,

Thank you very much for the class- very well done! Solves some annoying problems with the Alert class as well!

Is it okay to use this in a project I am working on? Im not sure how things work with "intellectual property" on actionscript.org etc...

In any case, thanks again!

Scott

Sleeve
03-12-2008, 06:35 PM
Hi-

This class is free for you to use however you like. It's open source as far as I'm concerned.

Sleeve