Showing posts with label interactive design. Show all posts
Showing posts with label interactive design. Show all posts

14.12.07

An Experiment in Particles

A simple experiment into a particle explosion that I thought would be interesting to create in search for ideas surrounding the project.

View my cursor explosion here.

View my firework explosion here.

Code:

Moon Orbit

This project is in continuation of a tutorial of Flash AS 2.0 using some AS 3.0 practices given to us by Anna.

Essentially the tutorial was to create a moon orbiting the Earth within Flash.

I thought it would be interesting to extend this to being able to play with the settings that determine the orbit trajectory while the file is playing. I allowed the user to change the numbers that govern the trajectory, speed with the inclusion of the Earths own orbit.

Please view here.

This was a fun excursion into some techniques I hadn't before tried. For example the inclusion of the components that Flash offers as default in order to control the settings of the orbits.

Code:

angle = 0;
centerX = stage.width/2;
centerY = stage.height/2;
centerpos = {_x:300, _y:250};
i = 1;
earthSpeed = earthSpeed_com.value;
moonSpeed = moonSpeed_com.value;
earthXRadius = earthXRadius_com.value;
earthYRadius = earthYRadius_com.value;
moonXRadius = moonXRadius_com.value;
moonYRadius = moonYRadius_com.value;
var earthSpeed_com:mx.controls.NumericStepper;
var moonSpeed_com:mx.controls.NumericStepper;
var moonXRadius_com:mx.controls.NumericStepper;
var moonYRadius_com:mx.controls.NumericStepper;
var earthXRadius_com:mx.controls.NumericStepper;
var earthYRadius_com:mx.controls.NumericStepper;
var nstepListener:Object = new Object();
nstepListener.change = function(evt_obj:Object) {
trace("Value changed to "+evt_obj.target.value);
earthXRadius = earthXRadius_com.value;
earthYRadius = earthYRadius_com.value;
moonXRadius = moonXRadius_com.value;
moonYRadius = moonYRadius_com.value;
earthSpeed = earthSpeed_com.value;
moonSpeed = moonSpeed_com.value;
};
earthSpeed_com.addEventListener("change",nstepListener);
moonSpeed_com.addEventListener("change",nstepListener);
moonXRadius_com.addEventListener("change",nstepListener);
moonYRadius_com.addEventListener("change",nstepListener);
earthXRadius_com.addEventListener("change",nstepListener);
earthYRadius_com.addEventListener("change",nstepListener);
var moon_mc:MovieClip = _root.attachMovie("moon_mc", "moon_mc", i, centerpos);
i++;
var earth_mc:MovieClip = _root.attachMovie("earth_mc", "earth_mc", i, centerpos);
earth_mc.onEnterFrame = function():Void {
this._x = 300+Math.cos(angle)*earthXRadius;
this._y = 200+Math.sin(angle)*earthYRadius;
angle += earthSpeed;
earthpos = {_x:this._x, _y:this._y};
i++;
var trail_mc:MovieClip = _root.attachMovie("earth_mc", "earth_mc", i, earthpos);
trail_mc.onEnterFrame = function() {
this._alpha -= 1;
this._xscale -= 2;
this._yscale -= 2;
if (this._xscale<=0) {
this.removeMovieClip();
}
};
};
moon_mc.onEnterFrame = function():Void {
this._x = earth_mc._x+Math.cos(angle)*moonXRadius;
this._y = earth_mc._y+Math.sin(angle)*moonYRadius;
angle += moonSpeed;
moonpos = {_x:this._x, _y:this._y};
i++;
var trail_mc:MovieClip = _root.attachMovie("moon_mc", "trail_mc", i, moonpos);
trail_mc.onEnterFrame = function() {
this._alpha -= 0.75;
this._xscale -= 2;
this._yscale -= 2;
if (this._xscale<=0) {
this.removeMovieClip();
}
};
};

The Big Box

The 500x500 banner was always the one I dreaded the most. My first plans for it were lending towards a dress up droll style game. However during the time I spent creating the other two banners I came to realise that I didn't think it was a worthy exploration. So instead I turned my attention towards a mini version of the Marvel digital comics comic viewer. A mini flash application that lets you read a sample comics. Roughly about 5 pages long each page is 100k and loaded as and when the user requests the page. I can't show you how it works here so you'll have to make do with some screen shots. It's unfortunate but I just don't have the web space that is required in order to uploaded the various different files that this banner uses.

sample sample2

This was a good project, even if it didn't entirely succeed, which can be read about in my evaluation (to follow sometime shortly).

The reason I'll label this as a decent attempt is simply that it taught me some incredibly useful techniques that I just hadn't grasped before, in particular setting off functions in a different manner and the use of XML within Flash.

 

Code:

