development + design = devign

Quick tip: searching for unread mail in Gmail

We all love our inbox but what do you do when there is just too much mail to go through and you want to just “Mark as read” all of them? In Gmail you a can find all that unread mail in just two steps.

1. Click on search options

Gmail-unread-mail

2. Select unread mail in the drop down menu

Gmail-unread-mail-search-op

Now you can see all your unread mail and do with them as you like.

Share/Save/Bookmark

Looping sounds in ActionScript 3

ActionScript 3 has done quite a few things differently to ActionScript 2. I was doing a lot of programming in C# before I got a chance to play around with it and it looked quite familiar – maybe the whole Object Oriented Programming things is catching on.

Anyway – tried to loop a sound clip in Flash and it was a lot more painful than I expected so I made a note in my work diary that looked like this -

25 February 2009

To loop a sound clip in Flash using ActionScript 3 refer to –
http://doogog.com/music-looping-in-as3.html

The code I developed also has a method to stop the music using a button is -

   1:  //Stop at this frame
   2:  stop(); 
   3:   
   4:  //Create a new sound object
   5:  var music:Sound = new Sound()
   6:   
   7:  //Set location of sound file – if it is external – using a URLRequest object
   8:  var req:URLRequest = new URLRequest("audio/bongos.mp3");
   9:   
  10:  //Create a new SoundChannel object
  11:  var channel:SoundChannel; 
  12:   
  13:  //load music file – via url request object – into channel object
  14:  music.load(req);
  15:  playMusic(); 
  16:   
  17:  //Boolean checks if the sound is playing
  18:  var musicIsOn:Boolean = true;
  19:   
  20:  //An event listener for a button that stops the music
  21:  btnMusic.addEventListener(MouseEvent.CLICK, stopMusic); 
  22:   
  23:  function stopMusic(evt:Event):void {
  24:      if(musicIsOn)
  25:      {
  26:          trace("stop");
  27:          channel.stop();
  28:          musicIsOn = false;
  29:      } else {
  30:          playMusic();
  31:          musicIsOn = true;
  32:      }
  33:  } 
  34:   
  35:  function playMusic():void{
  36:      trace("play");
  37:   
  38:  //play music through the SoundChannel
  39:      channel = music.play();
  40:   
  41:  //add an event listener that reacts when the sound being played 
  42:  //is completed and repeats the sound
  43:      channel.addEventListener(Event.SOUND_COMPLETE, repeat);
  44:  } 
  45:   
  46:  function repeat(evt:Event):void {
  47:      if(channel != null)
  48:      {
  49:   
  50:  //without removing the event listener the sound clip will play only twice
  51:  //I am not sure why but it feels like the event listener gets disposed of
  52:  //once used by default.
  53:          channel.removeEventListener(Event.SOUND_COMPLETE, repeat);
  54:          playMusic();
  55:      }
  56:  }

I hope you found that useful.

Share/Save/Bookmark

Doodling in Adobe Illustrator

Just some doodles I was doing in Adobe Illustrator.

Crossroads Face Rubber duckie sea bird City

Share/Save/Bookmark

Adding external tools to Visual Studio 2008

Often times Visual Studio will try and help you by launching some tool or function when you build a project. But sometimes you might want to use these tools outside of the prescribed work flow or maybe you just want quick access to your “utility belt”.

  1. From the menu bar select “Tools” followed by “External Tools”

    Select "Tools" then "External Tools"

  2. From the “External Tools” menu, click on “Add” to make a new entry.

     Click on "Add"

  3. Enter the appropriate information for the new “External Tool”

     Enter external tool details

Here are the settings for two external tools that I have added.

The first is for Windows Communication Foundation Test Client that allows you to test the host services that you create in Visual Studio. Be sure to select “Prompt for arguments” so you can enter the location of the service that you are testing.

Windows Communication Foundation tool details
Command = C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WcfTestClient.Exe

Next are the settings for the Visual Studio 2008 command prompt. This came in handy to enter some configuration commands for Visual Studio – more on that in another post.

Visual Studio command prompt tools details 
Command = cmd.exe

Arguments = %comspec% /k ""H:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86

Initial directory = $(ProjectDir)

What external tools have you added?

 

Share/Save/Bookmark

Hello world!

Welcome to the Devign Path – my personal, sometimes intimate, nervous adventures combining the world of design and development . . . because I love both and I don’t want to have to choose between them.

Why “devign”?

Development + Design = Devign

It is either “devign” or confused and I’m an optimist. My love for development was cultivated as I grew up, or aborted growing up, on the Nintendo Entertainment System and since then I got the idea that I would love to play video games for a living. I have to confess that my addiction to technology started much younger, when I was about 5 years old, with the Sinclair game console, probably the ZX Spectrum +3 but I can’t be sure.

Before I could move both my thumbs ambidextrously or new what “up up down down L R A B X Y” did (Super Street Fighter 2 cheat) I was filling up pages and pages of sketch books with drawings. My Mum would buy me these huge (relative to a 5 year old) brown sketch pads made out of brown paper that was somehow too hard for some pencils to write on. I loved drawing wrestling characters and aeroplanes bombing buildings. Does anybody remember that TV show with a guy dressed in a blue space suit who said, “Draw, draw, draw. Practice your drawing 3 times a day.” and loved to draw aliens and space ships?

Now here I am loving the internet because it brings all those passions together without me feeling like a schyzophrenic and from what I understand, I’m not the only one.

Share/Save/Bookmark