I’m making an mp3 player.The error is coming from the
sounmanager. i have the mp3′s set up as integers, but the .as is
looking for a string. I can’t understand why it’s doing that. I’m
new to Actionscript so it’s probably something simple, but i can’t
see it. Here’s the error
1067: Implicit coercion of a value of type int to an
unrelated type String.
the error occurs on the…..soundManager.loadSong(0); line
and heres the code…
i can add the whole .as file if needed. I think the problem
is in here. any ideas you all have would be greatly appreciated.
thanks for looking at it.|||
Regardless of what else I can’t see thru the trees, you have
the loadSong function looking for a string argument, but you are
passing an integer.|||
Thank you for your reply Ned. I thought i had it set up as an
integer. But i can’t tell what string it’s looking for…..
some more of the sounds.as
//—- NEXT—-
case “NEXT”:
if (this.songs.length – 1 == this.currentSong){
this.currentSong = 1;
}else{
this.currentSong++;
}
this.loadSong(this.currentSong);
play();
break;
Thanks again for the help|||
As I said, your code is passing an integer but expecting to
receive a string…
soundManager.loadSong(0); // passing an integer
public function loadSong(song:String):void{ // expecting a
string
Based on what I can see, you are treating it as an integer in
the loadSong function, so you probably just need to change the
argument type to be an int
Related posts:
- Error #1034: Type Coercion failed
- Error #1034: Type Coercion failed when dispatching Custom Events
- Error Creating Files. Column id has an unsupported type !
- error #1067
- How to dynamically check what kind of data type it is inside an Arraycollection?
Related posts brought to you by Yet Another Related Posts Plugin.