//xml
function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        image = [];
        description = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
            description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
        }
        firstImage();
    } else {
        desc_txt.text = "unable to find file!"
        content = "file not loaded!";
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
//variables
//listeners
listen = new Object();
listen.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
        prevImage();
    } else if (Key.getCode() == Key.RIGHT) {
        nextImage();
    }
};
Key.addListener(listen);
//buttons
reAlign_btn.onRelease = function(){
    reAlign();
}
previous_btn.onRelease = function() {
    prevImage();
};
next_btn.onRelease = function() {
    nextImage();
};
sizeInc_btn.onRelease = function() {
    sizeInc();
};
sizeDec_btn.onRelease = function() {
    sizeDec();
};
panRight_mc.onRelease = function(){
    picture._x += 20;
}
panLeft_mc.onRelease = function(){
    picture._x -= 20;
}
panDown_mc.onRelease = function(){
    picture._y += 20;
}
panUp_mc.onRelease = function(){
    picture._y -= 20;
}
//object functions
p = 0;
this.onEnterFrame = function() {
    filesize = picture.getBytesTotal();
    loaded = picture.getBytesLoaded();
    preloader._visible = true;
    if (loaded != filesize) {
        preloader.preload_bar._xscale = 100*loaded/filesize;
    } else {
        preloader._visible = false;
        if (picture._alpha<100) {
            picture._x = (Stage.width / 2) - (picture._width / 2);
            picture._alpha += 10;
        }
    }
};
//functions
function beginDrag() {
    picture.startDrag(true);
}
function endDrag() {
    picture.stopDrag();
}
function nextImage() {
    if (p<(total-1)) {
        p++;
        if (loaded == filesize) {
            picture._alpha = 0;
            picture.loadMovie(image[p],1);
            desc_txt.text = description[p];
            picture_num();
        }
    }
}
function prevImage() {
    if (p>0) {
        p--;
        picture._alpha = 0;
        picture.loadMovie(image[p],1);
        desc_txt.text = description[p];
        picture_num();
    }
}
function firstImage() {
    if (loaded == filesize) {
        trace('done');
        picture._alpha = 0;
        picture.loadMovie(image[0],1);
        desc_txt.text = description[0];
        picture_num();
    }
}
function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
}
function sizeDec() {
    picture._xscale -= 15;
    picture._yscale -= 15;
}
function sizeInc() {
    picture._xscale += 15;
    picture._yscale += 15;
}
function reAlign() {
    picture._xscale = 100;
    picture._yscale = 100;
    picture._x = (Stage.width / 2) - (picture._width / 2);
}

The Final Landscape Banner Design

After the excessive amount of time wasted on making lightning (as far as the progress of this project goes) I finally came up with this small and efficient little banner. It does the job, which is all I think in the end it needs to do. I'm glad I looked into the lightning since I feel it pushed my knowledge of Action Script forward but in the end I'm more pleased with this than any other attempt.

Please view it here.

Lightning

This is going to be the hardest. My intention is to have the lightning striking outwards from the finger tips of the users flash cursor and for the lightning to strike areas of the stage. However, in practice I've come to realise this to be far too hard.

The following are some of my attempts, and some of my failures. However, this has been one of the most rewarding experiments I've ever attempted. This is AS that I've never attempted before and the results were actually quite pleasing, if not what I'd attempted for at first.

It has to be said that I spent far too much time on this aspect of the project getting far too involved with code that I knew from the offset would ultimately be too far from reach.

The actual design I went with for this landscape banner is entirely different, simpler and after much deliberation, preferable.

The following are links to the hosted SWF files. At the very end of the post will be listed the code I used to get this effect.

Working lines.

Creating a moving lines.

The final attempt with some effects thrown in for good measure.

//////////////////////////////////////////

//Sorry for the formatting, Flash won't format my code properly.

//the simple code

i = 0;
fscommand("allowscale", "false");
onEnterFrame = function () {;
var line_mc = attachMovie("line_mc", "line_mc", i);
i++;
xpos1 = _root.circle1_mc._x;
ypos1 = _root.circle1_mc._y;
xpos2 = _root.circle2_mc._x;
ypos2 = _root.circle2_mc._y;
xscale = xpos2 - xpos1;
yscale = ypos2 - ypos1;
line_mc._x = xpos1;
line_mc._y = ypos1;
line_mc._xscale = xscale;
line_mc._yscale = yscale;
};

//the more complicated code

