Archive for the ‘Flash’ Category

20
Apr

paypal enabled mini mp3 player

Posted By wassim in Flash

An XML driven slick mp3 player with playlist support and paypal as payment gateway, the look and feel is clean crisp and WEB2.0.

The player displays album art and a nice spectrum analyzer animation and comes with two skins, the black and white ones.

Here’s a preview of the players, click to see them in action:

23
Feb

actionScript AS2 (typewriter) text effect

Posted By wassim in Flash, Flash Tutorials

I needed a typewriter text effect with a twist for an mp3 player I was making, looked around and could not find one that suits my needs so I wrote this class, should do the job.

Actionscript:
  1. /*
  2. @author = Wassim Sidani
  3. @www.sidani.info
  4. usage example:
  5. var tE:TxtEff=new TxtEff(textFieldInstance, textToWrite, delay);
  6. textFieldInstance= a reference to a text field.
  7. textToWrite= the actual text that will be typed in the text field.
  8. delay = dealy in milliseconds before writing next character;
  9. */
  10. class TxtEff extends TextField
  11. {
  12.     function TxtEff (me, txt, delay)
  13.     {
  14.         //clearInterval(myInt);
  15.         //clearTimeout(myOtherIn);
  16.         myClass=this;
  17.         inite (me, txt, delay);
  18.     }
  19.     function inite (me, txt, delay)
  20.     {
  21.        
  22.         var j : Number = 0;
  23.         chars = ['$', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', ' '];
  24.         var initialText : String = txt;
  25.         for (k = 0; k <txt.length; k ++)
  26.         {
  27.             me.replaceText (k, k + 1, '-');
  28.         }
  29.         var myInt : Number = setInterval (go, delay, me);
  30.         function go (me)
  31.         {
  32.             //trace('goo is called and me.text ='+me.text);
  33.             if (j <initialText.length)
  34.             {
  35.                 //trace('j is ' + j+" and chars.length is "+chars.length);
  36.                 for (var i = 0; i <chars.length; i ++)
  37.                 {
  38.                     if (initialText.charAt (j) == chars [i])
  39.                     {
  40.                         me.replaceText (j, j + 1, chars [i]);
  41.                         j ++;
  42.                         break;
  43.                     }
  44.                 }
  45.             } else
  46.             {
  47.                 clearInterval (myInt);
  48.                 trace ("done j=" + j);
  49.                 //myOtherIn=setTimeout(myClass.inite,3000,me,txt,delay);
  50.             }
  51.         }
  52.     }
  53.    
  54. }

13
Jan

Flash shopping cart

Posted By wassim in Flash

The best flash shopping cart you've ever seen!

The flash cart supports multiple categories of products; it is driven by XML or a mySQL database.

The flash shopping cart was designed with usability in mind, it loads and is ready to go in less than 10 seconds! Faster than html or php based carts!

User friendly, highly flexible, lightweight (around 120 kb!) and a cool web 2.0 design are not the whole deal, there's more, a lot more!

Seamless paypal integration, the purchase is itemized and you get to see the details about each item in the paypal interface.

The merchant paypal account is easily customizable; you can set the paypal address, currency, thankYouUrl and cancelUrl.

The mySQL version is equipped with an admin panel that makes cart management, including thumbs and full size pictures upload a breeze even to non techy users.

This flash shopping cart is robust, it supports a variety of formats, can display jpg, png, gif and even swf pictures (both thumbnails and sull size pictures) of your products. It's simply an all-in-one solution.

A demo of this flash shopping cart is available here.

23
Dec

Flash scrollPane component scrollbar not showing up

Posted By wassim in Flash, Flash Tutorials

This fix applies to flash 8 scrollPane component v2.

Here's the problem: you attach content dynamically at runtime to your scrollPane, then much to your surprise, the vertical scroll bar doesn't show up despite the fact that you specified vScrollPolicy as "on" or "auto" and that the content is larger than the scrollPane.

You probably know the problem that's why you are here! Google dropped you in the right place, I have found a solution! A working fix.

After searching for two hours, and trying all the suggested workarounds like calling the redraw() method on the instance or the onComplete(), doLater() or even the invalidate() method, none of these worked, I even tried lowering the frame rate of the movie but all this ended up failing so I started experimenting and I found the following:

If you change the position of the content clip inside your scroll pane component, the scroll bar will fail to account for this change, it might even not appear in the first place, if you add content dynamically, like attaching a movieClip from the library on runtime, you will also face issues with the scroll bar.

What I did to solve the issue and debug is that I simply called the setSize() method twice, in the first call, I assigned a height higher than the desired one then in the second call, I assigned the desired height and this worked ! the scroll bar of the scrollpane now appears and behaves as expected.

Note that this fixed the case where the content is being attached from the library, not loaded externally.

 

4
Dec

Flash Player cache and smaller swf files

Posted By wassim in Flash Tutorials

This new feature has been introduced in flash player 9,0,115,0.

 Certain standard flash components (dataGrid, comboBox, list etc..) are used by a large number of websites. For example, More than 100 Kb of identical data has to be downloaded for every Flex application (the flex framework) . With the new Flash Player cache, Flex applications will download and start up much faster because users will probably have the framework already in a special cache from one site and will not need to download it again.

The Flash Player cache is not the same as the browser's cache. It works by storing the contents of a new type of file (SWZ) on your hard drive. When a website makes a request for the SWZ file from the server, Flash Player first checks to see whether it has the matching file already in the cache before attempting to download it.

 Besides providing smaller size advantage and thus faster loading, this feature is also beneficial to the application host by reducing bandwidth.