Skip to main content
Inspiring
March 25, 2008
Answered

Dynamic text interfering with animation

  • March 25, 2008
  • 1 reply
  • 287 views
Hi,
Ive created these buttons - http://www.easyflashsite.co.uk/buttonscs3.swf

Now the rollover and out animations play well UNLESS the mouse is over the text. Try it out.
Im using dynamic text for the buttons and the code i am using is below.
Any Ideas?

b1.link_mc.MyText_txt.text="Home";
b2.link_mc.MyText_txt.text="About";
b3.link_mc.MyText_txt.text="Services";
b4.link_mc.MyText_txt.text="Portfolio";
b5.link_mc.MyText_txt.text="Contact";

b1.addEventListener(MouseEvent.CLICK,clickHandler);
function clickHandler(event:MouseEvent):void{
navigateToURL(new URLRequest(" http://www.easyflashsite.co.uk"));
}
b1.addEventListener(MouseEvent.MOUSE_OVER, rollOver);
function rollOver(event:MouseEvent):void {
this.b1.gotoAndPlay(2);
}
b1.addEventListener(MouseEvent.MOUSE_OUT, rollOut);
function rollOut(event:MouseEvent):void {
this.b1.gotoAndPlay(14);
}


b2.addEventListener(MouseEvent.CLICK,clickHandler2);
function clickHandler2(event:MouseEvent):void{
navigateToURL(new URLRequest(" http://www.alanwallace.co.uk"));
}
b2.addEventListener(MouseEvent.MOUSE_OVER, rollOver2);
function rollOver2(event:MouseEvent):void {
this.b2.gotoAndPlay(2);
}
b2.addEventListener(MouseEvent.MOUSE_OUT, rollOut2);
function rollOut2(event:MouseEvent):void {
this.b2.gotoAndPlay(14);
}
b3.addEventListener(MouseEvent.CLICK,clickHandler3);
function clickHandler3(event:MouseEvent):void{
navigateToURL(new URLRequest(" http://www.easyflashsite.co.uk"));
}
b3.addEventListener(MouseEvent.MOUSE_OVER, rollOver3);
function rollOver3(event:MouseEvent):void {
this.b3.gotoAndPlay(2);
}
b3.addEventListener(MouseEvent.MOUSE_OUT, rollOut3);
function rollOut3(event:MouseEvent):void {
this.b3.gotoAndPlay(14);
}


b4.addEventListener(MouseEvent.CLICK,clickHandler4);
function clickHandler4(event:MouseEvent):void{
navigateToURL(new URLRequest(" http://www.alanwallace.co.uk"));
}
b4.addEventListener(MouseEvent.MOUSE_OVER, rollOver4);
function rollOver4(event:MouseEvent):void {
this.b4.gotoAndPlay(2);
}
b4.addEventListener(MouseEvent.MOUSE_OUT, rollOut4);
function rollOut4(event:MouseEvent):void {
this.b4.gotoAndPlay(14);
}
b5.addEventListener(MouseEvent.CLICK,clickHandler5);
function clickHandler5(event:MouseEvent):void{
navigateToURL(new URLRequest(" http://www.easyflashsite.co.uk"));
}
b5.addEventListener(MouseEvent.MOUSE_OVER, rollOver5);
function rollOver5(event:MouseEvent):void {
this.b5.gotoAndPlay(2);
}
b5.addEventListener(MouseEvent.MOUSE_OUT, rollOut5);
function rollOut5(event:MouseEvent):void {
this.b5.gotoAndPlay(14);
}


Thanks
Alan
This topic has been closed for replies.
Correct answer alanwallace4
Ok, Ive solved it.
What i had to do was make some invisible buttons (butt1, butt2, etc) over the button mcs and just change the code from the above to the code below (for each section)

butt1.addEventListener(MouseEvent.CLICK,clickHandler);
function clickHandler(event:MouseEvent):void{
navigateToURL(new URLRequest(" http://www.easyflashsite.co.uk"));
}
butt1.addEventListener(MouseEvent.MOUSE_OVER, rollOver);
function rollOver(event:MouseEvent):void {
this.b1.gotoAndPlay(2);
}
butt1.addEventListener(MouseEvent.MOUSE_OUT, rollOut);
function rollOut(event:MouseEvent):void {
this.b1.gotoAndPlay(14);
}

Alan

1 reply

alanwallace4AuthorCorrect answer
Inspiring
March 25, 2008
Ok, Ive solved it.
What i had to do was make some invisible buttons (butt1, butt2, etc) over the button mcs and just change the code from the above to the code below (for each section)

butt1.addEventListener(MouseEvent.CLICK,clickHandler);
function clickHandler(event:MouseEvent):void{
navigateToURL(new URLRequest(" http://www.easyflashsite.co.uk"));
}
butt1.addEventListener(MouseEvent.MOUSE_OVER, rollOver);
function rollOver(event:MouseEvent):void {
this.b1.gotoAndPlay(2);
}
butt1.addEventListener(MouseEvent.MOUSE_OUT, rollOut);
function rollOut(event:MouseEvent):void {
this.b1.gotoAndPlay(14);
}

Alan