i = 0;
xPlace = 90;
yPlace = random(160);
bolt = function () {;
p -= 5;
p = 50;
glowXScale = 200;
glowYScale = 200;
for (i = 1; i < 70; i++) { ;
circle1_mc.removeMovieClip();circle2_mc.removeMovieClip();//line_mc.removeMovieClip();
circle1Place = {_x: xPlace, _y: yPlace};
var circle1_mc = attachMovie("circle_mc", "circle1_mc", i, circle1Place);i++;
var glow_mc = attachMovie("glow_mc", "glow_mc", i, circle1Place);i++;
circle1X = circle1_mc._x;
glow_mc._xscale = glowXScale;
glow_mc._yscale = glowYScale;
glowXScale -= 15;
glowYScale -= 15;
newPos = {_x: xPlace+p, _y: random(40)+10};
var circle2_mc = attachMovie("circleblue_mc", "circle2_mc", i, newPos);i++;
xPlace = circle2_mc._x;
yPlace = circle2_mc._y;
var line_mc = attachMovie("line_mc", "line_mc", i);i++;
xpos1 = _root.circle1_mc._x;
ypos1 = _root.circle1_mc._y;
xpos2 = _root.circle2_mc._x;
ypos2 = _root.circle2_mc._y;
xscale = xpos2 - xpos1;
yscale = ypos2 - ypos1;
line_mc._x = xpos1;
line_mc._y = ypos1;
line_mc._xscale = xscale;
line_mc._yscale = yscale;
//
p -= 5;
xPlace = 1;
yPlace = random(50)+25;
p = 50;
glowXScale = 200;
glowYScale = 200;
};
for (i = 1; i < 50; i++) { ;
circle1_mc.removeMovieClip();circle2_mc.removeMovieClip();//line_mc.removeMovieClip();
circle1Place = {_x: xPlace, _y: yPlace};
var circle1_mc = attachMovie("circle_mc", "circle1_mc", i, circle1Place);i++;
var glow_mc = attachMovie("glow_mc", "glow_mc", i, circle1Place);i++;
circle1X = circle1_mc._x;
glow_mc._xscale = glowXScale;
glow_mc._yscale = glowYScale;
glowXScale -= 15;
glowYScale -= 15;
newPos = {_x: xPlace+p, _y: random(40)+10};
var circle2_mc = attachMovie("circleblue_mc", "circle2_mc", i, newPos);i++;
xPlace = circle2_mc._x;
yPlace = circle2_mc._y;
var line_mc = attachMovie("line_mc", "line_mc", i);i++;
xpos1 = _root.circle1_mc._x;
ypos1 = _root.circle1_mc._y;
xpos2 = _root.circle2_mc._x;
ypos2 = _root.circle2_mc._y;
xscale = xpos2 - xpos1;
yscale = ypos2 - ypos1;
line_mc._x = xpos1;
line_mc._y = ypos1;
line_mc._xscale = xscale;
line_mc._yscale = yscale;
};
};
setInterval(bolt, 500);

Jumping to the End

Due to lack of documentation on the between effort this is the end design. Sorry for the leap. I find it very easy to get caught up in the creation of a thing and forget to actually record the progress I make.

finalHotHands

The SWF can be viewed here

Hot Fingers

The flame is initially going to be burning from the tip of the hand in this banner and so I needed a finger from which to burn. The following are just my experiments towards this end.

fingerIt

This is the finger I went with. The flame will emanate from the top of it. An idea posed in class suggested that I should also turn the hardware mouse into the button press finger icon but after many attempt and searches I couldn't work out how to do this and instead went with the simple pointer.

myHand DSCF0763 DSCF0764 DSCF0760 DSCF0761 DSCF0762

Burning Ring of Fire

Creating the flame that the hand holds. Just some basic attempts to get it looking the way I want.

flame_1 First attempt, far too chunky

flame_2 Second attempt, too skinny.

flameFinal Third attempt, just right!

I wanted to get the flame to touch the logo on the screen and set fire to the logo text but after hours and hours of trying and failing I decided to just encase the code that causes the burning in quotes and leave it be. As can be seen below.

