Daily Archives: June 3, 2012

Useful jQuery Function Demos For Your Projects

<![CDATA[
/*
* 50 jQuery Function Demos for Aspiring Web Developers
* Copyright 2012 Sam Deering for Smashing Magazine
* http://coding.smashingmagazine.com/2012/03/16/50-jquery-function-demos/
*/
/* #j4u-post { min-width: 670px; } */
#j4u-post h2 { margin-top: 20px;}
#j4u-post .shadow {
background: none repeat scroll 0 0
box-shadow: 0 1px 2px
height: auto;
max-width: 580px;
padding: 5px;
}
#j4u-post li { margin: 10px 0px;}
#j4u-post p.example {
background:
background: -moz-linear-gradient(top,rgba(255, 255, 255, 1) 0%,rgba(232, 228, 226, 1) 150%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(232, 228, 226, 1)),color-stop(150%,rgba(232, 228, 226, 1)));
background: -webkit-linear-gradient(top,rgba(255, 255, 255, 1) 0%,rgba(232, 228, 226, 1) 150%);
background: -o-linear-gradient(top,rgba(255, 255, 255, 1) 0%,rgba(232, 228, 226, 1) 150%);
background: -ms-linear-gradient(top,rgba(255, 255, 255, 1) 0%,rgba(232, 228, 226, 1) 150%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF',endColorstr='#D4D2D0',GradientType=0 );
background: linear-gradient(top,rgba(255, 255, 255, 1) 0%,rgba(232, 228, 226, 1) 150%);
color:
font-weight: normal;
padding: 5px 5px 5px 10px;
-moz-border-radius: 10px;
border-radius: 10px;
margin-top: 20px;
margin-left: -10px;
}
#j4u-post #animate3 img { height: 40px; width: 80px;}
#j4u-post .demoarea {
display:none;
margin: 0 0 15px 0;
}
.jq4ubutton {
color:white !important;
display: block;
border: 1px solid;
border-color: #aaa #000 #000
width: 200px;
background:
color:
text-decoration:none !important; text-align:center; font-weight:bold;
margin-right: 5px;
}
.jq4ubutton:hover {
position: relative;
top: 1px;
left: 1px;
border-color: #000 #aaa #aaa
}
#j4u-post .orangebg {background-color: #E57124 !important;}
#j4u-post .purplebg {background-color: #C879D8 !important;}
#j4u-post .whitebg {background-color: white !important; width:30px!important;}
#j4u-post .bigcolordiv { color: white; float: left; font-size: 36px; height: 50px; line-height: 46px; margin-right: 5px; text-align: center; text-transform: capitalize; vertical-align: middle; width: 50px; }
#j4u-post .smallcolor { float:left;width:10px;height:30px; }
/* required so slide() deoesn't jump */
#j4u-post .sourcecode { width: 670px; }
#j4u-post #filter p { margin:0; padding:0; }
#j4u-post #find li { margin:0; padding:0; }
#j4u-post .listnomargin li { margin:0; padding:0; }
#j4u-post #jq4uclock, #j4u-post #jquery4ucounter { font-size: 42px; line-height: 42px; }

#j4u-post .twittereyesclosed {
background-image: url('http://media.smashingmagazine.com/wp-content/uploads/2011/11/twitter-eyes-closed.jpg');
}
#j4u-post .twittereyesopen {
background-image: url('http://media.smashingmagazine.com/wp-content/uploads/2011/11/twitter-eyes-open.jpg');
}]]>

What Is jQuery?

In a nutshell, jQuery is a leading JavaScript library that can perform wonders on your Web pages and make your Web development life much easier and more enjoyable. With the rise in popularity of jQuery since its arrival in 2006, over an estimated 24 million websites (50% of them being the 10,000 most visited websites) currently reap the benefits, and as Google Trends suggests, it’s the most popular JavaScript library.

Thousands of Web developers worldwide use jQuery to innovate on their websites and stay up to date on trends. This surge has been influenced by several jQuery gurus who have helped make jQuery what is today. I would like to personally thank these guys and gals for their hard work and would like to do my part to spread the news about JavaScript and jQuery. In this article, we’ll show you over 50 of jQuery’s most renowned functions, demonstrated with live visual examples. The jQuery library is comprehensive, so hopefully seeing these most frequently used functions in action will improve your understanding of how they can work together to produce excellent results.

jQuery And CSS

Styles play a big part in the look and feel of any website, and jQuery can help us change them dynamically. In this section, we will look at how jQuery can be used to dynamically add and remove style classes and entire cascading style sheets.

.css()

You can change your website’s styles dynamically with jQuery’s .css() function. Either change styles that are already declared inline or in CSS files (such as font-size, color, background-color, etc.) or create new styles for elements.

Demo: Change text color and background color

Blue text with orange background

Demo: Add a style sheet

.addClass() and .toggleClass()

In addition to the .css() function, you can apply currently defined CSS classes by using the .addClass() function. Its counterpart function, .removeClass(), reverses the action.

Demo: Add a CSS class to an element

Click “Run demo” to add the styles to the button. Click “Reset” to remove the styles.

The .toggleClass() function is a huge time-saver for toggling a state on and off with CSS. The following example sets event handlers for mouseenter (which applies the CSS class img-hover to the image) and mouseleave (which removes it).

Demo: Toggle a CSS class on an element

jQuery Animations And Effects

We can use jQuery to create some very smooth animations and effects with minimal effort. Animations and effects are always best demonstrated with examples, so let’s dive right in.

.animate()

The .animate() function can be used to animate the movement and/or appearance of elements on a Web page. Let’s look at both. You may define the settings parameter with a set duration (in milliseconds) or any of the words slow, normal or fast. The callback, which is the function that runs after the animation has finished, is optional.

