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:

  1. Error #1034: Type Coercion failed
  2. Error #1034: Type Coercion failed when dispatching Custom Events
  3. Error Creating Files. Column id has an unsupported type !
  4. error #1067
  5. 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.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD