0 Replies Latest reply on Jun 21, 2006 9:33 PM by crcr

    Change Text Color Dynamically Depending on Which MP3 File is Playing

    crcr
      Change Text Color Dynamically Depending on Which MP3 File is Playing



      Hi,

      Can anyone help with this problem.

      I am trying to change a text cast member's color dynamically based on which audio file is currently playing.

      I have 4 Text Cast member buttons named

      Play Song 1
      Play Song 2
      Play Song 3
      Play Song 4


      I am successfully playing the 4 songs in a queue like this (ie. If "Play Song 1" sprite text member is pressed then...

      sound(1).queue(member "Song1")
      sound(1).queue(member "Song2")
      sound(1).queue(member "Song3")
      sound(1).queue(member "Song4")
      sound(1).play

      What I would like to do is to have the currently playing song text color changed to a different value, say Green.

      So if "Song2" in the queue starts to play then the text "Play Song 2" would become Green. When done it would then turn back to black then "Song3" starts to play and "Play Song 3" text script button would then turn from black to Green an so on.

      These are the codes I've tried in the frame script and none seem to work...

      on enterFrame me
      if sound(1).status = 3 then member("Play Song 1").foreColor=5
      (This works but only for the first song because "Play Song 1" is directly named and clicked on.)

      else member("Play Song 1").foreColor=255
      end if




      I have tried to make a reference to the playing song and so far each of these doesn't work...
      --if sound(1).status = 3 then sprite(me.sound.member).foreColor=5
      --if sound(1).status = 3 then sprite(me.spriteNum).member.color=rgb(0,255,0)
      --if sound(1).status = 3 then member (sound(1).member).foreColor=5
      --text = member(whichMember).scriptText

      end


      Is there any way to reference the song name text cast member??

      I thought I had it when I discovered sound(1).member but
      sound(1).showProps returns the playing sound.member as

      member: (member 28 of castLib 1) nothing there I can use?

      It doesn't show the member name and
      It doesn't show the song name "Song1" which I could then match up to the "Play Song 1" text

      I'm pretty new to lingo so specific code examples would be appreciated.

      Can anyone help??? Thanks!!!