<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community: Message List - Director 11.5- Creating a Random Button</title>
    <link>https://forums.adobe.com/community/director/director_basics?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Tue, 15 Jul 2014 20:17:47 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2014-07-15T20:17:47Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: Director 11.5- Creating a Random Button</title>
      <link>https://forums.adobe.com/message/6553231?tstart=0#6553231</link>
      <description>&lt;!-- [DocumentBodyStart:98676e3e-0384-4c9e-b395-ddea13af6f44] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;I'm not sure I understand your question, but supposing your frame numbers were placed in a list it might look like:&lt;/p&gt;&lt;p&gt;lFrames = [10, 12, 14, 16, 18, 20]&lt;/p&gt;&lt;p&gt;Then you could choose one of those items like James outlined. In order to not repeat the number you would remove it from the list&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:98676e3e-0384-4c9e-b395-ddea13af6f44] --&gt;&lt;img src='/beacon?t=1415949592011' /&gt;</description>
      <pubDate>Tue, 15 Jul 2014 20:17:47 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6553231?tstart=0#6553231</guid>
      <dc:date>2014-07-15T20:17:47Z</dc:date>
      <clearspace:dateToText>3 months 1 month ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Director 11.5- Creating a Random Button</title>
      <link>https://forums.adobe.com/message/6551552?tstart=0#6551552</link>
      <description>&lt;!-- [DocumentBodyStart:516e199d-fb8f-4331-99aa-caf4b6dbd6c7] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;How about for example the frame start with 10 - 20 and the frame interval is 2 , then how would you randomized the frame&amp;nbsp; without repeating the number? thanks !!! &lt;span aria-label="Happy" class="emoticon-inline emoticon_happy" style="height:16px;width:16px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Please help me!!! i'm just a student and i am working my special project called CAI.... thanks a lot for scrutinizing my message..&lt;span aria-label="Happy" class="emoticon-inline emoticon_happy" style="height:16px;width:16px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:516e199d-fb8f-4331-99aa-caf4b6dbd6c7] --&gt;</description>
      <pubDate>Tue, 15 Jul 2014 11:59:03 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6551552?tstart=0#6551552</guid>
      <dc:date>2014-07-15T11:59:03Z</dc:date>
      <clearspace:dateToText>4 months 1 hour ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Director 11.5- Creating a Random Button</title>
      <link>https://forums.adobe.com/message/2603487?tstart=0#2603487</link>
      <description>&lt;!-- [DocumentBodyStart:0672fc10-6914-46ce-b150-a5b607697d89] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;Thank you so much! That was a lot of help! Thanks for doing it step by step as well! &lt;span aria-label="Happy" class="emoticon-inline emoticon_happy" style="height:16px;width:16px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:0672fc10-6914-46ce-b150-a5b607697d89] --&gt;</description>
      <pubDate>Fri, 19 Feb 2010 13:54:49 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/2603487?tstart=0#2603487</guid>
      <dc:date>2010-02-19T13:54:49Z</dc:date>
      <clearspace:dateToText>4 years 9 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Director 11.5- Creating a Random Button</title>
      <link>https://forums.adobe.com/message/2600494?tstart=0#2600494</link>
      <description>&lt;!-- [DocumentBodyStart:37dfbe2d-0759-4f06-bf68-3baee6861671] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Let's imagine that your song markers are at frames 7, 14 and 35 (I've deliberately chosen frames which are not consecutive).&amp;nbsp; You could create a list of frame numbers: &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt; vSongFrames = [7, 14, 35]&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The behavior on your Random button could look like this:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;on mouseUp()&lt;/p&gt;&lt;p&gt; vSongFrames = [7, 14, 35] -- &amp;lt;HARD-CODED&amp;gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt; vSongCount = vSongFrames.count&lt;/p&gt;&lt;p&gt; vRandomSong = random(vSongCount)&lt;/p&gt;&lt;p&gt; vRandomFrame = vSongFrames[vRandomSong]&lt;/p&gt;&lt;p&gt; go vRandomFrame&lt;/p&gt;&lt;p&gt;end mouseUp&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What does this do?&amp;nbsp; It stores all your data concerning the frames that you could jump to in one place.&amp;nbsp; If you change the frame numbers, or the number of songs, you make that change in just one place.&amp;nbsp; In&amp;nbsp; the next 4 lines, the code:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Calculates how many songs you have, using the list of frame numbers as a guide&lt;/li&gt;&lt;li&gt;Chooses one of those songs at random&lt;/li&gt;&lt;li&gt;Works out which frame that song starts on&lt;/li&gt;&lt;li&gt;Jumps to that frame&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It's not normally a good idea to use hard-coded frame numbers.&amp;nbsp; You might decide to add frames or move the markers in the Score.&amp;nbsp; If you did that, the behavior would no longer work.&amp;nbsp; It would be better to use frame labels...&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt; vSongFrames = ["Name of marker for first song", "Second song", "Third song"]&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;... where the strings you use in the list are identical to the names of the markers in your movie.&amp;nbsp; You would still be hard-coding data, but that data is less likely to change.&amp;nbsp; Assuming that the marker label at frame 14 is "Second Song" then the commands...&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt; go 14&lt;/p&gt;&lt;p&gt;-- AND&lt;/p&gt;&lt;p&gt; go "Second Song"&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;... have exactly the same effect.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:37dfbe2d-0759-4f06-bf68-3baee6861671] --&gt;</description>
      <pubDate>Thu, 18 Feb 2010 11:30:17 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/2600494?tstart=0#2600494</guid>
      <dc:date>2010-02-18T11:30:17Z</dc:date>
      <clearspace:dateToText>4 years 9 months ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Director 11.5- Creating a Random Button</title>
      <link>https://forums.adobe.com/message/2595341?tstart=0#2595341</link>
      <description>&lt;!-- [DocumentBodyStart:151baf15-4431-449f-9746-d9250b2fb132] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;umm...kinda?...I'm sorry i am a beginner at Director...only an A2 student!We only have to have 3 songs....Right! to get it to go to the next page, i have the markey way, so on Mouse Down, go to Marker 7 for example...umm...how would i do that with the random button thing?....do i enter the name of the song after it?....the sprite number?...i am so confused...&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:151baf15-4431-449f-9746-d9250b2fb132] --&gt;</description>
      <pubDate>Tue, 16 Feb 2010 18:23:57 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/2595341?tstart=0#2595341</guid>
      <dc:date>2010-02-16T18:23:57Z</dc:date>
      <clearspace:dateToText>4 years 9 months ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Director 11.5- Creating a Random Button</title>
      <link>https://forums.adobe.com/message/2594888?tstart=0#2594888</link>
      <description>&lt;!-- [DocumentBodyStart:54f9e1bc-7118-48a1-bd33-96291208aa48] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;You can use &lt;a class="jive-link-external-small" href="http://help.adobe.com/en_US/Director/11.5/UsingScripting/WSc3ff6d0ea77859461172e0811d64c1a1b3-7fb5.html" rel="nofollow"&gt;random()&lt;/a&gt; to choose a random number.&amp;nbsp; If you have 17 song titles, then you could use:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt; vRandomSongNumber = random(17)&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Suppose your other buttons do something like this:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;on mouseUp()&lt;/p&gt;&lt;p&gt;&amp;nbsp; PlaySong(3) -- or whatever system you use to decide which song to play&lt;/p&gt;&lt;p&gt;end mouseUp&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Your random button could do this:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;on mouseUp()&lt;/p&gt;&lt;p&gt;&amp;nbsp; vRandomSongNumber = random(17) -- or however many songs there are to choose from&lt;/p&gt;&lt;p&gt;&amp;nbsp; PlaySong(vRandomSongNumber)&lt;/p&gt;&lt;p&gt;end mouseUp&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Does that help?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:54f9e1bc-7118-48a1-bd33-96291208aa48] --&gt;</description>
      <pubDate>Tue, 16 Feb 2010 16:06:57 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/2594888?tstart=0#2594888</guid>
      <dc:date>2010-02-16T16:06:57Z</dc:date>
      <clearspace:dateToText>4 years 9 months ago</clearspace:dateToText>
      <clearspace:replyCount>5</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Director 11.5- Creating a Random Button</title>
      <link>https://forums.adobe.com/message/2594849?tstart=0#2594849</link>
      <description>&lt;!-- [DocumentBodyStart:3e4f6ef8-5894-4a43-ab69-3399f36a1268] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;you can use the random() method&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;for example:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;-- behavior script attached to your 'random' button&lt;/p&gt;&lt;p&gt;on mouseUp me&lt;/p&gt;&lt;p&gt;&amp;nbsp; i = 120 -- number of songs&lt;/p&gt;&lt;p&gt;&amp;nbsp; rnd = random(120)&lt;/p&gt;&lt;p&gt;&amp;nbsp; sound(1).play(member("karaokeX"))&lt;/p&gt;&lt;p&gt;end&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;without more information on how you have things configured there's really no way to help.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:3e4f6ef8-5894-4a43-ab69-3399f36a1268] --&gt;</description>
      <pubDate>Tue, 16 Feb 2010 15:40:38 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/2594849?tstart=0#2594849</guid>
      <dc:date>2010-02-16T15:40:38Z</dc:date>
      <clearspace:dateToText>4 years 9 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Director 11.5- Creating a Random Button</title>
      <link>https://forums.adobe.com/message/2594719?tstart=0#2594719</link>
      <description>&lt;!-- [DocumentBodyStart:d0ff2f05-2292-4d52-8d09-958515698e76] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;Hiya! I am creating a karaoke product using Director 11.5 and in the main menu, i wanted to add the option of for the user to click on a button named 'Random'. This obviously meant that somehow the product would choose a song for the user....umm...is there anyway to do this?....Anyone? I look forward to hearing from you guys!&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:d0ff2f05-2292-4d52-8d09-958515698e76] --&gt;</description>
      <pubDate>Tue, 16 Feb 2010 15:01:58 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/2594719?tstart=0#2594719</guid>
      <dc:date>2010-02-16T15:01:58Z</dc:date>
      <clearspace:dateToText>4 years 9 months ago</clearspace:dateToText>
      <clearspace:replyCount>7</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

