Archive for the ‘Flash AS3’ Category

Youtube chromeless player example

Monday, August 16th, 2010

I’ve just added an example youtube chromeless player to my site. I have to say I was really surprised at how easy it was to convert one of my existing players that used netstream and convert it over to play youtube stream instead. You can see my example here: http://www.innovativedesigns.org.uk/#/Video gallery/

The chromeless youtube player comes without any controls but the options are there to go ahead and add your own controls as I did.  I am using the AS3 API for this. I will also be making a sample source available very soon.

More information about the chromeless player can be found here: http://code.google.com/apis/youtube/flash_api_reference.html

Google map flash api guestbook

Thursday, March 18th, 2010

A few months back I had a play around with the Google map flash api and built this guestbook, another example of it can been seen here.
Well I’ve not had a chance to go back and tie of some loss ends on the guestbook map though it works perfectly well.
There is 3 things that would make this complete
1. Marker clustering
2. Geocoder, some kind of quick find me button
3. Update marker position with the edit feature.

I think if you are proficient in flash AS3 you should be able to get these done in no time.
With so many other things to get on with I’ve decided to make the source available for download :) .

Included are:

  • Flash 9 Flash File
  • Caurina tweener classes
  • kharon4a_mini font
  • index.html
  • guestbook.swf
  • AC_RunActiveContent.js
  • map.php
  • common.php
  • but.as
  • gMapEntry.as
  • gMapForm.as
  • guestbook.sql
  • help.html

Font(s) used:

  • kharon4a_mini

http://www.orgdot.com/aliasfonts/

Features include:

  1. Email notification upon someone signing the guestbook
  2. http check for urls in comments and web address fields
  3. badword filter check. Replaces bad word if found in an array of word to filter to ****
    $changeto = ‘****’;
    $message = str_replace ($badwords, $changeto, $message);
    return $message;
  4. CMS Feature that allows you to edit/delete any of the submissions
  5. Map will stretch to fit available screen size

All the information to get you setup and running can be found in the help file included.
The guestbook requires a server running php+mysql

Innovativedesigns V0.4 goes live

Monday, March 1st, 2010

It’s only taking just under a couple of years. A lot of start stop and restart. Finally I can say “Damn it I am done!” :)

Yes it was about this time 2 years ago that I decided I would take the leap and start learning/using AS3. I did have 8 years of prior code experience with AS1 and AS2 but AS3 would be a whole different ball game. As it turned out it wasn’t that bad. Once I discovered how things I took for granted in AS2 where done in AS3 things got a lot easier. I am now at the stage where if something doesn’t work then it usually doesn’t take long to figure it out or find some other way of doing it.

There is still so much to learn and I don’t doubt for a second that version 4 code have been coded better but hey it runs error free and dose what it is supposed to do.

Version 4 has lost some sections and gained some new features. I wont bother going through them all you can just visit the site and check it out.
I have to say a special thanks to Richard Leggett and Michael Lawrence (byteface). Both these guys where on hand to give help and advice when I asked  for it and without them I would not got to the point I am at now.

I do plan to continue adding new sections and features to the site. I’ve already started working on a new section when done will hopefully see a nice little shopping cart where i can sell my flash files from.

So go visit my new flash site and sign my guestbook and possibly leave some nice comments.

Trigger Javascript functions from Flash AS3

Thursday, February 4th, 2010

Using the ExternalInterface in AS3 it’s never been easier to trigger Javascript functions on your page that holds your swf.
Previously with AS2 and below We would have used the getURL(“javascript:yourFunction();”) or
fscommand(“messagebox”, “Message box called from within Flash.”)

I was asked on the forums today how this would be done in AS3.

After quickly looking up ExternalInterface in the flash Doc’s I was able to through together a quick working example.
A working example can be seen here.

Here is the code:

// import classes we need
  1. import flash.external.*;
  2. import flash.net.*;
  3. //Make sure buttons show mouse over
  4. but1.buttonMode=true;
  5. but2.buttonMode=true;
  6. but3.buttonMode=true;
  7. //Added mouse event to buttons
  8. but1.addEventListener(MouseEvent.MOUSE_DOWN,triggerJavascript,false,0,true);
  9. but2.addEventListener(MouseEvent.MOUSE_DOWN,triggerJavascript,false,0,true);
  10. but3.addEventListener(MouseEvent.MOUSE_DOWN,triggerJavascript,false,0,true);
  11.  
  12. //Function to be triggered by mouse event
  13. function triggerJavascript(e:Event) {
  14. //check name of button pressed
  15. switch (e.target.name) {
  16. case "but1" :
  17. //open url in fixed size popup
  18. ExternalInterface.call("openPopup", "http://www.innovativedesigns.org.uk");
  19. break;
  20. case "but2" :
  21. //open url in new window
  22. ExternalInterface.call("openURL", "http://www.innovativedesigns.org.uk");
  23. break;
  24. case "but3" :
  25. //trigger javascript alert box
  26. ExternalInterface.call("triggerAlert", "Alert was triggered from Flash");
  27. break;
  28. }
  29. }

Google flash maps api guestbook

Thursday, June 18th, 2009

When I get the time I am trying to learn what I can of AS3. Over the past couple of months I’ve been messing around with the google flash maps api.

Initially I was a bit overwhelmed with it but I have stuck with it and built a simple guestbook system that use’s mysql+php on the back end.

Features include:

  • Custom controls
  • Custom icons
  • Custom markers
  • Custom infoWindow
  • Email notification of someone signing the guestbook
  • Bad word filter
  • http check on submitted url’s
  • Custom right click menu
  • Fullscreen toggle

Newly added features :22/05/09

  • Quick zoom //  Zoom in on point
  • Map Settings panel
  • Enable/Disable mouseWheel scroll
  • Enabled/Disable map mouse click zoom
  • Hide/Show map types panel
  • Hide/Show map zoom panel

And to tie it off I have also added a simple admin feature that allows use to edit/delete submissions to the guestbook.
You can login to the admin system by pressing CTRL+SHIFT this will bring up the login window. username:admin, password:admin

I just have a couple of things I want to get done before I move onto my next map experiment. Please feel free to let me know your comments.

View/sign the simple guestbook system

The source for this guestbook is now available for download from here.