所以这没有任何意义。我在基于闪存的按钮菜单中有动作脚本,其中一个按钮链接到错误的页面,我无法弄清楚原因。这是动作脚本:
var myURL1:URLRequest = new URLRequest ("home.html");
home_btn.addEventListener(MouseEvent.CLICK, home_btnEventHandler);
function home_btnEventHandler(event:MouseEvent):void
{
navigateToURL(myURL1, "_self");
}
var myURL2:URLRequest = new URLRequest ("featuredwork.html");
work_btn.addEventListener(MouseEvent.CLICK, work_btnEventHandler);
function work_btnEventHandler(event:MouseEvent):void
{
navigateToURL(myURL2, "_self");
}
var myURL3:URLRequest = new URLRequest ("featuredartist.html");.
artist_btn.addEventListener(MouseEvent.CLICK, artist_btnEventHandler);
function artist_btnEventHandler(event:MouseEvent):void
{
navigateToURL(myURL3, "_self");
}
var myURL4:URLRequest = new URLRequest ("artists.html");
members_btn.addEventListener(MouseEvent.CLICK, members_btnEventHandler);
function members_btnEventHandler(event:MouseEvent):void
{
navigateToURL(myURL4, "_self");
}
var myURL5:URLRequest = new URLRequest ("events.html");
events_btn.addEventListener(MouseEvent.CLICK, events_btnEventHandler);
function events_btnEventHandler(event:MouseEvent):void
{
navigateToURL(myURL5, "_self");
}
var myURL6:URLRequest = new URLRequest ("/blog/index.php");
blog_btn.addEventListener(MouseEvent.CLICK, events_btnEventHandler);
function blog_btnEventHandler(event:MouseEvent):void
{
navigateToURL(myURL6, "_self");
}
现在,当我点击blog_btn时,它会将我发送到“活动”页面。这没有道理。有人有任何想法吗?
答案 0 :(得分:1)
相当容易发现:你有
blog_btn.addEventListener(MouseEvent.CLICK, events_btnEventHandler);
当你的意思
blog_btn.addEventListener(MouseEvent.CLICK, blog_btnEventHandler);
注意第二个参数。
答案 1 :(得分:0)
您已将事件处理程序绑定到blog_btn
单击 - 将最后一个块更改为指向正确的处理程序:
blog_btn.addEventListener(MouseEvent.CLICK, blog_btnEventHandler);