# Coding Questions

**URL:** https://discourse.processing.org/c/p5js/p5js-questions/18.md?page=53

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 54

---

## [How to remove the "loading" message from preload()](https://discourse.processing.org/t/how-to-remove-the-loading-message-from-preload/3317)

<div class="topic-metadata">

**Author:** [@currymike](https://discourse.processing.org/u/currymike)\
**Replies:** 4\
**Last updated:** [September 7, 2018, 2:45pm UTC](https://discourse.processing.org/t/how-to-remove-the-loading-message-from-preload/3317 "2018-09-07T14:45:34Z")

</div>

Is there a way to remove the “loading” message when the preload function is running? I’m fine with the screen being blank, just need the loading gone. I can’t seem to find the answer in the P5.JS reference. Any help w…

---

## [Space Invaders Enachments Design](https://discourse.processing.org/t/space-invaders-enachments-design/3106)

<div class="topic-metadata">

**Author:** [@Vazco18](https://discourse.processing.org/u/Vazco18)\
**Replies:** 7\
**Last updated:** [August 31, 2018, 9:24pm UTC](https://discourse.processing.org/t/space-invaders-enachments-design/3106 "2018-08-31T21:24:40Z")

</div>

Hi, First of all, I’m a starter to P5 and I’ve started on my semester 2 Project “Space Invaders”, Source file Download link via One Drive = https://scuonline-my.sharepoint.com/:f:/g/personal/t\_charles\_12\_student\_s…

---

## [Assignment due soon i need help pls](https://discourse.processing.org/t/assignment-due-soon-i-need-help-pls/2904)

<div class="topic-metadata">

**Author:** [@codinghelppls12009](https://discourse.processing.org/u/codinghelppls12009)\
**Replies:** 8\
**Last updated:** [August 31, 2018, 9:20am UTC](https://discourse.processing.org/t/assignment-due-soon-i-need-help-pls/2904 "2018-08-31T09:20:58Z")

</div>

I have an assignment due and I need help within the next 5 hours. I am desperate pls help me. I will fail,. I feel like it all SHOULD work but it doesn’t. Please help me. What I need help with: my bee picture deletes …

---

## [Problem with DOM button causing site to reload](https://discourse.processing.org/t/problem-with-dom-button-causing-site-to-reload/3086)

<div class="topic-metadata">

**Author:** [@Bitstrips](https://discourse.processing.org/u/Bitstrips)\
**Replies:** 2\
**Last updated:** [August 29, 2018, 1:37am UTC](https://discourse.processing.org/t/problem-with-dom-button-causing-site-to-reload/3086 "2018-08-29T01:37:42Z")

</div>

I’m not sure if the button click is the source but when I submit the numbers the result would dissapear nearly instantly and then dissapear because of the site reloading. I want a result to show up at the output class. I …

---

## [How to test which button is checked of an existing radio buttons family?](https://discourse.processing.org/t/how-to-test-which-button-is-checked-of-an-existing-radio-buttons-family/2849)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 2\
**Last updated:** [August 22, 2018, 2:07pm UTC](https://discourse.processing.org/t/how-to-test-which-button-is-checked-of-an-existing-radio-buttons-family/2849 "2018-08-22T14:07:01Z")

</div>

Hi everyone. I’m used to write my own statitc html code into the index.html file of p5.js sketch. So I use the select() function of the DOM library to access html elements such INPUT of type text/passwordor or SELECT htm…

---

## [Working with mouseDragged() and other mouse events inside a class](https://discourse.processing.org/t/working-with-mousedragged-and-other-mouse-events-inside-a-class/2829)

<div class="topic-metadata">

**Author:** [@tony](https://discourse.processing.org/u/tony)\
**Replies:** 5\
**Last updated:** [August 22, 2018, 7:38am UTC](https://discourse.processing.org/t/working-with-mousedragged-and-other-mouse-events-inside-a-class/2829 "2018-08-22T07:38:08Z")

</div>

I usually work with the philosophy of “code now, fix later”. However, in my recent work, I’ve been trying to plan out my code ahead of time. So my question right now is, what’s the best way for working with mouseDragged(…

---

## [\[SOLVED\] Accessing html elements defined into .html file?](https://discourse.processing.org/t/solved-accessing-html-elements-defined-into-html-file/2701)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 2\
**Last updated:** [August 21, 2018, 8:56am UTC](https://discourse.processing.org/t/solved-accessing-html-elements-defined-into-html-file/2701 "2018-08-21T08:56:51Z")

</div>

Hi everyone, Is there a way to access already existing HTML element defined in the .html page of a p5.js project? For instance, I’d like to be able to read the text value of an HTML input element. I know that the p5.dom…

---

## [\[SOLVED\] \[p5.dom\] Problem loading video](https://discourse.processing.org/t/solved-p5-dom-problem-loading-video/2734)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 3\
**Last updated:** [August 18, 2018, 3:36pm UTC](https://discourse.processing.org/t/solved-p5-dom-problem-loading-video/2734 "2018-08-18T15:36:09Z")

</div>

Hi everyone. I don’t know what I’m doing wrong when loading a video (in order to display it just after loading). Here is my .js and .html code: js.code function preload() { vid = createVideo('videos/20th\_Century\_St…

---

## [Line inside for() wont go behind image](https://discourse.processing.org/t/line-inside-for-wont-go-behind-image/2736)

<div class="topic-metadata">

**Author:** [@leo](https://discourse.processing.org/u/leo)\
**Replies:** 5\
**Last updated:** [August 17, 2018, 10:29pm UTC](https://discourse.processing.org/t/line-inside-for-wont-go-behind-image/2736 "2018-08-17T22:29:17Z")

</div>

Hello everyone,can someone help me with this codepen? I can’t get the lines to go behind the big central circle, even putting the center image before the for(). var canvas; var width = window.innerWidth; var height = wi…

---

## [Loading images sometimes works and sometimes doesn't](https://discourse.processing.org/t/loading-images-sometimes-works-and-sometimes-doesnt/2562)

<div class="topic-metadata">

**Author:** [@Pork](https://discourse.processing.org/u/Pork)\
**Replies:** 3\
**Last updated:** [August 11, 2018, 8:23pm UTC](https://discourse.processing.org/t/loading-images-sometimes-works-and-sometimes-doesnt/2562 "2018-08-11T20:23:25Z")

</div>

Here’s what I’m trying to do. Sometimes when you refresh it works just fine. Sometimes I get this error: If you can’t see its says: Uncaught TypeError: Cannot read property ‘width’ of undefined at e.image (p5.min…

---

## [Multi line Text box needed!](https://discourse.processing.org/t/multi-line-text-box-needed/2318)

<div class="topic-metadata">

**Author:** [@codingking03](https://discourse.processing.org/u/codingking03)\
**Replies:** 16\
**Last updated:** [August 6, 2018, 1:37am UTC](https://discourse.processing.org/t/multi-line-text-box-needed/2318 "2018-08-06T01:37:24Z")

</div>

Is there any function for a multi line textbox input? like createInput() but in paragraph form like the one im typing in right now

---

## [Wrong item in array is being edited (I think), p5.js. Help!](https://discourse.processing.org/t/wrong-item-in-array-is-being-edited-i-think-p5-js-help/2275)

<div class="topic-metadata">

**Author:** [@will821](https://discourse.processing.org/u/will821)\
**Replies:** 2\
**Last updated:** [August 1, 2018, 6:04pm UTC](https://discourse.processing.org/t/wrong-item-in-array-is-being-edited-i-think-p5-js-help/2275 "2018-08-01T18:04:30Z")

</div>

Hi there, I’m trying to make an array of objects which will change fill when the mouse is inside the object. I have got it to work when it was a single object but now there are multiple there is a bug which is filling a…

---

## [Problems Loading External JSON File](https://discourse.processing.org/t/problems-loading-external-json-file/2189)

<div class="topic-metadata">

**Author:** [@lazordisk](https://discourse.processing.org/u/lazordisk)\
**Replies:** 1\
**Last updated:** [July 30, 2018, 8:56am UTC](https://discourse.processing.org/t/problems-loading-external-json-file/2189 "2018-07-30T08:56:03Z")

</div>

Hello! I’m attempting to load data from an external file, where my JSON data, which is called something like exampleJSON.json and is stored in a separate JSON folder, looks like this: { "Pride and Prejudice.txt": { …

---

## [Access many files from a directory in p5](https://discourse.processing.org/t/access-many-files-from-a-directory-in-p5/2186)

<div class="topic-metadata">

**Author:** [@AFNordal](https://discourse.processing.org/u/AFNordal)\
**Replies:** 1\
**Last updated:** [July 29, 2018, 9:20pm UTC](https://discourse.processing.org/t/access-many-files-from-a-directory-in-p5/2186 "2018-07-29T21:20:59Z")

</div>

Is there a way of accessing many files without hard-coding their names manually (or having their names be “1.txt”,“2.txt”,“3.txt”,“4.txt”…)? In processing you would use file.list(), but as far as I know this doesn’t exis…

---

## [Integrate library into angular app](https://discourse.processing.org/t/integrate-library-into-angular-app/1110)

<div class="topic-metadata">

**Author:** [@jajanps](https://discourse.processing.org/u/jajanps)\
**Replies:** 5\
**Last updated:** [July 27, 2018, 11:49am UTC](https://discourse.processing.org/t/integrate-library-into-angular-app/1110 "2018-07-27T11:49:06Z")

</div>

I am trying to use this library in .net core angular app. Please tell me how should I do this. I am new to angular

---

## [How can I use the input value as a variable with two arguments?](https://discourse.processing.org/t/how-can-i-use-the-input-value-as-a-variable-with-two-arguments/1623)

<div class="topic-metadata">

**Author:** [@jcponce](https://discourse.processing.org/u/jcponce)\
**Replies:** 7\
**Last updated:** [July 27, 2018, 4:29am UTC](https://discourse.processing.org/t/how-can-i-use-the-input-value-as-a-variable-with-two-arguments/1623 "2018-07-27T04:29:51Z")

</div>

Hi everyone, I was able to plot complex functions using the method of domain coloring https://openprocessing.org/sketch/569018 and now I have been trying to add two inputs for changing the real and imaginary component…

---

## [Append a text file](https://discourse.processing.org/t/append-a-text-file/2004)

<div class="topic-metadata">

**Author:** [@Lightiix](https://discourse.processing.org/u/Lightiix)\
**Replies:** 1\
**Last updated:** [July 25, 2018, 1:48pm UTC](https://discourse.processing.org/t/append-a-text-file/2004 "2018-07-25T13:48:51Z")

</div>

Hello everyone, I am writing a program using p5.js for broswser, and I want to save ma data in a text file. I am able to load the file with loadStrings() but every function to save the data prompts download to the clie…

---

## [Controlling Textures on p5 + WebGL box](https://discourse.processing.org/t/controlling-textures-on-p5-webgl-box/1105)

<div class="topic-metadata">

**Author:** [@Quilliam](https://discourse.processing.org/u/Quilliam)\
**Replies:** 2\
**Last updated:** [July 24, 2018, 11:10am UTC](https://discourse.processing.org/t/controlling-textures-on-p5-webgl-box/1105 "2018-07-24T11:10:41Z")

</div>

Hi all, I’m weighing up whether to embark on a 3D, block based diorama game in CSS3 (3d transforms) or in p5 + WebGL. There are lots of issues in making a 3D isometric map with CSS3 so I’m hoping you guys have an answer…

---

## [Lorenz Attractor from Processing to p5.js](https://discourse.processing.org/t/lorenz-attractor-from-processing-to-p5-js/2000)

<div class="topic-metadata">

**Author:** [@XavierDass](https://discourse.processing.org/u/XavierDass)\
**Replies:** 5\
**Last updated:** [July 23, 2018, 8:52am UTC](https://discourse.processing.org/t/lorenz-attractor-from-processing-to-p5-js/2000 "2018-07-23T08:52:46Z")

</div>

I was enjoying making a little Lorenz attractor in p5.js, couldn’t figure out how to make a nice gradient, so I went searching and found @shiffman’s great example in Processing, (here). But I notice that p5.js does not …

---

## [Why does createCanvas runs twice](https://discourse.processing.org/t/why-does-createcanvas-runs-twice/1982)

<div class="topic-metadata">

**Author:** [@Kris](https://discourse.processing.org/u/Kris)\
**Replies:** 3\
**Last updated:** [July 22, 2018, 6:04pm UTC](https://discourse.processing.org/t/why-does-createcanvas-runs-twice/1982 "2018-07-22T18:04:27Z")

</div>

Extending the p5 class, I noticed that the createCanvas method runs twice. It runs without calling it. Is this a normal behavior, and if so why ? ORR…, did I something wrong :slight\_smile:

---

## [Flappy birds notepad++ javascript](https://discourse.processing.org/t/flappy-birds-notepad-javascript/1975)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 2\
**Last updated:** [July 22, 2018, 3:53pm UTC](https://discourse.processing.org/t/flappy-birds-notepad-javascript/1975 "2018-07-22T15:53:11Z")

</div>

OK, i’m making flappy birds using notepad ++ javascript. I was following along with this tutorial after adding the files from his neural network videos and when he tested his program mine didn’t work. I che…

---

## [Finding pixels inside a shape](https://discourse.processing.org/t/finding-pixels-inside-a-shape/1829)

<div class="topic-metadata">

**Author:** [@talisman](https://discourse.processing.org/u/talisman)\
**Replies:** 4\
**Last updated:** [July 16, 2018, 8:30pm UTC](https://discourse.processing.org/t/finding-pixels-inside-a-shape/1829 "2018-07-16T20:30:53Z")

</div>

Hi all , I have a ‘bouncing ball’ , of sorts . If you have followed Dan Shiffmans’ tutorials you must have encountered one. I want to show the underlying captured video only within the bouncing ball, like a spotlight. …

---

## [\[SOLVED\] TypeError: xml.getChildren is not a function](https://discourse.processing.org/t/solved-typeerror-xml-getchildren-is-not-a-function/1697)

<div class="topic-metadata">

**Author:** [@T\_mex](https://discourse.processing.org/u/T_mex)\
**Replies:** 3\
**Last updated:** [July 11, 2018, 7:35pm UTC](https://discourse.processing.org/t/solved-typeerror-xml-getchildren-is-not-a-function/1697 "2018-07-11T19:35:54Z")

</div>

I’m running into an issue when trying to parse an XML file using getChildren(). var xml = new p5.XML(); xml = loadXML("XML/UserInfo.xml"); print(xm.getChildren('User')); The error I’m getting is “TypeError: xmlFil…

---

## [Question switched to p5.js category](https://discourse.processing.org/t/question-switched-to-p5-js-category/1608)

<div class="topic-metadata">

**Author:** [@ville2008](https://discourse.processing.org/u/ville2008)\
**Replies:** 4\
**Last updated:** [July 10, 2018, 4:10pm UTC](https://discourse.processing.org/t/question-switched-to-p5-js-category/1608 "2018-07-10T16:10:34Z")

</div>

when i play my game and eat a food and then move it sometimes removes my scale heres my source code sketch source: (where my move runs) var s; var scl = 20; var food = 20; var foods = 0; var foodU = foods; function se…

---

## [Rita.js kwic - get keyword HTML (meta)info](https://discourse.processing.org/t/rita-js-kwic-get-keyword-html-meta-info/774)

<div class="topic-metadata">

**Author:** [@catarinalee](https://discourse.processing.org/u/catarinalee)\
**Replies:** 0\
**Last updated:** [June 7, 2018, 3:44pm UTC](https://discourse.processing.org/t/rita-js-kwic-get-keyword-html-meta-info/774 "2018-06-07T15:44:25Z")

</div>

This problem is resolved

---

## [Show Webcam Stream](https://discourse.processing.org/t/show-webcam-stream/1337)

<div class="topic-metadata">

**Author:** [@oligor77](https://discourse.processing.org/u/oligor77)\
**Replies:** 6\
**Last updated:** [June 29, 2018, 11:39pm UTC](https://discourse.processing.org/t/show-webcam-stream/1337 "2018-06-29T23:39:41Z")

</div>

Hi there, is there any way to display a webcam stream? The Video Element in the example shows only a way to display video files. Thanks a lot for a hint.

---

## [Help with rotation stuff](https://discourse.processing.org/t/help-with-rotation-stuff/1173)

<div class="topic-metadata">

**Author:** [@CrispyCabot](https://discourse.processing.org/u/CrispyCabot)\
**Replies:** 6\
**Last updated:** [June 27, 2018, 7:31pm UTC](https://discourse.processing.org/t/help-with-rotation-stuff/1173 "2018-06-27T19:31:25Z")

</div>

I’ve been working on this a while and I just can’t figure it out. Bare bones, I am trying to detect if a point is inside a rotated rectangle. The starting values that I have is: Rotation amount in degrees Center point …

---

## [Updating a text file](https://discourse.processing.org/t/updating-a-text-file/1265)

<div class="topic-metadata">

**Author:** [@CrispyCabot](https://discourse.processing.org/u/CrispyCabot)\
**Replies:** 2\
**Last updated:** [June 26, 2018, 2:09pm UTC](https://discourse.processing.org/t/updating-a-text-file/1265 "2018-06-26T14:09:28Z")

</div>

So I am trying to make a scoreboard. I have done it before in regular processing, but I have just now realized that with p5js, it downloads the file rather than saving it to a folder, which I guess makes sense. So is the…

---

## [Drop() function working randomly](https://discourse.processing.org/t/drop-function-working-randomly/1244)

<div class="topic-metadata">

**Author:** [@colin](https://discourse.processing.org/u/colin)\
**Replies:** 6\
**Last updated:** [June 26, 2018, 9:08am UTC](https://discourse.processing.org/t/drop-function-working-randomly/1244 "2018-06-26T09:08:42Z")

</div>

Hi. I’m definitely having trouble to make my drag and drop function working. The sketch below grabs the image from the user but don’t manage to save it as a p5 image every time. I’m around 33% successful drops. Any idea…

---

## [P5.js not displayed in my web site](https://discourse.processing.org/t/p5-js-not-displayed-in-my-web-site/1204)

<div class="topic-metadata">

**Author:** [@eli94](https://discourse.processing.org/u/eli94)\
**Replies:** 4\
**Last updated:** [June 24, 2018, 10:27pm UTC](https://discourse.processing.org/t/p5-js-not-displayed-in-my-web-site/1204 "2018-06-24T22:27:32Z")

</div>

Hi everybody, my professor chosen a p5.js from internet to do exercises with p5.js. This p5.js sketch is not displayed in my website but it is displayed and work very well separate from the website. I want to be more cl…

[Previous page](https://discourse.processing.org/c/p5js/p5js-questions/18.md?page=52)

[Next page](https://discourse.processing.org/c/p5js/p5js-questions/18.md?page=54)