Demo: Animate text

Demo: Animate size

Easily change the size of a div.

jquery books

Demo: Animate movement

The .animate() function is asynchronous, so multiple animations may run at the same time. You can also use the .stop() function to stop the animation. If you click “Run demo” and then “Reset” during the animation, it will demonstrate the .stop() function.

jquery car 1

jquery car 2

jquery car 3

jquery car 4

jquery car 5

Many pure JavaScript functions are used frequently in animations, such as setInterval(), clearInterval(), setTimeout() and clearTimeout(). Once again, these functions are included in the list because understanding what they can do is important to supporting the jQuery’s animation functions.

setInterval() and clearInterval()

You can automate a task based on time using the JavaScript setInterval() function, which can be used to specify a regular time-based trigger.

Demo: Simple time counter

Click “Run demo” to start the timer, and click “Reset” to stop it.

Demo: Digital time display

setTimeout() and clearTimeout()

You can also delay a task based on time using the JavaScript setTimeout() function, which can be set to wait for a specified length of time before running the code.

Demo: Do something after a specified length of time.

Click “Run demo” to set the timeout and, click “Reset” to clear it.

.slideToggle() and .fadeToggle()

jQuery provides various toggle functions that save us heaps of time when we want to bind related events to the same element. For example, .slideToggle() binds both .slideUp() and .slideDown() to the element and also manages that state for us.

Demo: Slide an element in and out of view.

Click “Run demo” to show the paragraph, and click again to hide.

The .fadeToggle() function is similar to .slideToggle() but with a fading effect that uses the .fadeIn() and .fadeOut() methods.

Demo: Fade an element in and out of view.

Click “Run demo” to show the paragraph, and click again to hide it.

.delay()

In this demonstration, we’ll mainly use jQuery’s awesome function-chaining ability by running the .fadeOut(), .fadeIn() and .delay() functions together on the same element. This is very similar to the setTimeout() function we saw earlier but without allowing us to easily interrupt the delay.

Demo: Use .delay() to create a delay between function calls.

alert msg

jQuery And DOM Manipulation

The DOM (document object model) is all of the HTML content that you see on a website (text, images, container elements, etc.). We can use jQuery to perform wonders with the DOM when all page elements have been loaded. The event that captures when the DOM is ready is called .ready(), and there are a few ways to call it. In this section are demos of jQuery functions that change the DOM in some way.

.clone()

The jQuery .clone() function is pretty simple to use; it basically just copies the element that you specify into a new element.

Demo: Clone an element.

.html(), .text() and .empty()

Using .html() is the most common way to get or set the content of an element using jQuery. If you just want the text and not the HTML tags, you can use .text(), which will return a string containing the combined text of all matched elements. These functions are browser-dependent (i.e. .html() uses the browser’s innerHTML property), so the results returned (including white space and line breaks) will always depend on the browser you are using.

In this example, we are also making use of the .empty() function, which is a quick way to get rid of the content within, and .prev(), which can be used to reference the preceding element, in this case the demo buttons.

Demo: Get the content of an element.

.append(), prepend(), .after() and .before()

These function provide the means of inserting content in particular places relative to elements already on the Web page. Although the differences may appear trivial, each has its own purpose, and knowing exactly where they will all place content will save you coding time.

Demo: Insert content onto a Web page.

jQuery And AJAX

The jQuery library has a full suite of AJAX capabilities that enables us to load data from a server without refreshing the browser page. In this section, we will have a quick look at refreshing page content, loading scripts and retrieving data from different Web pages and servers.

$.ajax()

The $.ajax() function is arguably the most used jQuery function. It gives us a means of dynamically loading content, scripts and data and using them on a live Web page. Other common uses are submitting a form using AJAX and sending data to server-side scripts for storing in a database.

The $.ajax() function has a lot of settings, and the kind team at jQuery has provided many shorthand AJAX methods that already contain the settings we require. Some developers like to write out the full AJAX settings, mainly because they require more options than many shorthand methods provide (such as beforeSubmit()). Also, note that you can use the Firebug NET.panel to analyze HTTP requests for testing, monitoring and debugging AJAX calls.

Demo: Use $.ajax() to load content without reloading the entire page.

For this demo, HTML content is held in separate files, which are inserted below using AJAX. Showing a loading icon while an AJAX request is processing is courteous. The third content block below has a two-second delay to simulate the loading icon.

We can also use functions such as $.parseJSON() and JSON.parse() from ECMAScript5, which simplifies JSON parsing. If you’re interested in JSON parsing and tree recursion, see the “Online JSON Tree Viewer Tool.”

.load()

The .load() function is an AJAX shorthand method for inserting HTML straight into a matched element on the Web page.

Demo: Use .load() to grab HTML content from another Web page.

JSONP

AJAX requests are subject to the same origin policy, which means you may only send requests to the same domain. Fortunately, $.ajax() has a property named JSONP (i.e. JSON with padding), which allows a page to request data from a server on a different domain. It works by wrapping the target data in a JavaScript callback function. Note that the response is not parsed as JSON and may be any JavaScript expression.

Demo: Use AJAX and JSONP to load data from an external source.

This demo will load the latest pictures tagged “jQuery” from Flickr’s public feed.

The AJAX shorthand functions $.getJSON and $.getScript and more AJAX examples can be found on my blog.

jQuery And Events

Managing events using regular JavaScript is entirely possible, however, jQuery provides a much more user-friendly interface to manage Web page events. Examples of such events are clicking a hyperlink, moving the mouse over an image and even pressing a key on the keyboard; the list goes on. Here are some examples of key jQuery functions that may be used to manage events.

.bind() and .unbind()

The .bind() function is very useful for adding event triggers and handlers to your DOM elements. In case you didn’t know, you can bind your DOM elements to a whole list of events, such as submit, change, mouseenter and mouseleave.

You may have also seen .click() used in jQuery code. There is no functional difference between .click() and .bind('click'), but with the latter we have the benefits of being able to specify custom events and add data parameters. There is also an .unbind() function to remove any events that have already been bound. As of jQuery 1.7 the .bind() function is an alias to .on() function. When you type in console: “jQuery.fn.bind.toString()” it will return: “function (a, b, c) { return this.on(a, null, b, c); }“.

Demo: Trigger an event when the user clicks on or hovers over a div.

Demo: Trigger an event when the user hovers over or double-clicks a div.

Press “Run demo” a few times in a row for some nice effects. Also, double-clicking the boxes will make them disappear!

Demo: Trigger an event when the user presses a key.

Press any key shown in the boxes below.

Note: The key difference between keydown and keypress events is that the latter captures each individual character entered, as opposed to just firing once per key press. To illustrate, this simple tool shows the keycodes for any key that you press.

.live(), .on() and .off()

The .live() function is essentially the same as .bind(), but it can capture events on new elements that didn’t exist on the page when it was loaded; for example, if your Web page has loaded and then you dynamically insert an image onto it. If we used .bind() to attach an event when the mouse hovers over the image, it would not work. But if we used .live(), it would work! As of jQuery 1.7, you are advised to make use of the new .on() and .off() functions, instead of the .live() function, which has a few disadvantages to .on(). See “jQuery 1.7+ .on() vs. .live() Review” for a more detailed explanation of the differences.

Demo: Capture events on new or changed elements.

Click “Run demo” to dynamically insert more images and check that the event still fires on them.

.delegate()

The .delegate() function provides a means of attaching event handlers to new elements (similar to the .live() function covered above). You might find .delegate() to be faster than .live() because the latter searches the entire document namespace for the elements as opposed to a single document. The much more important difference is that .live() is prone to break if used with traversing.

Demo: Delegate events to the child elements of a root element.

The demo area is the root element (orange border) with colored span child elements that have a hover event attached. Click “Run demo” a few times and hover with the mouse to trigger the effects.

.preventDefault()

The .preventDefault() function can be applied to stop any element with a default action from firing: hyperlinks, keyboard shortcuts, form submit buttons, etc. These are probably the most common uses, and the function stops the hyperlink from going to its destination (the href). It’s very useful for stopping those default actions and running your custom JavaScript actions instead.

Demo: Prevent a hyperlink from going to its href.

.stopPropagation()

There are methods that do things similar to .preventDefault() but that behave differently. The .stopPropagation() function prevents the event from occurring on any ancestor elements. This can be used if you have an exception to the rule that you’ve specified for a container element with child elements. This function currently does not work with .live() events because it handles events once they have propagated to the top of the document.

Demo: Prevent a parent container from firing its event when its child is clicked.

Click both the link and div box area to see which event is fired.

This div does not use the .stopPropagation() function.

This div does use the .stopPropagation() function.

As you can see, when you click the top link it also fires off the div event, but the bottom link uses .stopPropagation(), which prevents the div event from firing. The div event will still fire if you click inside the div, as expected.

.stopImmediatePropagation()

This function is nice for stopping all future bound events. The events will fire in the order they were bound, and when it hits the .stopImmediatePropagation() function, all further bound events are not fired.

Demo: Prevent all future bound events from firing.

Click both the link and div box area to see which event is fired.

This div does not use the .stopImmediatePropagation() function.

This div does use the .stopImmediatePropagation() function.

As you can see, when you click the links in the top div, all of the events fire off. But when you click the links in the bottom div, only the code for all of the links fires off because it calls .stopImmediatePropagation() on the event. This function also prevents the event from firing on any ancestor elements, just like the .stopPropagation() function, as seen in the example where the div click event doesn’t fire on the bottom links.

Finding, Looping And Filtering Results

jQuery gives us fast access to finding anything on the page and the ability to loop through or filter results as we please. It also has powerful functions to manipulate and extend data and functionality associated with JavaScript objects. There are so many things to cover in this section, so we have narrowed them down to a few key functions.

$.each() and .each()

There are two different methods for iterating with jQuery: .each() is used to iterate only over jQuery objects collections, while $.each() is a general function for iterating over JavaScript objects and arrays. I am a big fan of functions such as these and JavaScript shorthand techniques that provide us with a fast alternative to basic JavaScript coding.

Demo: Use $.each() to loop through values in an array.

Output the countries of the world (stored in an array).

Demo: Use .each() to loop through DOM elements.

This demo loops through all of the h2 tags on this Web page and creates a table of contents.

You can use $.each() and .each() on a lot of different things, such as DOM elements, arrays, objects and JSON. For those of you who are keen, you could try five more jQuery .each() examples.

$.data(), .data(), $.hasData() and $.removeData()

Updates to the jQuery library (mainly since 1.4) has brought the ability to attach data of any type to DOM elements. This is a very useful alternative to storing data in JavaScript objects and other such methods. There are two versions: $.data(), which takes in the element as a parameter, and .data(), which can attach directly to matched elements.

Note that $.data() returns a data object to the caller, whereas .data() does not. There are also many utility functions, such as $.hasData(), $.removeData(), that help with data management.

Demo: Attach data to DOM elements.

The following example sets and gets a data object into the div for this demo area.

.match(), .test() and :contains()

Together with the jQuery :contains() selector, you can use the pure JavaScript functions .match() and .test() to save time when filtering for string values. Let’s look at some examples.

Demo: Extract email addresses from inside HTML (i.e. a string).

