Wednesday, 10 February 2010

Web Page Design for Designers (Beginners)


I first came across this site when I was still a student myself. Albeit a final year degree student. At the time it held some valuable insights for me as a newbie to web design. I was therefore very pleased to find that although the site has been re-designed, a full archive remains of all the articles since 1998.

Although technology has changed somewhat since 1998, the basics of web page construction (HTML, basic principles of good graphic design etc) have not really changed. Consequently this site makes a great place for any web design beginner to start.

While it won't tell you much about the how it will help you a lot with the what and why, and that - let's face it - is where most wannabe web designers fall short. Too much time in the early days is spent learning the technology and not enough time on good design (how to use the technology well).

So web design beginners - start here >

Thursday, 21 January 2010

Play/Pause Button

On some players, when you click play, it turns into a pause button, and then when you click pause, it turns into a play button.

But how can you do this in Flash?

The code is below, but you need to also make the button. So code first, then how to make the button:

var pausestatus = 1;
var position = 0;

_root.playpause_mc.onPress = function () {
if (pausestatus == 0) {
audio_sound.stop();
position = (audio_sound.position/1000);
_root.playpause_mc.play();
pausestatus = 1;
}
if (pausestatus == 1) {
audio_sound.start(position);
_root.playpause_mc.play();
pausestatus = 0;
}
}


The Button

The idea is that we make a button that can change its appearance, not just on rollOver, but depending on whether the sound is playing or not.

There is no automatic function for this in Flash, so we have to write a short ActionScript to do it (see above). But we also need to set-up the buttons so the ActionScript has something to work with.

Here's how:

Make 2 buttons of the same size, with the registration point in the same place for each one. One of the buttons needs a play symbol on it, the other needs a pause symbol.

Then make a MovieClip. The clip needs to have 2 keyframes each with a stop action. Place the play button on the first keyframe, place the pause button on the second keyframe. Make sure they are in the same place, so as you flick from frame to frame the button appears to stay still, and only the icon changes.

On the stage, give the MovieClip the instance name of 'playpause_mc'.

Finishing Up

Add the ActionScript to the first keyframe of the main timeline, and test the movie (CTRL+ENTER).

When you click the button, the icon should appear to change, when you click it again, it should appear to change back.

This is because of this line in the actionscript above:


_root.playpause_mc.play();


In effect, by clicking the playpause_mc MovieClip we tell the clip to move from its first keyframe to its second - the MovieClip plays, it moves to the next frame, but the stop(); action on the next frame stops it - then when we click again we play again, but because there are only 2 frames, so we go back to the first frame.

In this way we switch between the icons.

The rest of the code allows the button to have 2 purposes.

Normally, 1 button 1 purpose. A play, a pause, a stop, a rewind, you get the picture. But this time, we want the same button to play AND pause.

For this reason we have to use an IF statement in our code. We only want the MP3 to start playing IF it is currently stopped. We only want the MP3 to stop playing IF it is currently playing.

The way we do this is to use a variable called pausestatus:


var pausestatus = 0;


In this case 0 means NOT paused and 1 means IT IS paused. Because when we first begin there is NO MP3 playing, we set this variable to 1 - paused - not playing.

When we press the button the first time, we start the MP3:


audio_sound.start(position);


But we also change the value of the pausestatus variable, to tell the script that we are now playing:


pausestatus = 1;


When we pause, we change it back.

By doing this we can then use the pausestatus to decide what we want the button to do when we click it.


if (pausestatus == 0) {
//DO SOMETHING
}
if (pausestatus == 1) {
//DO SOMETHING ELSE
}


Thats the logic.

Get back to me if you have any questions.

Please note, this is not all the code you need for the MP3 player, you still need the menu to choose your track. This just covers play/pause button.

Thursday, 31 December 2009

Happy New Year Students

Here's to a prosperous 2010. A year in which you all get the Higher Education places that are right for you. A year in which things click into place. A year in which you work hard, learn hard and achieve the best you can (the very best you can).

Happy New Year

Thursday, 17 December 2009

How much are your short films worth?

You think it's just the video production unit, you think it's just the 3D animation unit. It may be that to you but, I suggest, it is whatever you make it.

Consider the success of Fede Alvarez, an inexperienced movie producer from Uruguay, who on a tiny £186 budget and with a few others made a 5 minute short, uploaded it to YouTube, and then got offered a $30 million contract to make a Hollywood film.

More on the BBC here: http://news.bbc.co.uk/1/hi/technology/8417789.stm

You can watch the short on YouTube: http://www.youtube.com/watch?v=-dadPWhEhVk



I have thought it, and said it, and I will say it again. The thing that lets most of my students down is not potential, it is lack of effort in realising that potential. I'm not saying that getting a $30 million contract because of your YouTube video happens very often (or ever before), but I am saying you can take your work more seriously. Some of you have won competitions with your work, and yet still fail to remain positive and motivated. What is that all about?

I say, work hard, commit the time, the effort, and then reap the rewards. And that means staying positive and staying motivated.

