Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Useful string functions
Delete a file
BlurImage
cXtraShapeWindow
free MD5 hashing Xtra
EasyBase
LiveCD
Scroll Wheel Lock Behavior
SiteSearch Indexer
Rotate-Alphamania
MediaMacros Xtras Mall
 

 

 

Behavior MP3 Cross Fader

Added on 1/28/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: MarkDaggett

This little behavior will let you crossfade between MP3s. For those of you who don"t know what a "crossfade" is, its a musical term that means you fade one music source out while fading another one in. DJs use it all the time to fade out one record while fading the next one in. This behavior does the same thing except instead of records it uses MP3s. Cut and past the behavior below into a behavior script in your director project.

--written by mark daggett info@flavoredthunder.com
--Use this script till it wears out.
--Copyright Flavored Thunder Media 1999 All rights reserved.
property pMp3One
property pMp3Two
property pFaderSprite
property pFaderWidth
property pFlag --this allows the user to click on the sprite and start and stop the streams
property pFadePos
--this is the mp3 fader property
on beginSprite me
  set pFadePos = the mouseLoc  
  set pFlag = FALSE --false means that the MP3 is not playing
  set pFaderSprite = the currentSpriteNum
  set pFaderWidth = the width of sprite pFaderSprite
end
on MouseEnter me
  if pFlag = FALSE then
    set pFlag = TRUE
    play member pMp3One
    play member pMp3Two
  else
    set pFlag = FALSE
    stop member pMp3One
    stop member pMp3Two
  end if
end
on mouseWithin me
  if soundBusy(1) then
  else
    play member pMp3One
  end if
  if soundBusy(2) then
  else
    play member pMp3Two
  end if
  
  if pFlag = TRUE then
    if pFadePos > 0 and pFadePos < pFaderWidth/10 then
      set the volume of member pMp3One = 255  
      set the volume of member pMp3Two = 0
    else if pFadePos > (pFaderWidth/10)*1 and pFadePos <= (pFaderWidth/10)*2 then
      set the volume of member pMp3One = 28*9
      set the volume of member pMp3Two = 28*1
    else if pFadePos > (pFaderWidth/10)*2 and pFadePos <= (pFaderWidth/10)*3 then
      set the volume of member pMp3One = 28*8
      set the volume of member pMp3Two = 28*2
    else if pFadePos > (pFaderWidth/10)*3 and pFadePos <= (pFaderWidth/10)*4 then
      set the volume of member pMp3One = 28*7  
      set the volume of member pMp3Two = 28*3
    else if pFadePos > (pFaderWidth/10)*4 and pFadePos <= (pFaderWidth/10)*5 then
      set the volume of member pMp3One = 28*6
      set the volume of member pMp3Two = 28*4
    else if pFadePos > (pFaderWidth/10)*5 and pFadePos <= (pFaderWidth/10)*6 then
      set the volume of member pMp3One = 28*5  
      set the volume of member pMp3Two = 28*5
    else if pFadePos > (pFaderWidth/10)*6 and pFadePos <= (pFaderWidth/10)*7 then
      set the volume of member pMp3One = 28*4  
      set the volume of member pMp3Two = 28*6
    else if pFadePos > (pFaderWidth/10)*7 and pFadePos <= (pFaderWidth/10)*8 then
      set the volume of member pMp3One = 28*3  
      set the volume of member pMp3Two = 28*7
    else if pFadePos > (pFaderWidth/10)*8 and pFadePos <= (pFaderWidth/10)*9 then
      set the volume of member pMp3One = 28*2  
      set the volume of member pMp3Two = 28*8
    else if pFadePos > (pFaderWidth/10)*9 and pFadePos <= (pFaderWidth/10)*10 then
      set the volume of member pMp3One = 0  
      set the volume of member pMp3Two = 255
    end if
    
  else
    return
  end if
end
on exitFrame me
  set pFadePos = the mouseH
end


on getPropertyDescriptionList me
  set pdlist to [:]
  addprop pdlist, #pMp3One, [#comment:"Left mp3", #format:#string, #default:"mp3one"]
  addprop pdlist, #pMp3Two, [#comment:"Right mp3", #format:#string, #default:"mp3Two"]
  return pdlist
end getPropertyDescriptionList

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail