Professional Web Applications Themes

Sound on keydown - Macromedia Director Lingo

hi, um... im having a bit of trouble with director at the moment, i have posted on other forums and had some useful replies, but being a beginner all the posts were a bit "Too Much" for me. anyway, my problem. im trying to create a Loop based piece of continued...

  1. #1

    Default Sound on keydown

    hi,

    um... im having a bit of trouble with director at the moment, i have posted on other forums and had some useful replies, but being a beginner all the posts were a bit "Too Much" for me.

    anyway, my problem.

    im trying to create a Loop based piece of music software... i have got the basics down, and it is working as i want it to.. the problem is that i want to trigger my audio files on "key up". each key triggering a different sample from the cast e.g key 'A" plays drum loop 1, key "B" plays drum loop 2......

    people have given me scripts for key up e.t.c. but i'm having big problems implimenting them ( just coz i'm a beginner)

    can anyone give me some help, "in fairly simple english",

    do i add the script to the cast members or to the script channel, if it is the script channel can i add it to the "hold on current frame" script, or do i have to work around that??

    sorry for being a bit of a fool,

    thanks for any help,

    ben


    Benjo3 webforumsuser@macromedia.com Guest

  2. #2

    Default Re: Sound on keydown

    hi,

    im trying to create a Loop based piece of music software... i have got the basics down, and it is working as i want it to.. the problem is that i want to trigger my audio files on "key up". each key triggering a different sample from the cast e.g key 'A" plays drum loop 1, key "B" plays drum loop 2......

    people have given me scripts for key up e.t.c. but i'm having big problems implimenting them ( just coz i'm a beginner)

    can anyone give me some help, "in fairly simple english",

    do i add the script to the cast members or to the script channel, if it is the script channel can i add it to the "hold on current frame" script, or do i have to work around that??

    ben

    Hi Ben,

    You could do it in various ways, but maybe the easiest is to add the 'on keyUp' handler to a Movie Script. Just open up the Script Window in Director and past the 'on keyUp' handler into it. You can name the script up at the very top of that window in a separate editable text box.

    When you close the Script Window, you will see that your Cast has a new script in it with the name you gave it. I'm not sure, but I think newly created scripts default to being Movie Scripts. In any case, you can right click on the script in the cast window and select 'Cast member properties'. This brings up the Property Inspector. That'll tell you whether the script is a Movie Script, a Parent Script, or a Behavior.

    Movie scripts don't get attached to sprites and they don't serve as frame scripts. They just sit in the cast. And if they have an 'on keyUp' handler in them, the handler will execute. Though you might want to have a look at the Lingo Dictionary and its entry concerning 'keyUp' for more detail about that.

    The only potential problem you might run into concerning placement in a movie script is that you might want your 'on keyUp' handler to just run in certain parts of the movie, not throughout the entire movie.

    If this is the case, then maybe putting it in a behavior script and making that behavior a frame script would be better.

    Best wishes with the piece, Ben, hope it's funky!

    ja
    [url]http://vispo.com/wfs4[/url]



    vispo webforumsuser@macromedia.com Guest

Similar Threads

  1. keyDown
    By Anne in forum ASP.NET
    Replies: 9
    Last Post: May 31st, 04:02 PM
  2. Keydown does not register if W3D on stage
    By fusion of elements in forum Macromedia Director 3D
    Replies: 3
    Last Post: February 1st, 05:14 PM
  3. Problem with Keydown and S3D
    By tbauser in forum Macromedia Director 3D
    Replies: 1
    Last Post: February 25th, 11:41 PM
  4. keyDown: in NSMatrix subclass
    By matt neuburg in forum Mac Programming
    Replies: 3
    Last Post: July 16th, 12:05 AM
  5. keyDown & keyUp?????
    By Nicollini webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 2
    Last Post: July 11th, 12:33 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139