It’s just Awesome!

Why the world is awesome? You just watch the avalanche. Sea the crocodiles, see the snake rattles, see the storms. It’s just awesome!

Bear Grylls – Man VS Wild

And my this below is my quote. Read after the click

//===================

stop();
import gs.TweenLite;
var questionumarray:Array = [1, 2, 3, 4, 5];
charout = 0;
_root.stopper = false;
dboxv.stop();
dboxv.ansbox._visible = false;
function quesrend(question, ans, curframe) {
if (ans == true) {
dboxv.ansbox._visible = true;
trace(curframe+” “+stopperval);
//_root.stopper = stopperval
TweenLite.from(dboxv.ansbox,1,{_y:-100, tint:0xFFFFFF, delay:10/curframe, ease:mx.transitions.easing.Strong.easeOut});
}
if (ans == false) {
TweenLite.to(dboxv.ansbox,1,{_y:-100, _visible:false, tint:0xFFFFFF, delay:24/curframe, ease:mx.transitions.easing.Strong.easeOut});
dboxv.ansbox._visible = ans;
}
//trace(“question == “+question);
dboxv.dbos.dbosq = question;
dboxv.play();
}

quesrend(“Welcome! Do you know what is Fraction?”,true,9);
statusstartplay = 1;
dboxv.ansbox.byes.onRelease = function() {
//trace(“ho”);
tut1._visible = true;
if (statusstartplay == 1) {
TweenLite.from(tut1,2,{_y:-100, ease:mx.transitions.easing.Strong.easeOut});
statusstartplay = 2;
} else if (statusstartplay == 2) {
TweenLite.to(tut1,1,{_y:0, ease:mx.transitions.easing.Strong.easeOut});
quesrend(“Let’s start playing!”,false,0);
}
};

dboxv.ansbox.bno.onRelease = function() {
quesrend(“Let’s start playing!”,false,0);
_root.stopper = true;
//trace(_root.stopper+”game starts”);
gamestarts();
};

tut1._visible = false;
tut1.stop();
tut1.tutpage = tut1._currentframe+”/”+tut1._totalframes;

tut1.bnext.onRelease = function() {
tut1.nextFrame();
tut1.tutpage = tut1._currentframe+”/”+tut1._totalframes;
};
tut1.bprev.onRelease = function() {
tut1.prevFrame();
tut1.tutpage = tut1._currentframe+”/”+tut1._totalframes;
};

tut1.bplay.onRelease = function() {
tut1.gotoAndStop(1);
tut1.tutpage = tut1._currentframe+”/”+tut1._totalframes;
TweenLite.to(tut1,1,{_y:-600, _visible:false, ease:mx.transitions.easing.Strong.easeOut});
quesrend(“Let’s start playing!”,false,0);
_root.stopper = true;
//trace(“game starts”);
gamestarts();
};

function gamestarts() {
//dboxv.dbos.dbosq = “Let’s start playing!”
quesrend(“Identify the correct pizza with the request”,false,0);
_root.stopper = false;
pizzaloop();
renderchar()
//movechar(“cash”);
}
function pizzaloop() {
//scramble pizza inside = different frame has different arrangements
// list array of number
// random pull value from array
// delete value exist from array
p1.gotoAndStop(6);
var scrampiz = (Math.floor(Math.random()*questionumarray.length));
trace(scrampiz+”scrampiz + length”+questionumarray.length);
//p1.stop()
ho = questionumarray[scrampiz];
trace(ho+”hoarray = “+questionumarray);
questionumarray.splice(scrampiz,1);
trace(ho+”hoarraysplice = “+questionumarray);
//this.attachMovie(‘p1′,p1)
p1.gotoAndStop(ho);
trace(p1._currentframe+”curfame p1″);
//scroll inside
assignbut();
TweenLite.to(p1,1,{_x:0, ease:mx.transitions.easing.Strong.easeOut});

trace(ho+”ho char”);
//renderchar();
//movechar(“cash”);

//character slide in

//question renderer
//answer checker
}

function renderchar() {
charout++;
trace(charout+” char out”);
var charaout:MovieClip = c1.duplicateMovieClip(“ct”+charout, charout, -1);
trace(charaout+”rend char”);
trace(charaout._name+”rend char”);
charaout.charhold.gotoAndStop(ho);
charaout.ansq.gotoAndStop(7)
//TweenLite.to(charaout,1,{_x:321.3, _y:402.9, _xscale:86.8, _yscale:86.8, ease:mx.transitions.easing.Strong.easeOut});
movechar(charaout,”s1″);
//movechar(charaout2,”s1″)
curchar = charaout;
trace(curchar+”cucaracha”);
}