We can use .test() to check whether any emails are present, and use .match() to extract them.

Curabitur placerat commodo augue eget congue. Aliquam id ante leo. Duis at libero magna, at dignissim odio. Aliquam aliquet suscipit mollis. Pellentesque libero tortor, elementum id mattis vel, mattis eget metus. somebody1@somewhere.com Nam convallis interdum imperdiet. Fusce at magna tellus. Sed mi ante, aliquam at accumsan ac, tristique sit amet dui. Aliquam eleifend molestie ligula. Vivamus eleifend, somebody2@somewhere.com diam id tincidunt posuere, ipsum dui elementum sapien, posuere pulvinar risus neque id turpis. Nullam volutpat cursus libero, sit amet euismod justo eleifend vitae.

Demo: Use the jQuery :contains() selector to match elements with substrings.

We can use the :contains() selector to match substrings inside any of that element’s descendants (this is case sensitive).

.find()

The .find() function is very useful for matching elements filtered by a selector, jQuery object or element. The .find() function can be used with the functions .children() (which searches only the direct child siblings of the matched elements) and .parents() (which searches the direct parent elements of the matched element).

Demo: Finde specific descendants of matched elements.

.filter()

The .filter() function allows us to reduce a set of matched elements based on a jQuery selector. This is useful when you want to process a group of elements and then further process specific child elements. The .filter() function can be used in a few different ways, such as to filter by a class name, function or jQuery object.

Demo: Use .filter() to match subelements.

In this example, .filter() is used to style paragraphs based on their content.

Paragraph 1

Paragraph 2 with span tag

Paragraph 3 with strong tag

Paragraph 4 with highlight class.

Paragraph 5 with span tag

Paragraph 6

Paragraph 7 with strong tag

Paragraph 8 with span tag

Paragraph 9

.slice()

The .slice() function lets us easily specify a subset of elements to perform actions on. It takes two parameters: start and end indices of subelements in a matched parent element.

Demo: Use .slice() to perform actions on a subset of elements.

.prev() and next()

The .prev() and .next() functions can be used to reference the immediately preceding or next element in a set of matched elements (in the DOM hierarchy). You can also add a selector to the functions that acts as a filter on the elements (shown in the demo).

Demo: Reference the previous and next elements in a list.

$.extend()

The $.extend() function can be used to combine two or more objects into the first object or into a completely new object.

$.extend( target, [object1,] [objectN] )

In the demo, we have a functional contact form on our website, and we want two more forms with similar functionality. Instead of copying all of the code that processes the form, we can use $.extend() to copy the functionality to our new forms, thus avoiding repetitive code. You might have noticed that the target element specified is a blank object; this is a trick that you will often see to create a new object of object1 and extend it with objectN (N representing any number of objects). So, in the example, we want to “copy” the existing functionality of forms.enquiry and simply override the email address.

Demo: Use $.extend() to change the send action on a form to different email addresses based on the form used.

This demo simulates the submission of three forms that all use the same code base.

Demo: Use $.extend() to specify custom settings for a plugin.

This demo shows how to specify the length of paragraph excerpts. The default is 150 characters.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Addy Osmani’s book Learning JavaScript Design Patterns gives greater insight into how to use the $.extend() function to override the default values of jQuery plugins.

.serialize() and .serializeArray()

The .serialize() and .serializeArray() functions can create string and array values from form fields in seconds! There are two demos here: the first outputs all of the form’s fields and their values, and the second creates a URL string with the form fields and values appended to the form action ready to be sent.

To run the demo, enter anything into the form and click the “Run demo” buttons below the form.

Demo: Create an array of all of the form’s field values

Demo: Create a URL string with all of the form’s field values

Conclusion

Although we have only scratched the surface of jQuery in this article, we hope you have learned something about some of the most popular jQuery functions and are able to use them to write fantastic code for your next Web development project. Thanks for reading.

What’s so addictive about ‘Angry Birds’?


.cnn_html_media_utility::before{color:red;content:’>>’;font-size:9px;line-height:12px;padding-right:1px}
.cnnstrylccimg640{margin:0 27px 14px 0}
.captionText{filter:alpha(opacity=100);opacity:1}
.cnn_html_slideshow_media_caption a,.cnn_html_slideshow_media_caption a:visited,.cnn_html_slideshow_media_caption a:link,.captionText a,.captionText a:visited,.captiontext a:link{color:outline:medium none}
.cnnVerticalGalleryPhoto{margin:0 auto;padding-right:68px;width:270px}
]]>

Bounce Evolution let phone users roll a ball through 3-D environments. Rovio made 51 games before Angry Birds.“Bounce Evolution” let phone users roll a ball through 3-D environments. Rovio made 51 games before “Angry Birds.”

In Totomi, players drop animals -- zebras, fish and others -- on top of each other to form totem poles. Rovio, based in Finland, nearly went broke before Angry Birds in 2009.In Totomi, players drop animals — zebras, fish and others — on top of each other to form totem poles. Rovio, based in Finland, nearly went broke before “Angry Birds” in 2009.

With a layout that kind of resembles the original Zelda, Paid to Kill lets players complete missions as a bounty hunger named Ramon Spectre.With a layout that kind of resembles the original “Zelda,” “Paid to Kill” lets players complete missions as a bounty hunger named Ramon Spectre.

Here's how Rovio describes Wolf Moon: Detective Janet Cain is bitten by a werewolf and has to flee into the howling wilderness.
Here’s how Rovio describes “Wolf Moon”: “Detective Janet Cain is bitten by a werewolf and has to flee into the howling wilderness.”

War Diary is a series of action-strategy games in which players build up armies and fight against each other.
“War Diary” is a series of “action-strategy games” in which players build up armies and fight against each other.

