Thursday, April 21, 2011

Coding and Programming 2

Finally! Coding for Hot spots for my video link! I managed to overcome my problem of placing the hot-spots in the video with the help of my tutor. 

stop();
var secs:Number;

flvMovie.playheadUpdate = function() {

//trace(flvMovie.playheadTime);
                secs = Math.round(flvMovie.playheadTime);
                txtSeconds.text = secs;
                displayhotspot();

};

function displayhotspot() {
                               
                // hotspot 1
                if (secs >= 7 && secs <= 20) {
                                hpbutton._x = 276;
                                hpbutton._y = 175;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Wedding Invitation";
                                hptext2._visible = true;
                                _root.txtName = "txtHP01";
                }
               
                // hotspot 2/3
                else if (secs >= 32 && secs <= 36) {
                                hpbutton._x = 308;
                                hpbutton._y = 147;
                                hpbutton._visible = true;

                                hpbutton2._x = 230;
                                hpbutton2._y = 200;
                                hpbutton2._visible = true;
                               
                                hptext._visible = true;
                                hptext.text = "Bridesmaid / Coconut carried by the bride";
                                hptext2._visible = true;
                                _root.txtName = "txtHP02";
                                _root.txtName2 = "txtHP03";
                               
                }

               
                // hotspot 4
                else if (secs >= 38 && secs <= 41) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "The Stage / Manavarai";
                                hptext2._visible = true;
                                _root.txtName = "txtHP04";
                }

                // hotspot 06
                else if (secs >= 52 && secs <= 64) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "First Appearance of the Groom";
                                hptext2._visible = true;
                                _root.txtName = "txtHP06";
                }

                // hotspot 07
                else if (secs >= 87 && secs <= 92) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Religious Rituals for the Groom";
                                hptext2._visible = true;
                                _root.txtName = "txtHP07";
                }

                // hotspot 08
                else if (secs >= 95 && secs <= 97) {
                                hpbutton._x = 360;
                                hpbutton._y = 100;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Religious Rituals for the Groom";
                                hptext2._visible = true;
                                _root.txtName = "txtHP08";
                               
                }

                // hotspot 09
                else if (secs >= 101 && secs <= 104) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Religious Rituals for the Groom";
                                hptext2._visible = true;
                                _root.txtName = "txtHP09";
                }

                // hotspot 10
                else if (secs >= 112 && secs <= 116) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Religious Rituals for the Groom";
                                hptext2._visible = true;
                                _root.txtName = "txtHP10";
                }

                // hotspot 11
                else if (secs >= 118 && secs <= 138) {
                                hpbutton._x = 290;
                                hpbutton._y = 170;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Religious Rituals for the Groom";
                                hptext2._visible = true;
                                _root.txtName = "txtHP11";
                }

                // hotspot 12
                else if (secs >= 142 && secs <= 145) {
                                hpbutton._x = 300;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Wedding Attire";
                                hptext2._visible = true;
                                _root.txtName = "txtHP12";
                }

                // hotspot 13
                else if (secs >= 146 && secs <= 159) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Bride's First Entrance and the Rituals";
                                hptext2._visible = true;
                                _root.txtName = "txtHP13";
                }

                // hotspot 14
                else if (secs >= 165 && secs <= 169) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Bride's First Entrance and the Rituals";
                                hptext2._visible = true;
                                _root.txtName = "txtHP14";
                }

                // hotspot 15 - N/A
               
                // hotspot 16
                else if (secs >= 181 && secs <= 195) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Bride's First Entrance and the Rituals";
                                hptext2._visible = true;
                                _root.txtName = "txtHP15";
                               
                }

                // hotspot 17
                else if (secs >= 219 && secs <= 222) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Bride's First Entrance and the Rituals";
                                hptext2._visible = true;
                                _root.txtName = "txtHP17";
                }

                // hotspot 18
                else if (secs >= 227 && secs <= 232) {
                                hpbutton._x = 350;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Bride’s First Entrance and the Rituals";
                                hptext2._visible = true;
                                _root.txtName = "txtHP18";
                }

                // hotspot 19
                else if (secs >= 242 && secs <= 249) {
                                hpbutton._x = 275;
                                hpbutton._y = 180;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Groom Dressed in Wedding Vesti and Jippa";
                                hptext2._visible = true;
                                _root.txtName = "txtHP19";
                }
               
                // hotspot 20
                else if (secs >= 259 && secs <= 262) {
                                hpbutton._x = 250;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Pradhana Homam";
                                hptext2._visible = true;
                                _root.txtName = "txtHP20";
                }

                // hotspot 21
                else if (secs >= 262 && secs <= 265) {
                                hpbutton._x = 320;
                                hpbutton._y = 150;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "The Bridegroom";
                                hptext2._visible = true;
                                _root.txtName = "txtHP21";
                }

                // hotspot 22/23
                else if (secs >= 266 && secs <= 272) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                               
                                hpbutton2._x = 270;
                                hpbutton2._y = 70;
                                hpbutton2._visible = true;
                               
                                hptext._visible = true;
                                hptext.text = "Flower Girls / Bride in Her Best Wear";
                                hptext2._visible = true;
                                _root.txtName = "txtHP22";
                                _root.txtName2 = "txtHP23";
                }

                // hotspot 24
                else if (secs >= 290 && secs <= 302) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "The In Laws' Ritual";
                                hptext2._visible = true;
                                _root.txtName = "txtHP24";
                               
                }

                // hotspot 25
                else if (secs >= 314 && secs <= 318) {
                                hpbutton._x = 130;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Reading Of Lagna Pathirigai";
                                hptext2._visible = true;
                                _root.txtName = "txtHP25";
                               


                }

                // hotspot 26
                else if (secs >= 326 && secs <= 344) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Matha Pitha Pooja";
                                hptext2._visible = true;
                                _root.txtName = "txtHP26";
                               
                }

                // hotspot 27/28
                else if (secs >= 346 && secs <= 360) {
                                hpbutton._x = 275;
                                hpbutton._y = 250;
                                hpbutton._visible = true;

                                hpbutton2._x = 310;
                                hpbutton2._y = 170;
                                hpbutton2._visible = true;

                                hptext._visible = true;
                                hptext.text = "Tying the Sacred Thali";
                                hptext2._visible = true;
                                _root.txtName = "txtHP27";
                                _root.txtName2 = "txtHP28";
                               
                }
               
                // hotspot 29
                else if (secs >= 390 && secs <= 405) {
                                hpbutton._x = 240;
                                hpbutton._y = 120;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Tying the Sacred Thaali";
                                hptext2._visible = true;
                                _root.txtName = "txtHP29";
                }
               
                // hotspot 30
                else if (secs >= 406 && secs <= 414) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Exchange Garlands";
                                hptext2._visible = true;
                                _root.txtName = "txtHP30";
                }
               
                // hotspot 31
                else if (secs >= 421 && secs <= 440) {
                                hpbutton._x = 300;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "The Methi";
                                hptext2._visible = true;
                                _root.txtName = "txtHP31";
                }
               

                // hotspot 32
                else if (secs >= 443 && secs <= 457) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Circumbulating the Agni (fire)";
                                hptext2._visible = true;
                                _root.txtName = "txtHP32";
                }

                // hotspot 33
                else if (secs >= 463 && secs <= 469) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Fishing the Ring";
                                hptext2._visible = true;
                                _root.txtName = "txtHP33";
                }
               
                // hotspot 34
                else if (secs >= 494 && secs <= 500) {
                                hpbutton._x = 275;
                                hpbutton._y = 200;
                                hpbutton._visible = true;
                                hptext._visible = true;
                                hptext.text = "Blessings";
                                hptext2._visible = true;
                                _root.txtName = "txtHP34";
                }
               
                else {
                                hpbutton._visible = false;
                                hpbutton2._visible = false;
                                hptext._visible = false;
                                hptext2._visible = false;
                }
               
}