readyans = function(){
movechar(curchar,”cash”)

renderchar()
}

readyansbut.onRelease = function(){
readyans()
}

function movechar(target, step) {

if (step == “s1″) {
TweenLite.to(target,1,{_x:321.3, ease:mx.transitions.easing.Strong.easeOut});
} else if (step == “cash”) {
kurkura = target
var quesnum = Math.floor(Math.random()*5);
target.ansq.gotoAndStop(quesnum+1);
target.ansq.realans = quesnum+1;
TweenLite.to(target,1,{_x:621.3, ease:mx.transitions.easing.Strong.easeOut});
} else if (step == “out”) {

}

}

function assignbut() {

for (i=1; i<7; i++) {
//
var pizz = p1[“a”+i];
pizz._alpha = 100;
pizz.orix = pizz._x;
pizz.oriy = pizz._y;
pizz.oriwidth = pizz._width;
pizz.oriheight = pizz._height;
pizz.id = i;

//activate pizza drag
pizz.onPress = function() {
this.getNextHighestDepth();
this.startDrag();
};

//collision detection = pizza snap to drop area
pizz.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == kurkura.ans) {
trace(“drop detectright”);
trace(this.id+”answer submitted”);
_root.curans = this.id;
this._width = c1.ans._width;
this._height = c1.ans._height;
this._x = 524.4;//c1.ans._x +500
this._y = 493.9-108;//c1.ans._y +500
trace(this._x+” dragger “+this._y);
trace(c1.ans._x+”ansdrop “+c1.ans._y);
} else {
TweenLite.to(this,0.5,{_x:this.orix, _y:this.oriy, _width:this.oriwidth, _height:this.oriheight, ease:mx.transitions.easing.Strong.easeOut});
}
};
}

}

tester.onRelease = function() {
trace(“click la bodoh”);
if (kurkura.ansq.realans == _root.curans) {
trace(“answer correct”);
} else {
trace(“answer incorrect”);
}
cashoutchar = kurkura;
//movechar(curchar,”cash”);
TweenLite.to(cashoutchar,1,{_x:921.3, ease:mx.transitions.easing.Strong.easeOut, delay:1,onComplete:readyans});
TweenLite.to(p1[“a”+_root.curans],1,{_x:921.3, _alpha:0, ease:mx.transitions.easing.Strong.easeOut, delay:1, onComplete:movechar, onCompleteParams:[curchar,”cash”]});
TweenLite.to(p1,1,{_x:-900, ease:mx.transitions.easing.Strong.easeOut, delay:2, onComplete:pizzaloop});

};

//===============

And it work’s. I did it. It’s just Awesome! :p Now it has 200 line plus blanks. I’m going to add more and see if it works tomorrow. Calling it a day :) Of course this is messy codes. Optimization going on later.

26
May 2009
POSTED BY
POSTED IN WISIWYG
DISCUSSION 6 Comments
TAGS

6 Responses to : It’s just Awesome!

  1. Rashid says:

    There is something wrong with your post.

  2. ikhwan nazri says:

    what’s wrong with my post?

  3. Rashid says:

    A large portion of is in HTML code.

  4. ikhwan nazri says:

    rashid – that’s actionscript, and that’s my quote :p

  5. waniee says:

    wahahaha momochi aku nampak a classic debug tracinggg kinda msg.. CLICK LA BODOH!!

  6. ikhwan nazri says:

    waniee – haha aku kalau dah pening ngan script aku mencarut2 je dlm tu.. ada satu projek aku siap pernah trace ‘haram jadah’ atau aku namakan file dia ‘haram’.. pastu bos aku yg non muslim tanye.

    boss: eh ini flash file haram ke?
    aku: ehh tak tak .. I just stress
    boss: U sure ka.. U ada pernah cakap you tak nak buat haram-related project ( sbb aku pena ckp kalau ada flash related to arak/rokok/sex aku tamau buat )
    aku:sure la boss.. ini haram bahasa bila I trace je. ini flash pun bukan pasal arak/rokok/sex

    haha sampai skang aku gelak bila ingat pasal ni

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>