If you’re creating a new media site, you will need a multimedia player rather sooner than later. There are many options available, the easiest is embedding something that already exists. For instance, if you want to put a movie on your site, you could go for a YouTube embedded player. If you want more options, even interactivity, you need something more flexible. You could do much worse than picking the JW FLV Player.
Before you read on, go ahead and open the example to take a look at what we will create.
The player is actually a Flash applet that you can embed in your page. The neat thing, is that it can be completely controlled from JavaScript. There’s a bunch of information on the website, but it’s not very clear how it all ties together.
First, you need to initialize the player:
1
2
3
4
var so =new SWFObject('jwflvplayer/player-viral.swf','mpl','300','300','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.write('player');
This will put a 300×300 sized player in the div-element with id “player”. It won’t load any songs yet. This we will do in a later step. When the player is done loading, it will call the “playerReady” method.
1
2
3
4
5
6
function playerReady(obj){
player = document.getElementById(obj.id);
player.addControllerListener("PLAYLIST","playlistLoaded");
player.addModelListener("ERROR","error");
player.addModelListener("STATE","stateChanged");};
In this method, we initialize a few listeners. One is listening to playlist events (fired when new songs are loaded), another will display error messages and the third is used as an example how to display the state of the player. The JW Player wiki has a full list of all events.
Most of those methods themselves are plain JavaScript, so they are not that interesting, but you can take a look in the source of the example.
The final step to get the player to actually load up a song. It’s as easy as sending a “play” event:
There are many things still missing, but this should get you started. For instance, the player will only play one song at a time and the viral code is not functional (the embedding). But those will be discusses in further posts. And if you have any questions, feel free to leave them in the comments.
There aren’t many free RPG games. There are even fewer Flash RPG games and there are almost none actually worth playing. Sonny 2 is different. It combines everything you want in an RPG and mixes it up to a delightful game. It has numbers, but it’s not too deep, so it remains very accessible to players of all types.
The general gameplay is very reminiscent of an early Final Fantasy game, but without the map and focused on the fights. The graphics are great. No 3D here, but good old-time sprites. Jummy.
There isn’t too much information on the creator, called Krin. But he has a fairly active forum which you might find interesting if you want to discover and learn more.
As you read this post, I will be on my first stop of a 3 week long roadtrip through New England (North East of the USA) and Canada. Usually, I don’t plan too much, but I do like to know my options before boarding the plane. The Lonely Planet and Rough Guides are my preferred paper helpers. But this year, I’ve really found the Internet to be an valuable resource.
Here’s a list of sites I couldn’t have done without:
Yahoo! Trip Planner: There are a few trip planners on the web, but Yahoo!’s is the most complete. It has an incredible amount of hotels, attractions, destinations and comments available. It tends to be a bit slow from time-to-time and the interface can be a bit confusing, but once you’re used to it, it’s pretty ok.
VirtualTourist.com is one of the largest user community sites entirely dedicated to tourist tips. The best hotels, the worst tourist traps, you’ll find them all on Virtual Tourist. Together with the Yahoo! Trip Planner, and a few guides, Virtual Tourists gave me all information to plot out a route. Most of the other sites, I’ve used to find affordable hotels and transportation.
To fill in the blanks, I’ve used Google a lot. I know this sounds like a stupid suggestion, but through Google I’ve found a few great sites. Such as the VisitPA one. I really love it, and because of that one, we’ll be staying a few days in Pennsylvania.
ebookers is a European travel site, so I’m sorry to all my American readers. But I’m mentioning this site first, because it seemed to have the best rates.
Hotels.com is a similar, but a worldwide site. I think it offers the widest range of options and I plan to use this on the road to book last-minute hotel rooms for cheap.
Booking.com rounds off the trio of hotel search sites. Although they do have overlapping offers, they also all seem to differ just a little. But 10% price difference can really impact your budget (more money for drinks and amusement parks)
If you want cheap plan tickets, Supersaver is the place to be. No other site could even come close to the prices they have.
Well, ok, if you’re not in the countries supported by Supersaver, the very popular Expedia does have many good flight offers.
TripAdvisor is more of a allround site. It does offer flight and hotel search, but there’s much more. You can search for things to do and read many many reviews. It’s nice if you find a hotel or venue on one of the sites above and want a second opinion.
If you can’t find an affordable hotel, you can always turn to hostels.com. Hotels in major cities tend to be extremely expensive, so if you can do without the luxury, a hostel is a nice second choice.
In spite of all this planning, We’re also leaving a lot open for exploration and we’ll fill in the gaps as we see fit. But it’s always nice to know the options.
What do you think, are any important sites missing?
This week’s independent game is not a Flash game per se, but there is a Flash client to easily play it. “Violet” is the 2008 Interactive Fiction Competition winner and with reason. I have been an interactive fiction fan for a long time, and really appreciate the original ideas that can be found in many of those games. Violet is no different, Jeremy Freese has created a neat little game with an extremely clever and funny interface.
As usual, you type in commands, but now the interface seems to have a will of its own. You should try it out to really understand it.
You can play it online, but if you want a more customizable experience, go for the Gargoyle interpreter and download the game. The online playable version is provided by Jay is Games, as you might have noticed, it is one of my main sources for great casual games. If you want even more games, you should definitely pay them a visit.
A few months ago, a little show-reel by Easyweb.fr made the rounds on the net. It showed that new media doesn’t have to be on the Internet or even on your screen. They use buildings as canvasses. Buildings seem to come to life as bricks move around on the wall and strange creatures lurk behind windows. It’s a young artform, known under several names, like “projection mapping”, “geometric projection” or most often “spatial augmented reality”. Before I start experimenting with it, this post is an overview of what information I could find on the net.
If you missed the movie, here are 7 minutes of inspiration (via Digital Urban):
Basically what happens is they put one bad-ass projector in front of a building and calibrate the software, so that it knows where all the buildings features are. Once the building is entered into a 3D package, they can add artificial elements to the projection.
Now this might sound easy, but trust me, it is not. Reconstructing the building in 3D and exactly positioning the projector to be aligned with the computer image is only the start. Next you need images that look good from different sites. Because there’s no “real” 3D here, it is easy to get results that only look good from one particular angle.
On the Internet, this spatial augmented reality seems to be rather unknown. There are many scientific papers if you search google, but there aren’t too many practical tutorials. Here are the 5 most interesting links I found, that should get you up to speed quickly:
Spatial Augmented Reality is a free downloadable book describing many types of augmented reality. It goes into great depth on the existing techniques and it gives an overview of the necesarry Maths. The material is not easy, but the explanation is very clear. Over 300 pages of knowledge will get you quickly started. It’s certainly worth buying the paper version to have it always available next to your computer.
An impressive experiment in finding objects automatically. It shows you how to digitize the environment based on projecting known patterns (and you’ll need sensors on the object, which might not always be feasible). It’s a bit low on technical details, but if you want more information, you can always check out Johnny Chung Lee’s PhD thesis, on which this is based.
This article is pretty old, but it is still a very nice tutorial on mapping the real world on a virtual one. Once this 3D world is created you can enhance it and project it back on the real one.
This final blog post in the list shows a real life demo. It documents some of the hardware setup and used 3D objects (also check the links), but sadly no video of the actual result.
vvvv is the only toolkit I could find that is actually aimed at applications like this (and many other VJ’ing applications). They have an in-depth tutorial on how to set things up and what to watch out for.
Cool stuff! My next step is obtaining a decent projector for an affordable price. To be continued …
Over the next few weeks, I’ll be featuring a bunch of Flash games that have been in my backlog for a long time now. As some of you might know already, I am a great admirer of the new wave of almost-professional free games. They are a great way to experiment with new media and show of your skills. Many of the games go well beyond simple hobby project, and I truly hope the creators can earn a living with them.
“Something Amiss” is a perfect example of this. Over at least 2 years, the creator, Tucker Bowen has been working on a great point-and-click adventure. It steps in the footsteps of many great predecessors. The games nicely ramp up, with the first chapter serving more as an introduction to adventure games.
The last hour, I’ve been busy trying to get my site’s markup valid. The frontpage now validates, but there’s till work to be done to the other pages. So after reading Dennis Forbes’ post, I noticed I’ve been running for the past year or so with invalid markup and nobody ever pointed that out. One might rightfully wonder: does it actually matter?
Personally, I think it does and I feel I need to fix the remaining problems as soon as possible. I might even go from the “XHTML transitional” to the “strict” doctype, just for kicks (and other advantages). Not only will good XHTML give a tidy impression to visitors, but it is also one of the most reliable ways to make sure your site looks the same on all browsers and operating systems. And if you go for XHTML instead of HTML is will also be able to use neat stuff like XSL.
In order to get my pages in order (still a work in progress), there were actually only 6 errors that keep repeating. Because I’m running WordPress, it isn’t always easy to find the source. It could be a plugin that inserts some HTML somewhere or part of the header, or was it in the sidebar?
If you copy from webpages, make sure you are copying code pieces without layout. The build in TinyMCE editor is great, but if you copy a piece of code from a webpage, it sometimes pickes up HTML codes that you can’t see, but that will mess up your pages. For instance, I had problems with HTML comments (two dashes were copied as one long).
Close your tags. This is the most basic rule of them all if you are creating XHTML, but it is very important. It’s easy to write <br> instead of <br/>, but only the last one is correct.
Put alt tags on images. And don’t just put in some random piece of text. Try to make it descriptive, because blind people need them to fully enjoy your website. As do people with slow connections (they are still out there)
Encode special characters. This is again a XHTML requirement. Probably the most popular special character you’ll run across is the ampersand (&), you should write it as “&” Don’t worry about your blog posts, the build in editor will take care of it. This is just for the templates.
Uppercase and lowercase matter. Tag names should all be lower case, so <META …> is not the same as <meta …> Obviously the actual text can be any case you wish.
If you give id’s to div’s (or other elements), they should be unique. This is not only a requirements, but if you plan on adding JavaScript to your site, you will save yourself a lot of headaches if you keep this in mind from the start.
If you want to test your own site, you can do so, entirely free of charge, at the W3C Markup Validation Service. Good luck with those tweaks.
It’s a great thing what fans can do. Take for instance OverClocked ReMix, a community site where every one can upload their remixed game soundtrack. At first, the site will look a bit unstructured, but everything has its place. If you’re a first time visitor, I would suggest you head straight to the torrents section and start listening.
Some time ago, I downloaded the first 1000 track (they are already upto 1700!). This is a 3.12 GB collection, over 2 days of music, so if you’re a bit hesitant, you might want to try out one of the albums. But the collection won’t dissapoint. It has everything from chiptune remixes to full orchestral “re-envisionings”. It’s great to hear remixed The 7th Guest music. The Age of Empires music was also spot on. But there are so many things on there, if you like video games, you will find something that brings back fond memories.
Ok, one more, Out Run. If you’ve ever played that game in arcades or at home, the mixes will instantly give you an energy boost.
Over the last year or two, developing 3D applications in Flash has become increasingly feasible, for almost any ActionScript developers. A number of open source 3D engines, like Sandy 3D, have popped up. Combined with the incredible FlashDevelop, any one can get started, right away. However, because FlashDevelop does not have the authoring tools of Adobe’s Flash tools, you need to know a few differences that you won’t find in many tutorials, but I will explain them in this post.
This is a refreshed version of my previous tutorial, where I explained the important differences you need to know to get started with FlashDevelop and Sandy 3D. I won’t go into setting up FlashDevelop, all details mentioned in the previous post are still valid.
But the Sandy 3D Engine has changed slightly (for the better, mind you). I’ll point out what’s new and give some additional examples. But first, lets look at the result:
The code consists of 4 main parts, I’ve split them up, but if you want, you can go right ahead and download the entire FlashDevelop workspace:
I’ve gone over this a few times, but it bears repeating as this is something you won’t use in CS3. In FlashDevelop, you add a bitmap in the lib directory. With this done, you put an embed tag in your code (or double click, FD can usually do this for you) and on the next line you put the class name you want to assign to this embedded resource. As a final step, you need to instantiate the object.
It sounds much more complicated then it is, just look at the code:
1
2
3
[Embed(source = '../../../../lib/aqua.png')]privatevar aquaClass:Class;
privatevar aquaBitmap:Bitmap = new aquaClass();
2. Creating and texturing the 3D objects
With the bitmaps imported, we can use them to texture objects. This is done by setting the objects appearance. The appearance has a few options, but for now, we’ll only set one material on it. The material is the object that actually contains the texture.
For instance, the background image when you move over the cube is a Plane3D object on which we set an appearance that consists of a BitmapMaterial:
1
2
3
4
plane = new Plane3D("thePlane", 200, 200);
material = new BitmapMaterial(beamsBitmap.bitmapData);
material.lightingEnable = true;
plane.appearance = new Appearance(material);
More complicated objects can contain multiple surfaces. If you want to set them all alike, just use the code above, but you can also address them individually. You use the “aPolygons” collection for that. Depending on the object and the parameters you choose, you might need to experiment a little to find the correct polygons.
For instance, this code sets the front and back side of the box in the example:
1
2
3
4
5
6
var material:Material = new BitmapMaterial(logoBitmap.bitmapData);
material.lightingEnable = true;
var app:Appearance = new Appearance( material );
var i:int;
for(i = 0; i < 4; i++ )
myBox.aPolygons[i].appearance = app;
3. Listening to events
While the way you handle events hasn’t changed since previous versions of Sandy, the MOUSE_MOVE event was removed. It is no longer handled, probably because of performance reasons, but I’m not entirely clear on the reasons.
The official tutorials also now suggest to put the event handling on the container, this is part of your object that is actually displayed. If you can, I would suggest to use this, because it’s probably a lot quicker.
There are cases where you might like to obtain the Shape3DEvent. Take a look at the tutorial on the Sandy site to decide if you’d need that. But to reiterate, the Sandy event system no longer supports the MOUSE_MOVE event.
In the example, the event listener for the mouse over event looks like this:
New in Sandy3D (although it’s not that new any longer) is the removal of World3D. World3D was a singleton class, which meant that you could have only one in your program. It has now been replaced by Scene3D, of which you can create and render multiple in your program.
So if you want, you can have different scenes or different cameras in your program. Cool, but don’t overdo it, keep in mind that every scene you add will also add to the processing power required.
Setting up the camera is exactly the same as before:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
privatefunction init(e:Event = null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry pointcamera = new Camera3D(300, 300);
camera.x = 0;
camera.y = 50;
camera.z = -200;
camera.lookAt(0,0,0);
var root:Group = createScene();
scene = new Scene3D("scene", this, camera, root );
addEventListener( Event.ENTER_FRAME, enterFrameHandler );
}
I haven’t discussed the tweening used to move the cube in the program. If you’re interested, please let me know and I’ll write another blogpost. Otherwise, you now have all parts to get started with 3D development in FlashDevelop.
Any online business, small or large, niche or broad, depends on its servers. If the site is not online, no visitors will come, no sales will be made, no content nor ads displayed. Even worse, downtime could give the impression that your site is gone and thus, users might be tempted to remove your site from their bookmarks or newsreaders. Without question, monitoring your servers health is vital.
You could do it yourself, open your browser and go to your site every 15 minutes. But you’d have very little time to sleep. Monitoring websites is something that can be perfectly automated, so why do a computer’s job? Many tools are available on the Internet, some are free and some are surprisingly expensive.
There are monitoring programs you can install on your own PC, but that means you have to leave it running 24/7. There are also online monitoring services. You give them your coordinates and they try to visit your site every 15 or 30 minutes.
I’m currently very happy with Mon.itor.Us, which is free and will monitor your site every 30 minutes from 3 different locations across the globe. You get a nice uptime graphic, e-mail alerts and, if you like, an RSS feed with downtime reports. If you want more options and site monitors, you can always go for the premium package, but I currently don’t have the need for it.
If you want more options, there’s a huge (huge!) list at Hongkiat. And while you’re there, don’t forget to check out the other great resources and helpful posts.