i create a simple two-button flash movie. Play and Stop.
Play code (actions):
CODE
on (release) {
//Stop Sound Behavior
_global.Behaviors.Sound.sndAudio.stop("sndAudio");
// Play Sound Behavior
_global.Behaviors.Sound.sndAudio.start(0,1);
// End Play Sound Behavior
}
//Stop Sound Behavior
_global.Behaviors.Sound.sndAudio.stop("sndAudio");
// Play Sound Behavior
_global.Behaviors.Sound.sndAudio.start(0,1);
// End Play Sound Behavior
}
Stop code:
CODE
on (release) {
//Stop Sound Behavior
_global.Behaviors.Sound.sndAudio.stop("sndAudio");
}
//Stop Sound Behavior
_global.Behaviors.Sound.sndAudio.stop("sndAudio");
}
Frame 1 code:
CODE
//Play Internal Sound Behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_sndAudio',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.sndAudio = new Sound(this._parent.BS_sndAudio);
} else {
this.createEmptyMovieClip('_sndAudio_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.sndAudio = new Sound(this.BS_sndAudio);
}
_global.Behaviors.Sound.sndAudio.attachSound("sndAudio");
if (true) {
_global.Behaviors.Sound.sndAudio.start(0,1);
}
//End Behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_sndAudio',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.sndAudio = new Sound(this._parent.BS_sndAudio);
} else {
this.createEmptyMovieClip('_sndAudio_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.sndAudio = new Sound(this.BS_sndAudio);
}
_global.Behaviors.Sound.sndAudio.attachSound("sndAudio");
if (true) {
_global.Behaviors.Sound.sndAudio.start(0,1);
}
//End Behavior
and import any Audio file you want into your Library. Rename the Audio Component to sndAudio (in your libary). Right click and click "Linkage Properties." Click "Export for ActionScript" and click OK. Right click sndAudio again and click "Export Settings" choose MP3 compression and change compression to fit your tastes/sizes.
Not sure if this is very practical alone except for blogs where the visitor can click STOP. You can probably code cookies so when they change to a different page it doesn't start playing again blah blah blah blah. i like it so leave me alone.