I’m still here!

Still here, honest. Just busy – really busy. I’ve been working on a new site for about 3 months, which is going to be up soon.

Read more

Personal

No Comments


An Update

Look at the dust in here!

Apologies there isn’t much going on around here. I keep meaning to write about things, but they don’t happen.
The truth is, i’m busy. But I guess if these articles are help to people I’ll keep it up.

Read more

Personal

No Comments


Hello World

Apologies for not updating this blog that often… just too busy / lack of interesting things to talk about.
These days I tend to restrain my musings to 120 characters.
I also try and keep my portfolio up to date, if you want a look there.
Oh, and if you’re ever knocking around Glasgow, give me a shout. I drink a lot of Lattes at Tinder Box.

Read more

Personal

No Comments


Bat Cat! – Performance of Flash Player (in Safari) on Snow Leopard is crap.

Just installed Snow Leopard yesterday and the performance of Flash Player in the browser it atrocious!
I’ve made a quick graphic to show the differences between various machines running Safari (various versions). Hopefully we’ll have a fix soon!

UPDATE: This is only within the Safari Browser, It works great in Firefox!

badcat

LINK

Read more

Finds Flash OSX

No Comments


SWFAddress url sorting utility

UPDATE:

I don’t know how I missed this, but since v 2.1 SwfAddress has the getPathNames() method which does exactly what my bit of code does… ah well. Anyway I’ll leave it up as it has the basics of string splitting and other stuff…

Thanks to Cam for pointing this out… and while you’re at it check out his blog, he’s a much better coder than myself (but sucks at the guitar ;) )

Just thought I’d post this up as it might be helpful to someone…

Normally if you’re building a site using SwfAddress (and you should, not having any form of deeplinking in your flash site these days is utterly unforgivable) you could just on the swfAddress change do something like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
switch(String(e.value).replace("/", "")){

case "news" :

openNews();

break;

case "shows" :

openShows();

break;

}

But what happens if you want to use subpages (/news/news-item), or subsubpages (/news/news-item/photo)… or however many… well, something like this will help you a lot.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var string:String = "/news/news-item";

function sortDeepLink(_deeplink:String):void{
   
    var urlArray:Array = [];
   
    if(_deeplink.charAt(_deeplink.length - 1) == "/"){
                                         
        urlArray = _deeplink.substring(1, _deeplink.length - 1).split("/");
       
    } else {
       
        urlArray = _deeplink.substring(1, _deeplink.length).split("/");
       
    }

   
    switch(urlArray.length){
   
        case 0 :
       
        //Home address
       
        trace("Home");
       
        break;
       
        case 1 :
       
        //One tier address - ie. /news/
       
        trace("URL (one tier): " + urlArray[0]);
       
        break;
       
        case 2 :
       
        //Two tier array - ie. /news/news-item
       
        trace("URL (two tier): " + urlArray[0],urlArray[1]);
       
        break;
       
        default :
       
        //Invalid URL
       
        trace("URL invalid");
       
        break;
       
       
       
    }
   
}

sortDeepLink(string);

//

You can extend the switch function to handle as many tiers as you need by just adding more cases – you can also add a 404 function in the default case if you want.

I’d love to know if anyone uses this, so post a comment if you do!

Read more

Flash snippets Flash source

3 Comments