with this script I am hoping to be pushing the variable "tile" that is being created with the sound "I" attached to it on press to and array called "soundSeq"
Then with another MC acting as a button, play the contents of the array as Audio.
This script IS pushing the variable to the array, but when the "playBTN" MC is released it does not play any audio.
the sound "I" is in my library and it has the linkage name of "I" it plays on press. I just dont know how to make an array play...
any thought??
soundSeq = Array();
_root.ball1.onPress = function (){
startDrag(ball1);
var tile = new Sound();
tile.attachSound("I");
tile.start();
however, for some reason It will not release the drag, it just stays locked to the cursor.
also I have a few questions
//if(this.hitTest(_root.drop1)){ // removed for testing
I still need this right? to achieve what I want from my app.
and
/* List Variables shows -
Variable _level0.soundSeq = [object #1, class 'Array'] [
0:[object #2, class 'Sound'] {
id3:[getter/setter] undefined,
duration:[getter/setter] 4180,
position:[getter/setter] 3808
}
]
*/
this is commented out, but what is it? and do I need to un comment it?
also I have a few questions
//if(this.hitTest(_root.drop1)){ // removed for testing
I still need this right? to achieve what I want from my app.
so re-include it to your project. Remember I am only testing syntax
this is commented out, but what is it? and do I need to un comment it?
this is not Actionscript .. do NOT uncomment .. you will get errors
this is the result of - Test Movie / List Variables
Suggest you use this OFTEN to display the output from your movie
OK!!! I made it work.
I was really close wasnt I..
now I have a one more question if you or anyone would be so kind.
I have 5 more droptargets each will have its own array. I want to play the array sound in a sequence when the button is presses.
now, I am going to have about 50 objects to drag around and place on any drop target. the code could get real long here, is what im getting worried about. what would you suggest? is there any way to shorten this?
I did add a array.pop so it when you clear the screen the array will reset ( i hope)
a_modified_dog, There is something I dont understand. I have been staring at this code that you corrected for me, but I have no clue as to why when "soundSeq" is traced, does it produce [object, Object] and not "tile"
also, when I try to make a second if statement re-using the code but pushing to a different array, it doesnt work.... very confused. Im wondering if you could explain to me what you did. Thank you
why when "soundSeq" is traced, does it produce [object, Object] and not "tile"
because you are pushing a sound object to the array ( clearly visible is you use List Variables, as in the example I gave )
Code:
/* List Variables shows -
Variable _level0.soundSeq = [object #1, class 'Array'] [ // here is the array
0:[object #2, class 'Sound'] { // here is the sound object
id3:[getter/setter] undefined, // and its properties
duration:[getter/setter] 4180,
position:[getter/setter] 3808
}
]
*/
a second if statement re-using the code but pushing to a different array, it doesnt work
OK, I think I understand that.. as mentioned before, im not very good with scripting yet..
here is the script im working on. I will also include the .fla so you can get an idea of whats happening.
----------------------------------
soundSeq = new Array();
soundSeq1 = new Array();
soundSeq2= new Array();
soundSeq3= new Array();
soundSeq4= new Array();
_root.ball1.onPress = function (){
startDrag(ball1);
tile = new Sound();
tile.attachSound("I");
tile.start();
};