As far as I can tell the code that does cause the burning 'should' work, but instead of catching fire to the text it just seems to warp the original fire and cause excessive amounts of lag due to (I'm assuming) a bad loop somewhere down the line.

onEnterFrame = function () {
if(firstRun == "go"){
fadeInText_mc._alpha += 4;
hand_mc._y += 4;
arrow_mc._alpha -= 6;
}
var flame_mc = attachMovie("flame_mc", "flame_mc", i, decalpos);
i++;
var spark_mc = attachMovie("spark_mc", "spark_mc", i, decalpos);
i++;
flame_mc.speed = (Math.random()*(5-2)+2);
flame_mc.scaleDown = (Math.random()*(6-4)+4);
flame_mc.startScale = (Math.random()*(500-400)+400);
flame_mc._x = _root.xmousepos+(Math.random()*(3))-(Math.random()*(3));
flame_mc._rotation = random(360);
flame_mc._xscale = this.startScale;
flame_mc._yscale = this.startScale;
flame_mc._alpha = this.startScale;
spark_mc._alpha = (Math.random()*(90-20)+20);
spark_mc._x = _root.xmousepos+(Math.random()*(10))-(Math.random()*(10));
spark_mc._y = _root.ymousepos - 9;
spark_mc.speed = (Math.random()*(5-2)+2);
spark_mc._rotation = random(360);
spark_mc.scaleDown = (Math.random()*(3-2)+2);
spark_mc.onEnterFrame = function() {
this._alpha -= this.scaleDown;
this._y -= this.speed;
this._xscale -= this.scaleDown;
this._yscale -= this.scaleDown;
if (this._xscale<=1) {
this.removeMovieClip();
}
}
flame_mc.onEnterFrame = function() {
this._alpha -= flame_mc.scaleDown;
this._y -= this.speed;
this._xscale -= this.scaleDown;
this._yscale -= this.scaleDown;
/*if (this.hitTest(_root.marvelLogo_mc).hitTest(_x, _y, true)) {
this.removeMovieClip();
thisPosX = this._x;
thisPosY = this._y;
trace("hit "+p);
p++;
burnpos = {_x:thisPosX, _y:thisPosY};
var burn_mc = attachMovie("flame_mc", "flame_mc", i, burnpos);
i++;
burn_mc.speed = (Math.random()*(3-1)+1);
burn_mc.scaleDown = (Math.random()*(7-5)+5);
burn_mc.startScale = (Math.random()*(50-20)+20);
burn_mc._alpha = startScale;
burn_mc._xscale = startScale;
burn_mc._yscale = startScale;
burn_mc.onEnterFrame = function() {
this._y -= this.speed;
this._xscale -= this.scaleDown;
this._yscale -= this.scaleDown;
this._alpha -= this.scaleDown;
};
}*/
if (this._xscale<=1) {
this.removeMovieClip();
}
};
};

Initial Banner Creation Attempts

The first banner I intend to create is the flaming hand skyscraper banner.

The following is my collection of images taken from Marvel sources that I felt could be used as inspiration or assets when creating this comic. Since the aim is based around fire it seems I'll be focusing quite a bit on the Human Torch from the Fantastic 4.

Human_Torch_2_by_ErikVonLehmann1151256069humantorch_1

humanTorch torch2 ff 258 drDoom2 442px-Ultimate_human_torch

Body By Milk

bodybymilk

bodybymilk.com

What an advert for simply milk. This is a large advert that could be quite misunderstood to be a fully fledge website. This website is aimed at kids and teens and attempts to encourage them to drink milk with some good old fashioned and blatant whoring out of teen idols with milky mustaches. I can't say I like this website what so ever, while thumbing through it you just get the overwhelming sense of sly intent. The advert has all the hall marks of a McDonalds advert with it's 'funky' and 'cool' layout and cheesy music. This advert has nothing to offer on a content front other than it's impressive construction. However impressive it is the overpowering smell of corporate misunderstanding of youth interest put me off actually venturing too deep inside and even though I did to more extent than I would have usually for the sake of research I found little to keep me there.

When it comes to these large and very interactive adverts it almost always pays to just be simple and direct in my opinion. Very often as soon as anyone realises that it's no more than a cruel attempt at peddling an idea at you using bright colours and flashy images you'll immediately try and look for faults unless the subject matter is already a subject of interest to you. In this case, being it milk, I don't think many will stick around just to listen to the lyrics of one of the worst bands I've come across.

Humanitarian Aid

humanitarianAid

Demonstration of this advert can be found here.

This is a very impressive advert. As you can see from the demonstration link above, the plane flies in over the page content and drops aid bags on the website and then in the centre of this the main advert appears. The entire sequence doesn't take long, it looks very pretty and certainly grabs your attention while at the same time offering you little information other than a single line of text and a link to find out more. This appears to be a favourite with the military at the moment, inviting you to find out more and giving you very little to go on in terms of initial information. I have no intention of ever joining the army or even entering conflict but some of these arm recruitment banners have taken me, quite willingly, to the recruitment site just to find out about the rest of the advert.

In particular I think it's worth noting the British Army's current advertisement campaign which presents you with footage from what appears to a real recording. The video will always start off with a simple recruitment appeal of sorts (even if it's just someone explaining the good work they do) but then take the video very suddenly to a crisis which doesn't quite resolve itself before the advert ends. In order to find out what happens you have to follow the link and find the ending, very effective form of advertisement.

Also worth mentioning is the U.S. Military and their recruitment through free online games. It's this form of advertisement that seems to most win over the viewers interest. U.S. official claim the game "America's Army" which was created with the intention of boosting recruitment has increased the recruitment of young adults by up to 17% since it was first released. Statistics indicate that 28% of all persons visiting the America's Army website with the intention to play a first person shooter actually visit the U.S. military recruitment website via simple and small advert banners nestled within the games website.

americasarmy

America's Army

It may even take you a few careful looks to find these adverts, but it just goes to prove a well placed advert no matter how small and unobtrusive can be a powerful tool.