Rovio says this puzzle game, Darkest Fear, creates an atmosphere of intense horror that test(s) the nerves of even the most jaded player.
Rovio says this puzzle game, “Darkest Fear,” creates “an atmosphere of intense horror that test(s) the nerves of even the most jaded player.”

Rovio's description of Cyber Blood: Explore urban wastelands, boost your character with special weapons and modules in this thrilling action game.
Rovio’s description of “Cyber Blood”: “Explore urban wastelands, boost your character with special weapons and modules in this thrilling action game.”

Guide the Bounce ball through different surreal worlds, and finally free the world of Pongpingy from the rule of the evil Hypnotoid, Rovio says of Boing Voyage.“Guide the Bounce ball through different surreal worlds, and finally free the world of Pongpingy from the rule of the evil Hypnotoid,” Rovio says of “Boing Voyage.”


1


2


3


4


5


6


7


8

Espoo, Finland (CNN) — First, in 2009, there was “Angry Birds.” Then came “Angry Birds Seasons,” which put the birds in Christmas and other holiday scenes. Next was “Angry Birds Rio,” set in South America. Finally, “Angry Birds Space” — set, well, in space.

You get the point. Minus a few changes in scenery, all these wildly popular games from the Finnish company Rovio are essentially the same: Players slingshot disgruntled, wingless birds across a screen, hoping to take down the cartoon pigs that stole their eggs.

Meanwhile, Rovio has marketed “Angry Birds” cookbooks, theme parks, sweatshirts, plush toys, soda brands and a soon-to-be TV show based on this bird-pig drama.

In a business sense, it has worked. The apps have been downloaded 1 billion times, and 30% of the company’s revenue comes from toys and other items. In 2011, Rovio reported earnings of $106 million, which impressed some financial analysts.

But when will it finally decide to invent something new?

Maybe quite soon, Ville Heijari, Rovio’s vice president of franchise development, said in a recent interview at the company’s waterside headquarters in a suburb of Helsinki.

Photos: Inside the Finnish company that makes “Angry Birds”

Heijari said Rovio has exhausted nearly all its options for marketing those now-ubiquitous ticked-off avians. Now the company has a team of designers working to create new prototype games that could be the company’s sophomore franchise hit.

That will be no easy task. Rovio produced 51 failed apps and nearly went out of business before coming up with “Angry Birds” in 2009. The company was founded in 2003.

Rovio's Ville Heijari, outside the company's headquarters in Espoo, Finland.

Defectors aim to create next ‘Angry Birds’

Heijari wore a red “Angry Birds” sweatshirt to the interview, which took place in a room where cartoon birds and pigs were plastered on nearly every available surface.

He spoke with CNN about the company’s troubled history, its future and what makes “Angry Birds” so wildly popular with its fans. The following is an edited transcript:

CNN: How long have you been with Rovio?

Heijari: I’ve been here for a bit less than two years … I joined on board with the success of “Angry Birds.” And it kind of got out of hand. (laughs)

CNN: Has it been just wild to see it grow so quickly?

Heijari: About halfway through 2010, it started to feel like something really unique.

CNN: Were people surprised by the success?

Heijari: I don’t know. It felt like the game itself had a lot going for it. … The brand has started to live a life of its own. A lot of people who have become fans of the brand, they create all these different things. Lots of different fan art — like “Angry Birds” cakes. They create all different things around it. There are fan animations and so on. That has been the surprising part — the impact that it has had. The commercial success of just the game and products, that hasn’t been that surprising. It’s something we put a lot of work into. But then like everything else around it — that never stops to surprise you.

CNN: What’s the most interesting piece of fan art that someone sent in?

Heijari: One of the most memorable ones was a playable cake. So it was like an actual cake. It had a whole “Angry Birds” level made out of marzipan and waffles or something like that. Biscuits. And then there was an actual slingshot and you shot like birds into the cake to cut it into pieces I presume. That sort of imagination — it’s just somewhere out there.

The most surprising thing is how it’s everywhere. These things come from India and Malaysia and the Middle East. Of course, a lot of them (come) from North America. But from the most bizarre places in the world. The brand is somehow out there.

CNN: Can you give me a sense of what kinds of “Angry Birds” products are out there, other than the apps and online games?

Heijari: I would say that at this point we broadly have everything covered, but we’re still working on building up on that. For example, the theme park thing. We’re collaborating with this one theme park here in Finland, but then the whole point is how do we sort of create something that’s different from a traditional theme park. We’re actually working with a Finnish manufacturer called Lappset. They specialize in making outdoor sports and playground equipment. We’re thinking about how can we build activity parks. Kids play video games, but how can we also encourage them to move and exercise and so on? … How do we bridge the digital game experience with this physical location?

CNN: Is there anything you haven’t gone for? You have a TV show in production, right?

Heijari: I don’t think we have a pop song. (laughs) And I don’t think we necessarily want to go there. With the whole success of “Angry Birds,” we’ve started to reinvent ourselves as an entertainment company. We’re at this sort of crossroads. It’s like, OK, we have this successful game. So we could have easily started to create the next game, but instead we started building the brand and fleshing out the characters and running with that. How do we create a whole broad entertainment offering around this brand? We already do. We do games, we do animations, we do our own merchandise, we work with licensers to create more merchandise, and we have sort of accomplished all these things ourselves.

We already see ourselves as an entertainment company rather than a games studio.

CNN: Are there plans to develop another game?

Heijari: We actually just announced our next game, which is a property we purchased and are rebranding and are releasing pretty soon actually.

CNN: Can you tell me about it?

