A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Possible or not??

  1. #1
    Senior Member
    Join Date
    May 2006
    Posts
    119

    Possible or not??

    Im wondering if there is a way that I could make a movie clip be able to recognise what has been dragged on to it and have it play the associated sound files for those dragged objects in a sequencial left to right order. If this is within the realm of possibility, does anyone know how it might be done?

    Thank you in advance.

    Mark Hollas

  2. #2
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588
    Start by creating an array eg:

    seq = Array[];

    When you do the start drag....create a variable (eg. curSound) that you can tie to object/sound that is being dragged. When the stop drag is called and if it is released where you want it create use seq.push(curSound); this will add the variable to the array. You will then have an array being built as the sounds are dragged onto the movie. Using a For Next Loop you can then loop through and play each sound. Bit Vague I know but you should get where I'm comin from

  3. #3
    Senior Member
    Join Date
    May 2006
    Posts
    119

    thank you for that

    I can see where you are coming from, I can kinda grasp what I need to do. This will probably require some study on my part. Until recently I have been really only animating with flash. Not so good with the Scripting....


    Thanks

  4. #4
    Senior Member
    Join Date
    May 2006
    Posts
    119
    soundSeq = Array[];

    when I put this in I get an output error of
    "=" must be followed by an operand.

    ...what does this mean?

  5. #5
    Junior Member
    Join Date
    Feb 2006
    Posts
    1
    try this:
    soundSeq=new Array();
    or
    soundSeq=[];

  6. #6
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588
    Hehe...oops! Let me know if you need any help

  7. #7
    Senior Member
    Join Date
    May 2006
    Posts
    119

    that would be nice

    Ive been at this for the better part of the day. Im incountering a few problems.
    1. setting up a drop target. I cant get this script to return any results.

    on (press) {
    startDrag(tile_i);
    }
    on (release) {
    stopDrag();
    if (tile_i._droptarget ==/DropZone) {
    trace("test");
    //soundSeq.push();
    }
    }
    I have all my script on the button instances themselves (started the project before I was aware of writing functions on a main "actions" layer)

    2. I dont know how, nor can find a tute on associating a sound file to a variable (though am assuming it has something to do with linkages)

    as far as the rest goes I have this on my "actions" layer (written after I learned about functions)

    soundSeq = Array();
    root.button.onRelease = function(){
    for(z=0; z<soundSeq; ++z){
    trace(soundSeq[z])
    }
    };
    (I figured this would return the name of an attached sound should it be written into the array before the button is pressed. Then when it comes to actually playing it I would use

    soundSeq = Array();
    root.button.onRelease = function(){
    for(z=0; z<soundSeq; ++z){
    play();
    }
    };

    This is about the level of understanding I have of scripting. so if anyone could lend a hand. unfortunatly the .fla is too big to upload so here is the general idea again

    the goal is for the letter tiles(all Button Instances, and all the drag and drop scripts are written on the buttons themselves) , when lined in the box on the top with the line in it, play in a left to right order (preferably not the order of which they are written into the array, however if that is too difficult, I can simply inform the user in the instructions)

    Thank you everybody

  8. #8
    Senior Member
    Join Date
    May 2006
    Posts
    119
    I stripped a version of my .fla down, its really bare bones but it will give you the idea.

    Thanks
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center