Search This Blog

24 March 2011

Light and pressure activated animations

So today we were tasked with making a Light interactive flash app. I missed last week so I need the script for flash. I am using Flash CS5 Action Script 2.0

It is as follows:


onClipEvent (enterFrame) {
if (!Key.isDown(80)){
_root.play();
}
}

so that means if key 'P' is pressed, the movie plays.
We have a image of TNT and when the image plays, the timer counts down from 10, then there is an explosion. Pretty simple but this is the first project we have completed.

Then we have to set up a light sensor. A simple light sensor, taped up to two cables. They would be connected to a port and then put into the computer. The sensor would be placed in the end of a biro pen with a small hole cut in it to allow a small amount of light in. 
Then we have a laser which will be pointed at the sensor. When the beam is broken, the animation plays. Simples!

I'm going to get the other Action Scripts and post them here. So there will be pressure sensitivity, camera and sound interaction. Just for reference :)

Edit: It works!!
See below!

The final animation







This is the tool which we plugged
the light sensor into.
It goes into USB.
The business end of the same object
it has a midi port.

This is the 'laser' we used. A simple light pen.
It took ages to align it with the light sensor.
It was taped down well
The light sensor
The light sensor in action. It is inside the pen cap
and taped to the leg of a table
Guy setting up the laser pen


_______________________________________________________________________________

The week before I was away, however the group informed me that we were tasked with creating a pressure activated animation. As our group has an odd sense of humour, they chose to have Bella (from that gawd-awful Twilight Book and Movie series) which you can 'punch in the face' by hitting the pressure pad.

The set-up was the same (sensor attached to that USB-chip thing) with the same coding.


onClipEvent (enterFrame) {
if (!Key.isDown(80)){
_root.play();
}
}

Now obviously the pressure pad is assigned to P

--The general idea here was to have two pressure pads, one would be for each side of the face. When you press the left pad the animation (getting more and more beaten up and bruised) would advance by one frame, and likewise for the right pad and the right side of the face animation. We had several problems trying to implement this: the first is that we could not get hold of two pressure pads. Secondly, we could not get the animation to advance by one frame only. Thirdly, the sound effect we wanted to add to the code, would not play once, it would play constantly.

10 March 2011

Video Activated Animations

This week we were tasked with having a action activated animation. The group agreed on Guys idea of movement activating the music to Keyboard Cat and when you move too much, you get rick roll'd.
Again, this didn't get completed.

Elliot and I tried to get it done at home, but by the time we got back, we couldn't work out what we had done in the lesson so we couldn't do it.

We need the basic code!

--The problem has tended to be that none of us are experienced enough with flash to achieve what we set out to do. The animation takes up the entire lesson to get completed and then the original code that was going to be used doesn't fit anymore, either because the project has become slightly too complex or the was an error in the class that we failed to spot.

Sound Activated Animations

On the first week, our group was tasked with creating an animation which was activated by sound. The group idea was a roller-coaster which got faster the louder you got. Due to some issues, the initial animation never got coded this lesson.

Our group is:
Myself
Elliot Walby
Harry Jenkins
Richard VanVilet (Henry)
Guy Yates

--The idea was to have the animation change according to the amount of sound picked up by the microphone. The man in the roller-coaster would scream/look more and more terrified, the louder it was. The coding for this proved tricky as the animation was on several different layers and we weren't able to influence them separately.