Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-24-2004, 09:16 PM   #1
bdubbs7
Registered User
 
Join Date: Jul 2003
Posts: 44
Default button with music and animation, help

ok i have a mc that contains 4 buttons that make up an entire image. i want it to be an on/off music button (single button for both on and off). when the music stops, i need the mc to stop animating. when the music is on it is looping an animation. any help? thanks a lot.

brian
bdubbs7 is offline   Reply With Quote
Old 10-24-2004, 09:31 PM   #2
mmm..pi..3.14..
/(bb|[^b]{2})/
 
mmm..pi..3.14..'s Avatar
 
Join Date: May 2004
Location: Denver, CO
Posts: 2,740
Default

In first frame:

PHP Code:
Status false 
PHP Code:
on (release) {
      
Status = !Status
      
if(Status == true) {
            var 
yourSound:Sound = new Sound()
            
yourSound.attachSound("theSound")
            
yourSound.start()
            
yourMC.play()
      } else {
            
stopAllSounds()
            
yourMC.stop()
      }

Hope that helps

Eric
__________________
Eric Hainer
Unleaded Software
970.581.3387
Email: Eric followed by the AT symbol, unleaded software (one word) DOT com
Denver Web Design
mmm..pi..3.14.. is offline   Reply With Quote
Old 10-26-2004, 12:27 AM   #3
bdubbs7
Registered User
 
Join Date: Jul 2003
Posts: 44
Default

thanks a lot for the help. but i got this error...

**Error** Scene=Scene 1, layer=mc_b_ph, frame=1:Line 2: Syntax error.
******Status = !Status

**Error** Scene=Scene 1, layer=mc_b_ph, frame=1:Line 3: Syntax error.
******if(Status == true) {

Total ActionScript Errors: 2 Reported Errors: 2

do you know how i can fix this? im not too great with actionscripting yet...
thanks again,

brian.

Last edited by bdubbs7; 10-26-2004 at 05:22 PM.
bdubbs7 is offline   Reply With Quote
Old 10-26-2004, 05:24 PM   #4
bdubbs7
Registered User
 
Join Date: Jul 2003
Posts: 44
Default

ok i dont get this...

i write the in the first frame of the movie:

mc = true

then i write this in the mc:

on (release) {
if(mc == false) {
_root.mc.stop()
} else if (mc == true) {
_root.mc.play()
}
}

if anyone can tell me what im doing wrong, please help. thanks.
brian
bdubbs7 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:59 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.