hello
I can’t seem to get the dog to bark when the ball is picked up. I used currentframe label to figure out when the ball is picked up and reach to the end so dog would bark at beginning and run after the ball once ball ends the animations.
Also other function, spillPaint, once the animation ends the cat is supposed to get scared but i find this strange. So i decided to click on it again then cat gets scared and can spills after it. I used currentframe label on the end of can animation. I don’t udnerstand why it would wait until second click to scare the cat.
HEres the code. Please let me know asap. Your help is greatly appreciated.
package{
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.TextField;
public class AppController extends MovieClip{
protected var nSpeed;
public function AppController(){
trace("AppController created!");
initButtons();
stop();
brush.stop();
paintcan.stop();
painting.stop();
ball.stop();
brush.addEventListener(MouseEvent.MOUSE_DOWN ,brushPaint);
ball.addEventListener(MouseEvent.MOUSE_DOWN ,throwBall);
ball.addEventListener(MouseEvent.MOUSE_OVER, startBark);
ball.addEventListener(MouseEvent.MOUSE_OUT, stopBark);
paintcan.addEventListener(MouseEvent.MOUSE_DOWN ,spillPaint);
}
function initButtons():void{
button1.setLabel("Classwork");
button2.setLabel("Project");
button3.setLabel("Portfolio");
button4.setLabel("Link");
button5.setLabel("Link");
button6.setLabel("Link");
}
function brushPaint(e:Event){
brush.gotoAndPlay("action");
if (brush.currentLabel == "drip") {
cat.gotoAndPlay("wet");
}
}
function throwBall(e:Event){
ball.play();
dog.gotoAndStop("bark");
if(ball.currentLabel == "ballEnd"){
dog.gotoAndPlay("run");
}
}
function spillPaint(e:Event){
paintcan.play();
if(paintcan.currentLabel == "spill"){
cat.gotoAndPlay("scared");
}
}
function startBark(e:Event){
dog.gotoAndStop("bark");
}
function stopBark(e:Event){
dog.gotoAndStop("sit");
}
} // end class
} // end package