Heijari: It’s called Amazing Alex. It has this character who builds these chain reactions, like Rube Goldberg machines. It’s based on a really acclaimed game that released last year. We purchased the property. We really like the game. It was really successful, but it never got a big audience. So we acquired the property and we did some re-branding to make it, from our point of view, more universally appealing in a global perspective. Now we’re really excited to bring it again to the market. It was highly praised but it never got the audience it deserved. With the sort of audience we have for “Angry Birds,” we’ll see what we can do.

CNN: Are there plans for Rovio to develop its own new game? A non-”Angry Birds” game?

Heijari: Oh yes, we have projects in the pipeline. But nothing we can announce just yet.

CNN: When would you expect that game to come out?

Heijari: Still this year we will see more Rovio games. I can’t really talk too much about them at this point.

CNN: What’s the reason the company has waited so long to produce a second game — or a completely different kind of game from “Angry Birds”?

Heijari: The bulk of our work has gone into expanding on all fronts. And, unfortunately, our game studio started very small, and we have been hiring and building teams. We are building more efficient units to produce more games. We haven’t really wanted to rush the market or flood it with too many games. “Angry Birds” has been our top focus and top priority. And we don’t see them as disposable games. When “Angry Birds” was introduced and launched in December 2009, it had like 63 levels — 63 different puzzles. Now, just the original game, it has 250 or 300 levels. We’ve been bringing this free content — new updates, new themes, new secret levels to discover. From our point of view, it’s more of a service than just a game. Games and mobile games in particular have been accused of being cheap and sort of disposable, whereas console games are (seen as) infinitely more valuable. This digital distribution channel enables this: You can have a game that’s an ongoing service. You can keep playing it. You can keep it fresh, in that sense.

In 2010, “Angry Birds” was getting a lot of traction and momentum on the market. And then we released “Angry Birds Seasons” as a sort of spin-off product. The main reason was not like, “Hey, let’s milk more money from another game.” It’s more of a marketing thing. We wanted to make a game to create special things for Halloween, Christmas, Valentine’s Day, Easter and so on. But not all of those holidays are necessarily celebrated everywhere. We wanted to make a global brand. So in this way at least we give our consumers a choice. If they’re offended by something, they don’t have to purchase it.

CNN: What do you think is so compelling or so addictive about the game?

Heijari: It’s like a very, very direct experience. It’s direct controls and instant gratification. You get a sort of gut feeling. You get positive feedback from the game.

On top of that, you have characters. You have all the audio design and the visual design that’s sort of — it’s easily approachable but still it has a quirky personality.

If you have family-oriented entertainment properties, everything is often like supercute and it doesn’t necessarily have like any kind of edge to it. But our birds are angry. It’s different in that sense.

CNN: Who came up with that idea, that the birds would be angry?

Heijari: It was one of our game designers, Jaakko Iisalo. He had a concept. The game concept was a bit complicated but he had the characters in a really rough sketch form. Everyone looked at the sketch and said, “Hey, forget about the game concept, but who are these guys?” It was a really crude sketch with a lot of energy going on — dust clouds going on. Everybody got a really positive feeling. “Let’s use these characters. They look grumpy enough to destroy something.”

CNN: Did the characters go through different versions?

Heijari: A usual Rovio mobile title took about three or four months to develop. “Angry Birds” took like eight months, so it went into different iterations and polishing.

CNN: I heard there wasn’t a slingshot at the start.

Heijari: Yeah, the slingshot wasn’t there at the beginning. The designers were doing a lot of play testing and people — that’s like one of the key things — people started the game and you had just like birds huddling in the grass. And people were like, “What do I do?” And you were supposed to just, like, flick them somehow. It was easy, but people still had trouble grasping what you had to do immediately. So then the designers added the slingshot.

They thought, well, everybody knows how to use a slingshot. You just pull back.

CNN: Were other animals ever tried?

Heijari: It was always the birds. Then the pigs, they just sort of evolved out of necessity, to have some sort of opponent (for the birds). But the birds were there from the very beginning.

CNN: So the backstory came after?

Heijari: Yeah. And that backstory (that the birds are angry because the pigs stole their eggs) was also necessary. Like, why are the birds angry?

CNN: Were the birds always angry? Were they ever goofy?

Heijari: Yeah, in the first sketch they were like really grumpy looking.

CNN: Rovio had a whole bunch of failed apps before “Angry Birds.” Can you tell me about those?

Heijari: The apps themselves were failures, but the mobile market was a lot different in the early ’00s. Rovio was founded in 2003, and from 2003 to 2008 all development was basically focused on Java games, for more primitive mobile phones. That market was very difficult. There wasn’t a unified marketplace, like what Apple has built for the iOS. Instead, you had to work with operators. You had to work with mobile phone manufacturers. For instance, operators wouldn’t do business with game developers unless you had a massive portfolio of games to sell. If you say, “Hey, I have this one really successful game.” They’re going to say, “Nobody’s buying this. We need like 12 games.”

You didn’t have direct contact with your audience. You had complete sort of dictatorship on the marketplace. It was just really difficult. So I would say in those terms there were a couple of games that weren’t like — I wouldn’t call them failures. There was a series of games called Bounce. These games were preloaded on Nokia devices. In total, during the years, all these different bounce games were installed on over 200 million Nokia phones. That was the era of doing contract work. “Hey make a game for our device and then we will install it on the device.” … It’s another discussion of whether people even discovered the games that were on their phones.

CNN: But Rovio was in a pretty bad spot, right, when “Angry Birds” hit?

Heijari: That’s true. Financially, of course, the marketplace was difficult and the business was likewise difficult. Around the end of 2008 we had to ramp down the Java development. It just wasn’t a feasible business anymore.

CNN: Were there layoffs?