Wednesday, April 20, 2011

Coding and Programming

Coding is hardest part as for me because I am not so good in Action Scripts. I Google, asked around and got help from various places and people to complete my application. My tutor, Mr.Shahnaz, helped alot in coding and programming. He even suggested me few other solutions and ideas for my problems and animations in my application. He also guided me on how to play around with Action Scripts instead of having too many objects in one file. So, my application mouse event load with alot of Action Script 2.0. It actually makes my works lots easier.


Here are some of the SCRIPTS..
Script for Main Menu on Frame 11
stop();

//var numOfBalls:Number = 10;
var radiusX:Number = 280;
var radiusY:Number = 125;
var centerX:Number = 500; //Stage.width / 2;
var centerY:Number = 350; //Stage.height / 2;
var speed:Number = 0.05;
var vol:Number = 0;
var music = new Sound;
music.attachSound("soundtrack");
music.setVolume(0);
music.start(0, 99999);

this.onEnterFrame = function(){

             if (isSound) {
                                vol += 5;
                                music.setVolume(vol);
                                if (vol >= 100) {
                                                music.setVolume(100);
                                                this.onEnterFrame = null;
                                }
                }
                else {
                                this.onEnterFrame = null;
                }
}

/*
for(var i=0;i<numOfBalls;i++)
{
                var t = this.attachMovie("square","b"+i,i+1);
                t.angle = i * ((Math.PI*2)/numOfBalls);
                t._alpha = 0;
                t.onEnterFrame = mover;
}
*/
var ta = this.attachMovie("movieVideo", "movVideo", 10);
ta.angle = 0;
ta._alpha = 0;
ta.onEnterFrame = mover;

