Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

In short I am searching for an alternative to Java applets for making some interactive parts like minigames etc. on my website

Facts:
I´m developing an e-learning website for children. This site has following main functions:

  • practice part where children can do grammar test and receive points for good answers.
  • tamagotchi like pet which moves around, has to be fed and so on
  • shop in which gotchi stuff can be bought

As a framework I'm using Ruby on Rails. At the moment I am using Java applets as a "quick and dirty solution" for nearly everything on the site as I totally freaked out over Flash after some years not using it and learning java in the meanwhile...

(yes I also use applets for the practices which are not much more than some textfields an dropboxes in some text..)

Now I'm searching for a cleaner solution as applets seam to me to be really slow. I already read some things in the internet but I'm searching for some opinions on my special problem.

My findings until now:

  1. JavaScript seems somehow nice, but many users deactivate it so would it be wise to use it?
  2. Flash really drove me crazy, but if anyone can give me some reasons for it I will take it in mind again.

    Here is what happened when I tried to use it: I learned Flash some years ago and I liked it very much but now I am somehow lost as it seems to me to be not really good programming and I always mix it up with Java commands and I was missing code completion and this stuff.

    My main problem when I totally dropped the idea of Flash was that I wanted to read the practices out of some xml file or maybe a database (having in mind creating some programm in which teachers can produce their own practices in some later version) and it seemed somehow near to unsolveable to create some individual buttons in some sort of loop out of this extern data. also the community seemed to be more designer like than programmer like and wasn´t too helpfull on my questions (100 times yes I know I can drag it from the library but thats not at runtime possible)

  3. Java applets are pretty slow I don't think I should use them in next versions

I welcome all hints and ideas how to solve my task.

share|improve this question
4  
JavaScript can be deactived or outright unavailable, but the same is true for all web technology aside from ancient nonstandard HTML. JavaScript is likely more widespread than Flash and Java. If that's your only objection to JavaScript... –  delnan Aug 5 '11 at 12:17
3  
The question title made me think you were asleep for many-many years ;) –  Idsa Aug 5 '11 at 12:25
    
Stats for how many people turn off Javascript developer.yahoo.com/blogs/ydn/posts/2010/10/… Possibly less than the OP would suggest. –  AlexC Aug 5 '11 at 12:34
    
well not asleep just on university ;) actually we are just learning java and our professors don´t like to accept JS "because it´s no clean programming" (personally i guess this depends on the programmer you can do a lot of mess with java as well (e.a. making an applet.. XD) as i said it was just a matter of having no time i knew there ARE better solutions, but there was no time for learning or searching them until now.. –  Asamandra Aug 8 '11 at 12:05
    
It is myth, javascript is not deactivated by any big amount of users. Moreover, those, who switch off javascript are likely to switch off any plugins also. This question is just incorrect. –  shabunc Aug 20 '11 at 9:08
add comment

3 Answers

I'm pretty sure not many users disable JavaScript. Instead, Flash is the one which doesn't even come built-in with browsers and requires a plugin. That's the new way of making interactive websites. You could look into HTML5, and using the canvas object to create the animations. For the animation, I guess you could use canvas (not very easy for entire cartoons), and move the canvas element along the page, if that's what you mean by moves along the page. If you mean you want a separate page with the character, then it could all be in the canvas element. If you want to start learning HTML5, I'd suggest you take a look at http://diveintohtml5.org/ Hope I helped.

share|improve this answer
    
Or use CSS3 for animations. Even less users disable CSS –  Raynos Aug 5 '11 at 12:33
    
@Raynos, but more users do not have CSS3 capable browser –  Idsa Aug 5 '11 at 12:36
2  
@Idsa that's where you use the javascript shim to emulate CSS3. It gives you a slightly wider user range. –  Raynos Aug 5 '11 at 12:39
    
thanks i will give it a try. and at last theres also the possibility to tell the user "please turn js on while using the site" i guess... –  Asamandra Aug 8 '11 at 11:59
    
Yeah. You can have a lower, simpler version of your site if your users don't have JavaScript or an HTML5 capable browser too. –  Some Guy Aug 8 '11 at 13:10
add comment

Part of your problem seems to be the development tools you picked for developing in Flash. I haven't used it myself, but I'm sure that there must be an editor that does auto-complete etc. to help you out in this area.

Just speaking from person experience here (and lack of experience in Flash) but Silverlight might be worth a look for getting to data out of a database and building pages based on this data. You can define pages both in XAML and in the C# code and the database links, via RIA Services, are sound. It will be a steep learning curve, but Visual Studio does have auto complete to help you out.

Speed wise Silverlight applications are just as quick as Flash. You can also do animations, stream video and (if you wait for Silverlight 5) even 3D.

However, you do need to have web servers capable of delivering Silverlight content - which may make it a non-starter for you. Your users would also have to install the Silverlight runtime.

I would expect that there are similar tools for Flash - it's just that I've never had to look for them.

share|improve this answer
    
Is it wise to recommend SilverLight without also using .NET on the server? I thought the main advantage of SilverLight was a unified client-server development stack for .NET developers. He did mention he was using RoR. –  Raynos Aug 5 '11 at 12:35
    
@Raynos - good point. I suppose I assumed that. –  ChrisF Aug 5 '11 at 12:36
add comment

Flash can be a reasonably comfortable development experience (positively luxurious compared to JS) if you stick to open source tools and avoid the bloated commercial stuff. Flashdevelop is good, lightweight and has most of what you'd expect in a modern IDE. You'll need the (free) Flex SDK too but I think the installer handles that for you these days.

The thing you have to remember is that all your code in Flash runs on the UI thread, so when you're loading data etc it's all asynchronous. Create a URLLoader, handle the complete event then do what you want with the data. E4X is built in, if you're using XML, and as3corelib (OSS too) has tools for JSON.

"Flash Builder" (Adobe, commercial) has a debugger and a decent profiler, but for simple stuff they're not necessary.

Silverlight is actually less flexible with a steeper learning curve, in my experience.

share|improve this answer
    
Neither work on the iPad which represent more than IE6 users for us now. Flash/SL in most cases is not needed you can accomplish most stuff with Javascript (use jQuery if you want), for modern browsers you also have canvas –  sa93 Aug 20 '11 at 12:31
    
Absolutely, and I wouldn't argue against doing stuff with HTML/JS where possible. The best decision depends on the content/capabilities, dev budget/expertise (JS requires a lot more testing/fixing, in my experience) and target audience (percentage of iOS users can range from 0 to 20ish which is significant). –  timh Aug 23 '11 at 15:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.