Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-30-2003, 08:07 PM   #1
cool denny
Registered User
 
Join Date: Apr 2002
Posts: 6
Default memory game

I need help.
If I have a few instances on my scene, that, when clikcked play a sound (say five of them), could you tell me how to keep track of the ones being clicked so that I may play the sounds back to the user when they finish selecting the sounds they want? Similar to simon says but this is for my drum machine.
cool denny is offline   Reply With Quote
Old 01-31-2003, 02:34 AM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy... Welcome to the club...

I'd keep add the new numbers into the array so that you can scroll through the array when needed...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 01-31-2003, 05:01 AM   #3
agent81
member
 
Join Date: Jan 2003
Location: Melbourne
Posts: 518
Default

Yeah definately an array, use this simple routine
ActionScript Code:
//default variables function resetKeySave(){ if (keyArray.length > 0){ delete keyArray } keyArray = new Array() keyCurrent = 0 } function saveKey(keyNum){ keyArray.push(keyNum) } function playNextKey(){ return keyArray[keyCurrent] ketCurrent++ } //dunno how you are making the sounds, but just adapt this function makeSound(){ this["sound" + playNextKey()].play() } resetKeySave()

when you make a sound call saveKey(), sending the number of the sound you are playing, when you want to play the sounds, set up a routine to call playNextKey.

you could send the name of the sound, rather than just a number to reference it, and tell make sound to play that as well.

hope that works??

cheers
agent81 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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:38 PM.

///
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.