﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » Flashing background at random times</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Tue, 07 Apr 2026 23:18:51 GMT</lastBuildDate><ttl>20</ttl><item><title>Flashing background at random times</title><link>https://forums.millisecond.com/Topic29264.aspx</link><description>I am trying to modify the Bart script(found at &lt;a href="https://www.millisecond.com/download/library/bart/)"&gt;https://www.millisecond.com/download/library/bart/)&lt;/a&gt; by having the screen flash red in the init trial. I would like this to happen randomly only in let's say 20 of the 30 times the trial runs. Question is how does one make it so that it does not flash every time, rather a set number of times, and not necessarily all in a row as well? What I have added so far is a simple background shape which flashes in /ontrialbegin in the init trial</description><pubDate>Wed, 17 Jun 2020 16:53:07 GMT</pubDate><dc:creator>Dragos</dc:creator></item><item><title>RE: Flashing background at random times</title><link>https://forums.millisecond.com/Topic29268.aspx</link><description>&lt;blockquote data-id="29267" class="if-quote-wrapper" unselectable="on" data-guid="1592412769008" id="if_insertedNode_1592412768503" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29267" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29267" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29267" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dragos - 6/17/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29267"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="29265" class="if-quote-wrapper" unselectable="on" data-guid="1592412769008" id="if_insertedNode_1592412293623" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29265" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29265" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29265" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/17/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29265"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Sample a value from the list ontrialbegin and store it in a &amp;lt;values&amp;gt; entry.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29265"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;How should I sample at random from the list? I Have added as per your advice the following:&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list flashing&amp;gt;&lt;br/&gt;/ items = (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0)&lt;br/&gt;/ replace = false&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ flashing = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial init&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp; &amp;nbsp; ...&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.flashing = list.flashing.?&lt;br/&gt;&amp;nbsp; &amp;nbsp; ...&lt;br/&gt;]&lt;br/&gt;&lt;br/&gt;Also, what do you mean by inserting the shapes? Changing the color from white to red?&lt;a class="if-quote-goto quote-link" href="#" data-id="29267"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;See the script attached to my previous reply. </description><pubDate>Wed, 17 Jun 2020 16:53:07 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Flashing background at random times</title><link>https://forums.millisecond.com/Topic29267.aspx</link><description>&lt;blockquote data-id="29265" class="if-quote-wrapper" unselectable="on" data-guid="1592412294063" contenteditable="false" id="if_insertedNode_1592412293623"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29265" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29265" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29265" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/17/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29265"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Sample a value from the list ontrialbegin and store it in a &amp;lt;values&amp;gt; entry.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29265"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;How should I sample at random from the list? I Have added as per your advice the following:&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list flashing&amp;gt;&lt;br/&gt;/ items = (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0)&lt;br/&gt;/ replace = false&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ flashing = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial init&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp; &amp;nbsp; ...&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.flashing = list.flashing.?&lt;br/&gt;&amp;nbsp; &amp;nbsp; ...&lt;br/&gt;]&lt;br/&gt;&lt;br/&gt;Also, what do you mean by inserting the shapes? Changing the color from white to red?</description><pubDate>Wed, 17 Jun 2020 16:49:12 GMT</pubDate><dc:creator>Dragos</dc:creator></item><item><title>RE: Flashing background at random times</title><link>https://forums.millisecond.com/Topic29266.aspx</link><description>&lt;blockquote data-id="29265" class="if-quote-wrapper" unselectable="on" data-guid="1592412399257" id="if_insertedNode_1592412397593" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29265" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29265" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29265" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/17/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29265"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="29264" class="if-quote-wrapper" unselectable="on" data-guid="1592412399257" id="if_insertedNode_1592410845477" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29264" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29264" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29264" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dragos - 6/17/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29264"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I am trying to modify the Bart script(found at &lt;a href="https://www.millisecond.com/download/library/bart/)"&gt;&lt;a href="https://www.millisecond.com/download/library/bart/)"&gt;https://www.millisecond.com/download/library/bart/)&lt;/a&gt;&lt;/a&gt; by having the screen flash red in the init trial. I would like this to happen randomly only in let's say 20 of the 30 times the trial runs. Question is how does one make it so that it does not flash every time, rather a set number of times, and not necessarily all in a row as well? What I have added so far is a simple background shape which flashes in /ontrialbegin in the init trial&lt;a class="if-quote-goto quote-link" href="#" data-id="29264"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Set up a &amp;lt;list&amp;gt; containing, say, 10 x the value 0 (indicating no flash) and 20 x the value 1 (indicating flash). Sample a value from the list ontrialbegin and store it in a &amp;lt;values&amp;gt; entry. Then insert the flashing shape(s) conditionally /ontrialbegin (if the sample value is 1, insert else do nothing), and /ontrialend perform trial.init.resetstimulusframes().&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29265"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Quick example modification attached below. This should give you the general idea.</description><pubDate>Wed, 17 Jun 2020 16:48:08 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Flashing background at random times</title><link>https://forums.millisecond.com/Topic29265.aspx</link><description>&lt;blockquote data-id="29264" class="if-quote-wrapper" unselectable="on" data-guid="1592410846587" id="if_insertedNode_1592410845477" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29264" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29264" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29264" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dragos - 6/17/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29264"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I am trying to modify the Bart script(found at &lt;a href="https://www.millisecond.com/download/library/bart/)"&gt;&lt;a href="https://www.millisecond.com/download/library/bart/)"&gt;https://www.millisecond.com/download/library/bart/)&lt;/a&gt;&lt;/a&gt; by having the screen flash red in the init trial. I would like this to happen randomly only in let's say 20 of the 30 times the trial runs. Question is how does one make it so that it does not flash every time, rather a set number of times, and not necessarily all in a row as well? What I have added so far is a simple background shape which flashes in /ontrialbegin in the init trial&lt;a class="if-quote-goto quote-link" href="#" data-id="29264"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Set up a &amp;lt;list&amp;gt; containing, say, 10 x the value 0 (indicating no flash) and 20 x the value 1 (indicating flash). Sample a value from the list ontrialbegin and store it in a &amp;lt;values&amp;gt; entry. Then insert the flashing shape(s) conditionally /ontrialbegin (if the sample value is 1, insert else do nothing), and /ontrialend perform trial.init.resetstimulusframes().&lt;br/&gt;</description><pubDate>Wed, 17 Jun 2020 16:24:26 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>