# A flashing node for the edit screen - requeset

**URL:** <https://discourse.nodered.org/t/a-flashing-node-for-the-edit-screen-requeset/76698>\
**Category:** Feature Requests\
**Created:** [18 March 2023 20:59 UTC](https://discourse.nodered.org/t/a-flashing-node-for-the-edit-screen-requeset/76698 "2023-03-18T20:59:20Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [20 March 2023 20:46 UTC](https://discourse.nodered.org/t/a-flashing-node-for-the-edit-screen-requeset/76698/21 "2023-03-20T20:46:32Z")

</div>

> [@Trying\_to\_learn](#):
>
> I posted the node as a subflow just now.

Nice. We're just a bit out of sync here. I'm not sure I see the advantage of a subflow as opposed to just making copies of the `function`, but it's a matter of your programming style.

> [@Trying\_to\_learn](#):
>
> And the colour the node helps you see it in the flow.

It certainly is visible -- not in the recommended "[muted palette](https://nodered.org/docs/creating-nodes/appearance)."

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [20 March 2023 20:50 UTC](https://discourse.nodered.org/t/a-flashing-node-for-the-edit-screen-requeset/76698/22 "2023-03-20T20:50:20Z")

</div>

Yeah.

Although you did explain how to do the `env` in a `function` node.....  
This way it is more......  
The way it is set is _easier_?

THANKS VERY MUCH for that.  
I haven't got enough skill to do that sort of stuff really.  
I do have things like that in VERY SPECIFIC parts and not often. So I didn't want to try it.

And yes the colour is there to get your eyes to see them when in/on the EDIT screen so you can delete them when done. 😉

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [21 March 2023 04:04 UTC](https://discourse.nodered.org/t/a-flashing-node-for-the-edit-screen-requeset/76698/23 "2023-03-21T04:04:48Z")

</div>

I tweaked it a bit more.

```auto
[{"id":"1010fc4793a4d132","type":"subflow","name":"Debug Alert","info":"2023 03 21\n==\n\nUsed to indicate message passing this point\nin the flow.\nTHIS IS AN INDICATION ONLY!\nIt does NOT pass the message!\n\n`message` is the message flashed and maybe\nshown in the `degub` window (right side)\n`warnings` determins if the `debug` message\nis also shown. `true` == shown.","category":"","in":[{"x":60,"y":80,"wires":[{"id":"5cc79293a6fbfc60"}]}],"out":[{"x":340,"y":80,"wires":[{"id":"5cc79293a6fbfc60","port":0}]}],"env":[{"name":"message","type":"str","value":"","ui":{"label":{"en-US":"Messages"}}},{"name":"warnings","type":"bool","value":"true","ui":{"label":{"en-US":"Warnings on/off"},"type":"input","opts":{"types":["bool"]}}}],"meta":{},"color":"#BB0000","icon":"node-red/alert.svg","status":{"x":340,"y":130,"wires":[{"id":"10226f443ccc05c3","port":0}]}},{"id":"5cc79293a6fbfc60","type":"function","z":"1010fc4793a4d132","name":"Alert","func":"//=====================================================\n// Get variables and set things up.\nlet warnings = env.get(\"warnings\") || false;\nlet timerID;\nlet count = 6; // 3 pulses\nlet interval = 500; // ms\nlet sOff = {};\nlet sOn = {};\nlet message = env.get(\"message\") || \"Look at me\";\n//=====================================================\n\n//--------------------------\n// Should warnings be sent?\nif (warnings)\n{\n node.warn(message);\n}\n//--------------------------\n\n//--------------------------\n// Blink message under node.\nsOn = {fill:\"red\",shape:\"dot\",text:message}\nlet s = sOn\nnode.status(s)\nchangeColor()\nreturn msg\n//--------------------------\n\n//--------------------------\n// Functions below\n//--------------------------\nfunction changeColor() {\n if (!timerID) {\n timerID = setInterval(flashStatus, interval);\n }\n}\n\nfunction flashStatus() {\n if (--count != 0) {\n s = s == sOff ? sOn : sOff\n node.status(s)\n } else {\n clearTimeout(timerID)\n timerID = null\n }\n}\n//--------------------------","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":190,"y":80,"wires":[[]]},{"id":"10226f443ccc05c3","type":"status","z":"1010fc4793a4d132","name":"","scope":null,"x":200,"y":130,"wires":[[]]},{"id":"43cfa2f75dac4787","type":"subflow:1010fc4793a4d132","z":"aaa025a7d2bb5b14","name":"","env":[{"name":"message","value":"DING","type":"str"},{"name":"warnings","value":"false","type":"bool"},{"name":"Pulses","value":"6","type":"num"}],"x":3490,"y":590,"wires":[[]]}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 May 2023 04:05 UTC](https://discourse.nodered.org/t/a-flashing-node-for-the-edit-screen-requeset/76698/24 "2023-05-20T04:05:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/a-flashing-node-for-the-edit-screen-requeset/76698.md?page=1)