var tb = this.attachMovie("movieFacts", "movFacts", 11);
tb.angle = 0.333 * Math.PI * 2;
tb._alpha = 0;
tb.onEnterFrame = mover;

var tc = this.attachMovie("movieGallery", "movGallery", 12);
tc.angle = 0.666 * Math.PI * 2;
tc._alpha = 0;
tc.onEnterFrame = mover;

function mover()
{
                if (this._alpha < 100) {
                                this._alpha += 5;
                }
                this._x = Math.cos(this.angle) * radiusX + centerX;
                this._y = Math.sin(this.angle) * radiusY + centerY;
                var s = this._y /(centerY+radiusY);
                this._xscale = this._yscale = s*100;
                this.angle += this._parent.speed;
                this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function()
{
                speed = (this._xmouse-centerX)/3000;
}

stop();


Script for Main Menu on Frame 17
this.onEnterFrame = function(){

               
                if (_root.idxMovie == 1) {
                                // only fadeout for video link
                                vol -= 5;
                                music.setVolume(vol);
                                if (vol <= 0) {
                                                music.stop();
                                                music.setVolume(100);
                                                this.onEnterFrame = null;
                                }
                }
}

movVideo.onEnterFrame = function() {
                movVideo._alpha -= 5;
                if (movVideo._alpha <= 0) {
                                movVideo.onEnterFrame = null;
                                movVideo.removeMovieClip();
                }
}

movFacts.onEnterFrame = function() {
                movFacts._alpha -= 5;
                if (movFacts._alpha <= 0) {
                                movFacts.onEnterFrame = null;
                                movFacts.removeMovieClip();
                }
}

movGallery.onEnterFrame = function() {
                movGallery._alpha -= 5;
                if (movGallery._alpha <= 0) {
                                movGallery.onEnterFrame = null;
                                movGallery.removeMovieClip();
                }
}

trace("idxMovie = " + idxMovie);

if (idxMovie == 1) {
                trace("video");
                gotoAndPlay("Video");
}
else if (idxMovie == 2) {
                trace("facts");
                gotoAndPlay("Facts");
}
else if (idxMovie == 3) {
                trace("gallery");
                gotoAndPlay("Gallery");
}
               

Script for Fact & Rituals Menu on Frame 110

stop();

//var numOfBalls:Number = 6;
var radiusX:Number = 150;
var radiusY:Number = 25;
var centerX:Number = 500; //Stage.width / 2;
var centerY:Number = 620; //Stage.height / 2;
var speed:Number = 0.05;

/*
for(var i=0;i<numOfBalls;i++)
{
                var t = this.attachMovie("square","b"+i,i+1);
                t.angle = i * ((Math.PI*2)/numOfBalls);
                t._alpha = 0;
                t.onEnterFrame = mover;
}
*/

var t1 = this.attachMovie("movieFactsArt","t1",101);
t1.angle = 0;
t1._alpha = 0;
t1.onEnterFrame = mover;

var t2 = this.attachMovie("movieFactsBlooms","t2",102);
t2.angle = 1 * ((Math.PI*2)/6);
t2._alpha = 0;
t2.onEnterFrame = mover;

var t3 = this.attachMovie("movieFactsBrides","t3",103);
t3.angle = 2 * ((Math.PI*2)/6);
t3._alpha = 0;
t3.onEnterFrame = mover;

var t4 = this.attachMovie("movieFactsColours","t4",104);
t4.angle = 3 * ((Math.PI*2)/6);
t4._alpha = 0;
t4.onEnterFrame = mover;

var t5 = this.attachMovie("movieFactsThali","t5",105);
t5.angle = 4 * ((Math.PI*2)/6);
t5._alpha = 0;
t5.onEnterFrame = mover;

var t6 = this.attachMovie("movieFactsWedding","t6",106);
t6.angle = 5 * ((Math.PI*2)/6);
t6._alpha = 0;
t6.onEnterFrame = mover;

/*
var ta = this.attachMovie("movieVideo", "movVideo", 10);
ta.angle = 0;
ta._alpha = 0;
ta.onEnterFrame = mover;

var tb = this.attachMovie("movieFacts", "movFacts", 11);
tb.angle = 0.333 * Math.PI * 2;
tb._alpha = 0;
tb.onEnterFrame = mover;

var tc = this.attachMovie("movieGallery", "movGallery", 12);
tc.angle = 0.666 * Math.PI * 2;
tc._alpha = 0;
tc.onEnterFrame = mover;
*/

trace("oops");

function mover()
{
                if (this._alpha < 100) {
                                this._alpha += 5;
                }
                this._x = Math.cos(this.angle) * radiusX + centerX;
                this._y = Math.sin(this.angle) * radiusY + centerY;
                var s = this._y /(centerY+radiusY);
                this._xscale = this._yscale = s*100;
                this.angle += this._parent.speed;
                this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
                speed = (this._xmouse-centerX)/3000;
}

stop();
               

Monday, April 18, 2011

Work Place and Communication

As for me, I must the environment and also the work place in order for produce a good quality work.. Sometimes the environment and the workplace also influence my mood and ideas. So, in order to get the best ideas and the best work quality, I keep up the workplace as my way. :)


My workstation. 

My tablet

Me working 




My sketches and notes for myself. 

Sunday, April 17, 2011

Tutorials... Hard to earn them for free nowdays.

http://www.gotoandlearn.com

Just wanted to share this tutorial page as this helps alot to generate ideas for my application. It has very good and basic Flash action scripts and its tutorial video.

Thursday, April 14, 2011

Process

I am done with the process of editing photos/pictures and all materials for the application. Here is the print screen of the process.



Print Screen of editing photos under Fact & Rituals link. All the pictures are adjusted its hue, saturation, brightness and contrast to give it more colours as Indian Wedding resembles colours..



Here are the editing process for Gallery link.

Wednesday, April 13, 2011

Design, design and design..

Currently, I am working on the interface designs and also research on the coding. Coding is the hardest part of me as I find it hard. My interface design has to be more animations and interesting as it display information as it must  not be boring and lame. So, still on the porcess..