Heijari: At the peak there were 55 or 60 people working at Rovio. And in 2009, when “Angry Birds” started, there were 12 people. So it wasn’t that rosy at the moment.

CNN: Did the company almost fold? Did people think about not pushing forward?

Heijari: If “Angry Birds” wouldn’t have been successful, there would have been a number of questions of whether it makes sense to continue.

CNN: How many people are at the company now?

Heijari: 350.

CNN: With some tech companies people start to wonder if they can be as innovative once they grow — that maybe it’s easiest to come up with new ideas when it’s just a small group of people. That it’s harder to come up with the next thing.

Heijari: It raises questions, like how do you grow without becoming too bureaucratic, and how do you react as quickly as you used to. I would say that what we have is very small tight-knit creative teams that work on different things, for instance new game prototypes.

Ideas still spark from these small teams and that kind of environment. There’s this anything-goes attitude. Instead of locking people down with guidelines — like, no, we only do this thing from now on — we have a lot of different things going on to keep up.

CNN: How small are those groups?

Heijari: Anything from four to 12 people. Teams have their own spaces and small clusters.

CNN: Have people here been able to enjoy the financial success Rovio has had? Or do they still live like it’s a small, up-and-coming company?

Heijari: We’re still building — building the company. So I would say that a lot of the financial success goes into investing for the future.

CNN: So no Bentleys in the parking lot?

Heijari: I don’t think I’ve seen any.






Share this on:

Wii U, mobile games will be headliners at 2012 E3 expo

Ever since the Super Nintendo Entertainment System emerged in 1991 to replace the original Nintendo, console game lovers — including owners of Sony PlayStations and Microsoft Xboxes, which came later — have willingly upgraded their gaming systems with each advance of technology.

Along the way, spending on video games has grown from less than $6 billion annually in the early ’90s to about $25 billion last year, estimates the Entertainment Software Association.

Nintendo is expected to unveil details and games for its successor to the Nintendo Wii, the Wii U, at the Electronic Entertainment Expo, the video game industry’s largest U.S. showcase, which begins Monday in Los Angeles. Yet regardless of its yet-to-be-announced price and release date, the Wii U will arrive at a time of uncertainty for the industry, which has seen much of its recent growth come from beyond the traditional console video game market.

The “free” price tag is the biggest selling point for tens of millions of players who have gravitated to mobile and online games played on smartphones, tablets and Facebook — instead of buying a standalone game console for about $300 plus $50-$60 a pop for games.

Once players sample games such as the Facebook favorite FarmVille and smartphone hit Temple Run, they tend to plunk down a few dollars to get in-game upgrades and perks. That spending added up to nearly $4 billion last year, and could rise 8% this year, according to PricewaterhouseCoopers.


Upcoming coverage of E3 2012

Monday: Live blog coverage of the Microsoft, Electronic Arts, Ubisoft and Sony press events at our Game Hunters blog , along with live video from Spike.

Tuesday: Live blog coverage of the Nintendo press event and other E3 news, along with live video from Spike.

Wednesday and Thursday: Reports from E3 including the latest on Halo 4, Call of Duty: Black Ops 2 and celebrities.

More: See our complete coverage of E3 2012

And the ease of play has powered the overall growth of the video game-playing audience. The number of people who say they play games for at least one hour each month has more than doubled to 135 million from 56 million in 2008, according to Parks Associates. The number could grow to as many as 180 million players of all types of games in the U.S. by the end of 2015, forecasts market intelligence firm IDC.

“That (ease) is what is expanding games to a whole new audience, because now there is not a barrier except to press ‘Start,’ ” says Gordon Bellamy, executive director of the International Game Developers Association.

But Nintendo, Microsoft and Sony are facing unprecedented challenges to their console businesses. Traditional game retail sales dropped from about $10 billion in 2009 to $8.8 billion in 2011, according to an analysis by market tracking firm The NPD Group and Ipsos MediaCT for the ESA. About another $6 billion was spent on game consoles and handheld devices.

Despite the arrival of a new Nintendo system, total sales of systems and games will likely decline 4% to 6% in 2012, analysts say.

“Our industry is having a minor identity crisis,” says EEDAR analyst Jesse Divnich. At the upcoming E3, “it is imperative” that companies such as Microsoft and Sony “justify why consumers should spend upwards of $60″ on traditional disc-based high-definition video games.

Meanwhile, digital sales of games, which increased from $5.4 billion in 2009 to $7.3 billion in 2011, are expected to keep rising. While downloads of traditional video games for consoles and subscriptions to services such as Xbox Live make up part of that growing digital pie, the bulk of it is money spent on smartphone games and purchases inside Facebook games.

For players, that means a variety of games to choose from. “People want to play when they want and where they want and for however much they want,” Bellamy says. “That price could be free, it could be a buck, $60 or $100. But there’s choice.”

And console makers intend to remain part of the mix, too.

Where gaming is headed

As the transition to the next-generation of consoles begins, hardware makers are already showing signs of where the future of home gaming is headed — taking some cues from the upstart mobile and online game world:

Innovation in game play. The Wii U, first out of the blocks and likely to get the most buzz at E3, has a new wireless tablet-shaped controller with a touchscreen and traditional game controls that allow expanded game-play options. For instance, players can tilt the new motion-sensitive control tablet’s screen to make on-screen characters move — just like an iPad.

The tablet, which can also be used as a map for exploring what is on the big screen, will serve as a window to a game world that exists virtually beyond the TV screen — around you and above you. “The focus will be on new ways to play games,” says Geoff Keighley, host of Spike’s GameTrailers TV.

Like the PlayStation 3 and Xbox 360, Wii U will render games in high definition, an improvement over the current Wii.

