Flash Goddess Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

need urgen help

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Flash Goddess Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
Hila David



Joined: 29 Apr 2005
Posts: 13

PostPosted: Sun May 15, 2005 10:04 am    Post subject: need urgen help Reply with quote

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
View user's profile Send private message
Entrance Six



Joined: 01 Jul 2005
Posts: 2

PostPosted: Fri Jul 01, 2005 10:13 pm    Post subject: Re: need urgen help Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Flash Goddess Forum Index -> Tutorials All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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

Google
 




Powered by phpBB © 2001, 2005 phpBB Group