 |
|
| View previous topic :: View next topic |
| Author |
Message |
Hila David
Joined: 29 Apr 2005 Posts: 13
|
Posted: Sun May 15, 2005 10:04 am Post subject: need urgen help |
|
|
Hey all,
I'm Trying to load sound to a web page which has play buttons. each button should play about 30 seconds of high quality music.(I have stereo music 128kbps 44 khz).
I used this code and it's a mess
can anyone tell me what is wrong with this code?
mysound = new Sound();
}
on (release) {
mysound.loadSound("http://www.xxx.com/mysound.mp3", false);
mysound.start(mysound);
} |
|
| Back to top |
|
 |
Entrance Six
Joined: 01 Jul 2005 Posts: 2
|
Posted: Fri Jul 01, 2005 10:13 pm Post subject: Re: need urgen help |
|
|
| Hila David wrote: | Hey all,
mysound = new Sound();
}
on (release) {
mysound.loadSound("http://www.xxx.com/mysound.mp3", false);
mysound.start(mysound);
} |
your sound object sould be a variable and should be inside the on handler
your button must have the instance name mysound as that is what your refrencing. the final code should like like this.
| Code: | on (release) {
var mysound:Sound = new Sound(mysound);
mysound.loadSound("http://path-to-mp3", true);
} |
NOTE that you need to click the button and enter this code in the buttons action panel.
another way is to:
create a new button symbol give it an instance name of onBtn, click the button and in the actions panel for the button enter this code.
| Code: |
on (release) {
//Load Streaming mp3 behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_onBtn',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.onBtn = new Sound(this._parent.BS_onBtn);
} else {
this.createEmptyMovieClip('_onBtn_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.onBtn = new Sound(this.BS_onBtn);
}
_global.Behaviors.Sound.onBtn.loadSound("http://path-to.mp3",true);
} |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|