The original Wii was an innovator not that long ago. It made motion-sensing games popular, and about two years ago, Sony and Microsoft each released their own gesture-based controllers, the Move for the PS3 and the hands-free Kinect for the Xbox 360.

So you can expect motion to play a part in the next generation of game consoles. But new systems need gotta-have games to drive sales. “What is the Wii Sports or Wii Fit for the Wii U?” Keighley says. “We haven’t seen that game that will cross over to the mainstream — and hopefully it will debut at E3.”

Being social and connected. Nintendo also needs to show that the Wii U will keep players linked into social networks such as Facebook and Twitter, as well as serve up additional content such as TV and movies.

Last week Microsoft added Amazon Instant Video to Xbox Live’s available apps, including HBO Go and ESPN. The PS3 already had that as well as NFL Sunday Ticket, which costs but gives you viewing access to every game except in your local market. Each has extensive on-demand movie and TV libraries. All three current game systems let users stream Netflix and Hulu videos.

“This generation of consoles has really grown to be the entertainment hubs in the home,” says Michael Gallagher, president of the ESA, which operates the E3 convention. “We expect to hear more about further growth in that area, which is a great opportunity to gain the mindshare of most consumers.”

Electronic Arts has added social connectivity into games such as Need For Speed, letting players post top scores, videos and challenges to friends. Also in the works, a Battlefield 3 Premium service that gives early access to new multiplayer levels for subscribers and increased customization for online soldiers and platoons — something similar to Activision’s Call of Duty Elite service, which has free features and a $50 annual tier, with Facebook and smartphone apps. “Any developer or publisher that isn’t thinking about how to incorporate these changes into their games will be left behind,” says Laura Miele, group vice president of marketing for the EA Games label.

Tapping into mobile games. People spend as much or more time playing video games, across all devices, as they do streaming TV, movies and other video to devices, a new PricewaterhouseCoopers survey found. “It has become a pastime and much more mass market,” says Lori Driscoll, a director at the consulting firm.

Now that consumers are used to playing games on smartphones and tablets, they want a consistent experience across devices, Driscoll says.

Sony comes closest to accomplishing that today with its MLB 12: The Show baseball game, which can be played and synced on the PS3 and the PlayStation Vita handheld. The evolution of that synergy — Nintendo perhaps using the Wii U and 3DS handheld; Microsoft with new Windows 8 phones — will help drive industry growth, Driscoll says.

Also bringing in more players are new “freemium” games that can be played for free but offer advantages to payees and subscription models — for physical rentals from GameFly to streaming games from new companies such as OnLive. The game industry “is going to explode,” she says. “I think we are going to see it go up over time.”

Keeping longtimers happy

While the top game companies must give a nod to the newer trends in gaming, they cannot forget the longtime core audience. In the case of Nintendo, it should lean heavily on its strength, “their own intellectual properties such as Mario, Zelda and Donkey Kong,” says Divnich. “They really need to convey that if you want the true and unique Nintendo experience, it is only available on their platforms.”

Wedbush Securities analyst Michael Pachter agrees that longtime Nintendo supporters should be the target audience for the Wii U. “The Wii U is not likely to generate the same magical response among non-traditional gamers as did the Wii,” he says. “These gamers have moved on to social games, tablet and smartphone games, or gave (Wii) up as a fad, and are unlikely to be won back.”

Microsoft and Sony are expected to tout new games such as Halo 4 and The Last of Us for the Xbox 360 and PlayStation 3, respectively, rather than announce that new systems are in the works. “They are going to do everything they possibly can do to make you think we are not in a transition,” says Morgan Webb, who co-hosts G4′s X-Play series.

Free-to-play online and mobile game developers and companies will have a major presence at E3 for the first time. Zynga will be there, as will social game network GREE, which last month acquired the mobile game studio Funzio (Kingdom Age, Crime City and Modern War). Wargaming.net (World of Tanks) will be showing off upcoming free-to-play games World of Tanks and World of Battleships.

Having those mobile and online games under the same roof at the L.A. Convention Center will only make clear that not all games are created equal, says Jack Tretton, president of Sony Computer Entertainment America. “These aren’t your fly-by-night, soon-to-be-on-smartphone games. These are $40 million, two-years-in-the-making games. Everything is not becoming Angry Birds.”

Nikon D4: New king of the DSLR hill

The more we shot with the camera, the more we were impressed with how easily it juggles priorities that, just a few years ago, seemed worlds apart. There are certainly better (and cheaper) options if you just want to shoot video, but the D4 is able to capture both video and still shots in light conditions most other cameras simply can’t.

At $6,000 body-only ($2,500 more than the Canon 5D Mark III) the Nikon D4 is not going to be the first choice for most videographers on a budget. For the ever-converging world of media, though, it’s certainly going to appeal to those who need to get their message across multiple platforms. Simply put: if you need a device that does stills and videos at a pro level with pro-level control, the D4 is the best we’ve seen to date.

NASA, college gear up for Venus transit webcast

In partnership with NASA and the International Space School Education Trust, Columbus State University’s Coca-Cola Space Science Center (CCSSC) is hard at work gearing up for a can’t-miss webcast of the transit. In order to get the best images possible, it is sending teams around the world to capture the event. In the United States, scientists will be stationed in Georgia and Utah. Other teams will be sent abroad to Alice Springs in Australia and deep into the Mongolian Gobi Desert.

The CCSSC has been planning its event coverage for more than a year, and there’s only one chance to get this right. From the satellites to geographically diverse teams, all the pieces need to fall into place and work

Article source: http://rssfeeds.usatoday.com/~r/usatoday-TechTopStories/~3/T8rT3gXv-9Y/1