Flash关于Error: Error #2037: 函数调用序列不正确,或前面的调用不成功。

原文:http://www.flashj.cn/


今天遇到这个错:
Error: Error #2037: 函数调用序列不正确,或前面的调用不成功。
at flash.media::Sound/_load()
at flash.media::Sound/load()
at org.mousebomb.media.musicPlayerV4::Mp3Container/loadMp3()
at org.mousebomb.media.musicPlayerV4::Mp3Container/nextMp3()
at org.mousebomb.media.musicPlayerV4::MusicPlayer/aC()
经过调查,这个错误的原因是:Sound对象只允许被load一个声音流,即使close()了也不能加载另一个声音.
一旦对某个 Sound 对象调用了 load(),就不能再将另一个声音文件加载到该 Sound 对象中。 若要加载另一个声音文件,请创建新的 Sound 对象。
***************************************************************

private var bgSound:Sound = new Sound();
private var channel:SoundChannel;
private var req:URLRequest = new URLRequest("source/flv/zuixuanmingzufeng.mp3");


// play bg music
private function palyBgMusic(){
var context:SoundLoaderContext = new SoundLoaderContext(2000, true);
// should add this line,or give the Error #2037
bgSound = new Sound();
bgSound.load(req,context);
channel = bgSound.play();
trace("play bg music");
}

// close bg music
private function stopBgMusic(){
if (bgSound.bytesLoaded < bgSound.bytesTotal)
{
bgSound.close();
trace("bg music close");
}
//should add the channel,or give the Error #2029
if(channel){
channel.stop();
trace("bg music close");
}
}
引用:AttributeError: 'str' object has no attribute 'items'。这个错误通常出现在你尝试将一个字符串对象(str)作为字典(dict)来处理时。字符串对象没有items()方法,该方法用于返回字典的键值对。可以通过将字符串转换为字典对象来解决这个错误,例如使用eval()函数或json.loads()函数将字符串解析为字典。但要注意,在使用这些函数之前,必须确保字符串的格式正确,并且不会引发其他错误。 引用:补充知识:Pandas使用DataFrame出现错误:AttributeError: ‘list’ object has no attribute ‘astype’。这个错误通常出现在你尝试将一个列表(list)对象用作DataFrame的数据,而列表没有astype()方法。astype()方法用于将Series或DataFrame中的数据类型转换为指定类型。要解决这个错误,你可以确保你的数据是一个正确的数据类型,例如使用np.array()函数将列表转换为数组,然后再将数组用作DataFrame的数据。 引用:今天在做数据可视化实验时,参考老师讲的要画直方图和密度图的结合图时出现了错误。你提供的代码中有一行代码存在错误,即mlab.GaussianKDE(titanic['2008'])。这个错误是因为matplotlib库的版本不同导致的,早期版本的matplotlib.mlab模块中存在GaussianKDE函数,但在较新的版本中已经被移除。要解决这个错误,你可以使用scipy.stats库中的gaussian_kde函数代替mlab.GaussianKDE函数。 关于时间序列AttributeError: 'ARIMAResults' object has no attribute 'fit'的问题,这个错误通常出现在你尝试对ARIMA模型进行训练时。它表明ARIMAResults对象没有fit()方法来拟合模型。要解决这个错误,你需要确保你已经正确地导入了ARIMA模型,并使用正确的参数进行模型拟合。你可以检查一下你的代码,并确保ARIMAResults对象的创建和fit()方法的调用正确
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值