Posts Tagged ‘AS3’

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

The time has come to properly learn AS3

Thursday, July 17th, 2008

So there was me in between projects getting my feet wet with AS3 when i am told “We need to know AS3 for the next project!”.

So here we go…
Books i am currently reading.

actionscript 3 cookbook
Actionscript 3.0 Cookbook
Review: Not done yet

Object-oriented Actionscript 3
Object-Oriented Actionscript 3.0
Review: Not done yet

Learning Actionscript 3
Learning Actionscript 3.0
Review: Not done yet

Advanced Actionscript 3 with Design Patterens
Advanced Actionscript 3 with design patterns
Review: Not done yet

I will probably post reviews on these books as i go through them and get and better understanding of AS3.

My method of reading has been to read through required topics in each book rather than the cover to cover method.

I have already posted some basic working examples already here on the blog that work with having your code on the timeline (AS2 method of coding). I have never done flash work before that involved classes and packages but from what i have read so far I can now look at my personal flash site and see the greater benefits of using/learning AS3.

The main reason for the blog entry more than anything else is so that i can look back in a couple of years and think about what i have learned from these books in this time and think how i have developed as an AS3 developer. Obviously i will be submitting AS3 examples over time to the blog.

First partial look at my converted AS2 to AS3 flash tracking system

Thursday, January 31st, 2008

As mentioned in my first entry I have started to mess around with AS3.
I have to say that the first couple of days i would have expected to be the hardest but not atol. As soon as i saw the new way i would normally do ‘x’ it was easy.

An example of how i would load data into flash AS2 from a php script

  1. function login() {
  2. if (txUser.text.length == 0) {
  3. txError.text = "** Username Required **";
  4. } else if (txPass.text.length == 0) {
  5. txError.text = "** Password required **";
  6. } else {
  7. mcLogin._visible = true;
  8. mcLoader._visible = true;
  9. result_lv = new LoadVars();
  10. log_lv = new LoadVars();
  11. log_lv.user = txUser.text;
  12. log_lv.pass = txPass.text;
  13. log_lv.sendAndLoad(phpPath+"login.php"+secureVar(),result_lv,"POST");
  14. result_lv.onLoad = function(success) {
  15. if (success) {
  16. if (result_lv.retval.length) {
  17. mcLoader.dataLoaded = true;
  18. } else {
  19. trace("error:"+unescape(data_lv));
  20. }
  21. }
  22. };
  23. }
  24. }

Now with AS3 we have

  1. function login() {
  2. if (txUser.text.length==0) {
  3. txError.text = "** Username Required **";
  4. } else if (txPass.text.length==0) {
  5. txError.text = "** Password required **";
  6. } else {
  7. var variables:URLVariables = new URLVariables();
  8. variables.user = txUser.text;
  9. variables.pass = txPass.text;
  10. var request:URLRequest = new URLRequest();
  11. request.url = "login.php";
  12. request.method = URLRequestMethod.POST;
  13. request.data = variables;
  14. var loader:URLLoader = new URLLoader();
  15. loader.dataFormat = URLLoaderDataFormat.VARIABLES;
  16. loader.addEventListener(Event.COMPLETE, completeHandler);
  17. mcLoader.visible=true;
  18. mcDisable.visible=true;
  19. try {
  20. loader.load(request);
  21. } catch (error:Error) {
  22. mcDisable.visible=false;
  23. mcLoader.visible=false;
  24. txError.text="Unable to load URL";
  25. }
  26. function completeHandler(event:Event):void {
  27. restString = "Welcome back <span style="color: #990000;">"+txUser.text+"</span> You were last logged in:<span style="color: #990000;">"+event.target.data.welcomeMessage+"</span>";
  28. //
  29. gotoAndStop(2);
  30. }
  31. }
  32. }

In order to see the flash stats app working you need to first login with usename: client passowrd:client

This application is still work in progress and i am only tracking entry clicks at this point. Though work has started on registering clicks within flash. I should give a thanks to Jason at moogleMedia.com for helping me get a head start on this.

The first entry

Thursday, January 31st, 2008

Well here it is the first entry to my new blog.

What better way to start then to complain about the problems i am having with the new components availble in CS3.

Iv’e been using CS3 for a few months now and it never occured to me to checkout the improvements that have been made to the components set. I was really surprised to see that skinning of the components has been made so much easier. So much easier that i spent a couple of days converting one of my apps to AS3. All was going soo well then i noticed that some of the text within the cells was being aligned to the top and not centered to the cell like the others. Well second day in and i am know further forward. I do remain optimistic that i will find what the problem is.

See the image below you notice that some of the country names are not aligned to the center.datagrid text alignment bug