Skip to main content
Known Participant
December 2, 2010
Question

disabilty of a button?

  • December 2, 2010
  • 1 reply
  • 828 views

I have a button I want to diable clickabilty to but i still want it there how do i do this?  It doesn;t matter which button you choose I just want an example?  Please..... Help

import flash.net.URLRequest;
import flash.events.MouseEvent;

var homeURL:URLRequest = new URLRequest("home.html");
var wrappingURL:URLRequest = new URLRequest("wrapping.html");
var choppingURL:URLRequest = new URLRequest("chopping.html");
var tillageURL:URLRequest = new URLRequest("tillage.html");
var rakingURL:URLRequest = new URLRequest("raking.html");
var contactURL:URLRequest = new URLRequest("contact.html");

function homeURLDown(event:MouseEvent):void
{

navigateToURL(homeURL, "_self");

}

function wrappingURLDown(event:MouseEvent):void
{

navigateToURL(wrappingURL, "_self");

}

function choppingURLDown(event:MouseEvent):void
{

navigateToURL(choppingURL, "_self");

}

function tillageURLDown(event:MouseEvent):void
{

navigateToURL(tillageURL, "_self");

}

function rakingURLDown(event:MouseEvent):void
{

navigateToURL(rakingURL, "_self");

}

function contactURLDown(event:MouseEvent):void
{

navigateToURL(contactURL, "_self");

}

home_btn.addEventListener(MouseEvent.CLICK, homeURLDown);
wrapping_btn.addEventListener(MouseEvent.CLICK, wrappingURLDown);
chopping_btn.addEventListener(MouseEvent.CLICK, choppingURLDown);
tillage_btn.addEventListener(MouseEvent.CLICK, tillageURLDown);
raking_btn.addEventListener(MouseEvent.CLICK, rakingURLDown);
contact_btn.addEventListener(MouseEvent.CLICK, contactURLDown);

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
December 2, 2010

You can just set the mouseEnabled property of the button to false...

home_btn.mouseEnabled = false;

Known Participant
December 2, 2010

and we put that right into the function right?

function homeURLDown(event:MouseEvent):void
{

navigateToURL(homeURL, "_self");
home_btn.mouseEnabled = false;

}

Ned Murphy
Legend
December 3, 2010

If that's where you want it.  Why don't you try it first and see?