Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Fixing music player

New Here ,
Aug 04, 2013 Aug 04, 2013

i downloaded this free flash template for a project im working on with friends but i want to place music in the background


var default_volume:Number = 0.6; // 0.00 to 1.00

var sound1:Sound = new music();

var music_channel:SoundChannel = sound1.play();

var music_volume:SoundTransform = new SoundTransform();

music_volume.volume = default_volume;

music_channel.soundTransform = music_volume;

sound_control.stop();

sound_control.addEventListener(MouseEvent.click, play_pause);

function play_pause(e:MouseEvent):void

{

music_volume.volume = default_volume;

if( e.target.currentFrame == 1 )

music_volume.volume = 0;

music_channel.soundTransform = music_volume;

e.target.play();

}

this came with it but it was disabled with /* so i took it out and now my project just flashes randomly and stops working, after i make it a comment again it fixes it, any ideas?

TOPICS
ActionScript
677
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 04, 2013 Aug 04, 2013

do you have an mp3 with class =  music in your library?

do you have a movieclip with reference =  sound_control within scope of that code?

if no to either (or both), you will see what you describe plus an error message (or two).

Translate
Community Expert ,
Aug 04, 2013 Aug 04, 2013

do you have an mp3 with class =  music in your library?

do you have a movieclip with reference =  sound_control within scope of that code?

if no to either (or both), you will see what you describe plus an error message (or two).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 04, 2013 Aug 04, 2013

yer i put the music in my libary and created the class in action script called music and the movie clip is at the top of the whole script when this part is enabled the layer where the movieclip is(little speaker) gets enabled, if you get me

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 04, 2013 Aug 04, 2013

do you see an error message?

if yes, click file>publish settings>swf and tick "permit debugging".  retest.

copy and paste the error message(s) and indicate the problematic lines of code mentioned in the error message(s).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 04, 2013 Aug 04, 2013

its fixed now thx for the help couldt find the reference for the sound, seemed it removed itself and the sound_control layer wouldt show correctly thx for the help and the debugging thing too

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 04, 2013 Aug 04, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines