//Author: Jane Jakeman //Date: Between December 2008 & January 2009 //FLASH 8 and Actionscript 2.0 //Drag, drop //Sound functions are attached to individual movie clips //TO STOP THE PLAYHEAD FROM MOVING OFF THE FRAME stop(); //TO HOLD START X AND Y POSITIONS OF THE LETTERS _global.gStartX; _global.gStartY; //TO HOLD COUNT OF 3 LETTERS CORRECT _global.gCountCat=0; //TO CREATE THE 3 SMILEY FACES AND MAKE THEM INVISIBLE smileLeft_mc._visible=false; smileMiddle_mc._visible=false; smileRight_mc._visible=false; //ASK USER TO SPELL CAT _root.createEmptyMovieClip("mySound3_mc",103); mySound3 = new Sound(mySound3_mc); mySound3.attachSound("spellCat"); //mySound.onSoundComplete = soundEnd; //SOUND 5 TRIGGERS NEXT SCENE mySound3.start(); //IF LETTER DROPS ON TARGET IT WILL STAY THERE //IF LETTER DROPS NOT ON TARGET WILL GO BACK TO ORIG POSITION //THE C OF CAT _root.c_mc.onPress = function() { this.startDrag(false); gStartX = c_mc._x; //set starting x position gStartY = c_mc._y; //set starting y position }; _root.c_mc.onRelease=function() { this.stopDrag(); if (this._droptarget =="/targetc_mc") //if dropped on target { smileLeft_mc._visible=true; //show smiley face this._x=targetc_mc._x; //snap to target this._y=targetc_mc._y; //add 1 to correct answer gCountCat+=1; if(gCountCat>2) //if all correct { //play well done, move to next scene _root.createEmptyMovieClip("mySound5_mc",105); mySound5 = new Sound(mySound5_mc); mySound5.attachSound("welld"); mySound5.onSoundComplete = soundEnd5; //gotoAndPlay(introRedDog,1) mySound5.start(); } } else { this._x=gStartX; //otherwise, go back to start position this._y=gStartY; } }; //THE A OF CAT _root.a_mc.onPress = function() { this.startDrag(false); gStartX = a_mc._x; gStartY = a_mc._y; }; _root.a_mc.onRelease=function() { this.stopDrag(); if (this._droptarget =="/targeta_mc") { smileMiddle_mc._visible=true; this._x=targeta_mc._x; this._y=targeta_mc._y; gCountCat+=1; if(gCountCat>2) { _root.createEmptyMovieClip("mySound5_mc",105); mySound5 = new Sound(mySound5_mc); mySound5.attachSound("welld"); mySound5.onSoundComplete = soundEnd5; //gotoAndPlay(introRedDog,1) mySound5.start(); } } else { this._x=gStartX; this._y=gStartY; } }; //THE T OF CAT _root.t_mc.onPress = function() { this.startDrag(false); gStartX = t_mc._x; gStartY = t_mc._y; }; _root.t_mc.onRelease=function() { this.stopDrag(); if (this._droptarget =="/targett_mc") { smileRight_mc._visible=true; this._x=targett_mc._x; this._y=targett_mc._y; gCountCat+=1; if(gCountCat>2) { _root.createEmptyMovieClip("mySound5_mc",105); mySound5 = new Sound(mySound5_mc); mySound5.attachSound("welld"); mySound5.onSoundComplete = soundEnd5; //gotoAndPlay(introRedDog,1) mySound5.start(); } } else { this._x=gStartX; //otherwise back to starting position this._y=gStartY; } }; //THE REMAINING ALPHABET LETTERS, MINUS C A T AS THIS CAUSES CONFLICT WITH THE CODE _root.b_mc.onPress = function(){ this.startDrag(false); gStartX = b_mc._x; gStartY = b_mc._y; trace(gStartX); }; _root.b_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.d_mc.onPress = function(){ this.startDrag(false); gStartX = d_mc._x; gStartY = d_mc._y; trace(gStartX); }; _root.d_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.e_mc.onPress = function(){ this.startDrag(false); gStartX = e_mc._x; gStartY = e_mc._y; trace(gStartX); }; _root.e_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.f_mc.onPress = function(){ this.startDrag(false); gStartX = f_mc._x; gStartY = f_mc._y; trace(gStartX); }; _root.f_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.g_mc.onPress = function(){ this.startDrag(false); gStartX = g_mc._x; gStartY = g_mc._y; trace(gStartX); }; _root.g_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.h_mc.onPress = function(){ this.startDrag(false); gStartX = h_mc._x; gStartY = h_mc._y; trace(gStartX); }; _root.h_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.i_mc.onPress = function(){ this.startDrag(false); gStartX = i_mc._x; gStartY = i_mc._y; trace(gStartX); }; _root.i_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.j_mc.onPress = function(){ this.startDrag(false); gStartX = j_mc._x; gStartY = j_mc._y; trace(gStartX); }; _root.j_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.k_mc.onPress = function(){ this.startDrag(false); gStartX = k_mc._x; gStartY = k_mc._y; trace(gStartX); }; _root.k_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.l_mc.onPress = function(){ this.startDrag(false); gStartX = l_mc._x; gStartY = l_mc._y; trace(gStartX); }; _root.l_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.m_mc.onPress = function(){ this.startDrag(false); gStartX = m_mc._x; gStartY = m_mc._y; trace(gStartX); }; _root.m_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.n_mc.onPress = function(){ this.startDrag(false); gStartX = n_mc._x; gStartY = n_mc._y; trace(gStartX); }; _root.n_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.o_mc.onPress = function(){ this.startDrag(false); gStartX = o_mc._x; gStartY = o_mc._y; trace(gStartX); }; _root.o_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.p_mc.onPress = function(){ this.startDrag(false); gStartX = p_mc._x; gStartY = p_mc._y; trace(gStartX); }; _root.p_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.q_mc.onPress = function(){ this.startDrag(false); gStartX = q_mc._x; gStartY = q_mc._y; trace(gStartX); }; _root.q_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.r_mc.onPress = function(){ this.startDrag(false); gStartX = r_mc._x; gStartY = r_mc._y; trace(gStartX); }; _root.r_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.s_mc.onPress = function(){ this.startDrag(false); gStartX = s_mc._x; gStartY = s_mc._y; trace(gStartX); }; _root.s_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.u_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.v_mc.onPress = function(){ this.startDrag(false); gStartX = v_mc._x; gStartY = v_mc._y; trace(gStartX); }; _root.v_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.w_mc.onPress = function(){ this.startDrag(false); gStartX = w_mc._x; gStartY = w_mc._y; trace(gStartX); }; _root.w_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.x_mc.onPress = function(){ this.startDrag(false); gStartX = x_mc._x; gStartY = x_mc._y; trace(gStartX); }; _root.x_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.y_mc.onPress = function(){ this.startDrag(false); gStartX = y_mc._x; gStartY = y_mc._y; trace(gStartX); }; _root.y_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; _root.z_mc.onPress = function(){ this.startDrag(false); gStartX = z_mc._x; gStartY = z_mc._y; trace(gStartX); }; _root.z_mc.onRelease=function(){ this.stopDrag(); this._x=gStartX; this._y=gStartY; }; //START OF FUNCTIONS soundEnd5 = function() { gotoAndPlay("introRedDog",1); };