我新的闪光灯和我真的不知道什么是我得到这个错误的原因:类型错误:错误#2007:参数文字必须为非空
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at sgmap_fla::MainTimeline/mapOver()
我的动作:
description.countryName_txt.text = "";
description.zone_txt.text = "";
map_mc.buttonMode=true;
map_mc.addEventListener(MouseEvent.MOUSE_OVER, mapOver);
map_mc.addEventListener(MouseEvent.MOUSE_OUT, mapOut);
map_mc.northZone.countryName = "Singapore";
map_mc.northZone.zone = "North Zone";
map_mc.centralZone.countryName = "Singapore";
map_mc.centralZone.zone = "Central Zone";
map_mc.eastZone.countryName = "Singapore";
map_mc.eastZone.zone = "East Zone";
map_mc.westZone.countryName = "Singapore";
map_mc.westZone.zone = "West Zone";
map_mc.southZone.countryName = "Singapore";
map_mc.southZone.zone = "South Zone";
function mapOver(e:MouseEvent):void{
var mapItem:MovieClip = e.target as MovieClip;
description.countryName_txt.text = mapItem.countryName;
description.zone_txt.text = mapItem.zone;
description.gotoAndStop(mapItem.name);
TweenMax.to(mapItem, .5, {tint:0xFF9900});
TweenMax.fromTo(description, .5, {alpha:0, x:50, blurFilter:{blurX:80}}, {alpha:1, x:10, blurFilter:{blurX:0}});
}
function mapOut(e:MouseEvent):void{
var mapItem:MovieClip = e.target as MovieClip;
TweenMax.to(mapItem, .5, {tint:0x990000});
}
文本字段的文本不能设置为null。这可以通过在设置文本字段之前跟踪'countryName'和'zone'的'mapItem'属性来确认:'trace(mapItem.countryName); trace(mapItem.zone);''从'mapOver'事件处理函数中,'mapItem'看起来不是包含这些属性的区域。 – 2012-07-09 05:57:20
嗨贾森,它似乎并不工作,虽然我改变了: 'description.countryName_txt.text = mapItem.countryName; description.zone_txt.text = mapItem.zone;' 至 'description.countryName_txt.text = trace(mapItem.countryName); description.zone_txt.text = trace(mapItem.zone);' – kokloong 2012-07-10 00:52:29