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
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.
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!
Hey everyone!
I keep meaning to update this blog with various titbits and stuff, but I never seem to have the time - anyway, thought I’d post up this wee drop down (combo) menu class I decided to build yesterday - It’s not been from any specific project, I just decided that the flash community needs a better dropdown that the horrific one included as standard. Anyway, it’s pretty basic just now, but it’ll do the basics and it’s totally skinable which was my main aim.
Been meaning to get this out for ages! But alas, I’ve been totally snowed under with work, and the fact that I’m all about the as3 now I’ve realised I’m never going to go through it and refine it and comment it for the community… so you’re getting it as it is. Anyway, it’s a xml editor (so no mysql) with a file manager so you can upload files, rename and preview them etc - It’s been used on quite a few clients sites of mine, although nothing too heavy mind you, leave that for the database powered stuff (although I have converted this to power mysql db’s pretty easily)… Anyway, hope it helps anyone
Made my first class - quite excited about it really! Anyway, it started out as a need to get round the fact that flash can’t use scale9 movieclips as masks, which means we can’t get any nice rounded edge masked tweens, so I wrote this to get round it. In the end it turned out really nice, and I thought I’d share it with everybody; it’s going to kick ass for building interfaces - anyway if anyone uses it gimme a shout..
Right, knocked up something that would use the php script I uploaded the other day, It brings in the data and builds a menu either for pages (with home page) or posts. I’ve also knocked up something that takes the post / page data and puts it in a text field incase anyone decides to build on it and turn it into something awesome (I might later if I have time - use swfaddress and all that).
Just found this little gem over at flashmatics.co.uk (awesome resource site), so I thought I’d post it up here. It basically checks to see whether the swf is being run from your specified domain - if not it redirects to your website. It’s perfect for stopping the use of unwanted distribution of your flash projects. var domain:String = "http://www.yourdomain.com" //enter your domain name here
Hopefully someone will find this useful, it’s the full flash source to an e-card I build for the band Driveby Argument, who are by the way utterly excellent, and I implore you to check them out. (I also did their wee flash website).
If anyone finds it useful even just a little bit then that’s awesome, and I’m glad to have helped. Although please don’t just create a carbon clone, for a start - where’s all the fun in that! If you do end up using it, send me a link or at least post a comment!