It's not just the video or 3D animation unit. And the upcoming units are not just web design or just interactive media. Each one is a chance to be your best, and make something that will make others sit up and take notice.

You may not get $30 million, but you can make people take notice enough to give you that university place, take notice enough to offer you your first design job, that promotion.

You may not get $30 million but you can succeed in education and make it in a fruitful and fullfilling creative career.

There are no just units. Each on is an opportunity to show off the very best you can do.

Monday, 7 December 2009

Fading Carousel

The following code supports a fading carousel, allowing you to create a method of looping through a selection of images and fading between them.

Code


var fademode = 0;
var currentt = 1;
var maxt = 3;
var fadespeed = 10;
this.tholder_mc.loadMovie("t" + currentt + ".swf");

this.left_btn.onPress = function () {
if (currentt <= 1) {
currentt = maxt;
} else {
currentt -=1;
}
fademode = 1;
}
this.right_btn.onPress = function () {
if (currentt >= maxt) {
currentt = 1;
} else {
currentt += 1;
}
fademode = 1;
}
//fading
onEnterFrame = function () {
if (fademode == 1) {
//do some fading out
if (this.tholder_mc._alpha > 0) {
this.tholder_mc._alpha -= fadespeed;
}
if (this.tholder_mc._alpha <= 0) {
this.tholder_mc._alpha = 0;
this.tholder_mc.loadMovie("t" + currentt + ".swf");
fademode = 2;
}
} else if (fademode == 2) {
// do some fading in
if (this.tholder_mc._alpha < 100) {
this.tholder_mc._alpha +=fadespeed;
}
if (this.tholder_mc._alpha >= 100) {
this.tholder_mc._alpha = 100;
fademode = 0;
}
}
}



Questions?

For further information contact your tutor.

Two Way Sliding Carousel

As an animation tool Flash makes linear animations really easy just using the timeline. But what if you want animation to run in both directions in response to user input?

There are of course many approaches that can be taken, but here follows the approach used in our online gallery.

The Approach

The main principle behind this interface is to reduce the burden of administration. We don't want to have to do masses of timeline editing just because some of the items in the carousel change.

The other principle is that while the animation can be linear, we can mimic, or fake a two way animation by spliting the animation in half, and using actionscript to jump around the timeline. Thus, the visual effect is uninterupted interactive animation for the user, though the reality is that we are jumping around the timeline.

The Logic

The logic that makes this possible comes from understanding that we can repeat the same piece of animation over and over, but change the item that is being animated using actionscript.

We do this by making a movieclip, that contains a movieclip of a carousel item sliding along. Then we use arrows to tell the movieclip to play (thus making the carousel item slide). At a certain point in the animation, when the item is off the screen we use actionscript to change the item, so that when the animation completes and the carousel item returns to the screen, a different item is displayed.

We do this by telling the movieclip to change the item at certain stages in the timeline using loadMovie.

The Code


var artifact = 0;
var maxartifact = 20;

_root.next_but.onRelease = function () {
if (artifact <= (maxartifact-1)) { artifact +=1; } else { artifact = 0; } artspot_str = "butset" + artifact + ".swf"; _root.aniartholder_mc.gotoAndPlay(11); } _root.prev_but.onRelease = function () { if (artifact >= 1) {
artifact -=1;
}
else {
artifact = maxartifact;
}
artspot_str = "butset" + artifact + ".swf";
_root.aniartholder_mc.gotoAndPlay(30);
}


This is the main engine to make the buttons trigger the animations, and to make the timeline update the carousel item.

Within the timeline, the code to make the carousel update is as follows:


//Increment
_root.aniartholder_mc.artholder_mc.loadMovie(_root.artspot_str,"GET");
gotoAndPlay(1);


And:


//Decrement
_root.aniartholder_mc.artholder_mc.loadMovie(_root.artspot_str,"GET");
gotoAndPlay("prev");


See you tutor for further instructions.

Saturday, 21 November 2009

Hero Help

I'm one of those people who thinks that we all need heroes in our lives. Heroes inspire us, they show us where we can be better, they show us that things we thought were impossible are in fact within our grasp, and they teach us what we need to do to grasp them.

One of my heroes is my Father for many reasons, but one thing I will mention here - he worked hard to support his family, even doing honourable jobs he didn't enjoy because he took his responsibilities seriously. I hope some of that has rubbed off on me. That's what heroes do for us, we hope that by being associated with them that we will be better.

Since you are currently studying 3D animation you might like to become aquainted with some of the heroes of animation. I hope that some of these will inspire you to be better. Better at animating, and better all round.

You can find out more on the Disney Legends website here:

http://legends.disney.go.com/legends/index

One thing they all have in common, like my Dad, not one of them took the easy way out, and that's how they earned hero status. Heroes are not made by looking for the easy path - work hard and one day you may inadvertently be a hero to someone else.

Just remember, it's not about where you are or where you started, it's all about where you are headed. Work to get a little better each day and you will get there.