# Help i m beginner and i don't understand whats happend

**URL:** <https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982>\
**Category:** Libraries\
**Created:** [October 21, 2021, 8:48am UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982 "2021-10-21T08:48:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hiram-Belgium](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hiram-belgium/32/4874_2.png) [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Post date:** [October 21, 2021, 8:48am UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/1 "2021-10-21T08:48:08Z")

</div>

Hello, my English is bad, I am French!  
I uploaded a file to openprocessing to study the mechanism of an automatic write that I need. I am under visualcode … Cannot run the program because I have an error (view in the console) Uncaught ReferenceError: p5ex is not defined at mySketch.js: 157 I’m not very good at it! Can someone explain to me where the error is so that I can run this code. Thank you  
Processing: sketch570487.zip…  
This is the file ! [WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free](https://we.tl/t-68Hjq4TMkd)

---

<div class="post-metadata">

**Author:** ![KumuPaul](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kumupaul/32/13072_2.png) [@KumuPaul](https://discourse.processing.org/u/KumuPaul)\
**Post date:** [October 21, 2021, 9:33am UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/2 "2021-10-21T09:33:35Z")

</div>

Please share a link to your sketch on [OpenProcessing.org](http://OpenProcessing.org) or [editor.p5js.org](http://editor.p5js.org) or include you code in your post here (click the \</\> button in the toolbar to get proper formatting). I’m not comfortable clicking on the link your provided.

---

<div class="post-metadata">

**Author:** ![Hiram-Belgium](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hiram-belgium/32/4874_2.png) [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Post date:** [October 21, 2021, 10:14am UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/3 "2021-10-21T10:14:45Z")

</div>

Thank you !  
It s NOT mine sketch, it s a sketch i would like study and modify beacaus it s the asemic writing i want to learn !  
[https://openprocessing.org/sketch/570487](https://openprocessing.org/sketch/570487)  
It work on line but not from Visualcode?

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [October 21, 2021, 10:57am UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/4 "2021-10-21T10:57:35Z")

</div>

Funny how similar the sketch is to this one [Muotoja sanoista - OpenProcessing](https://openprocessing.org/sketch/102142) from 2013 🙂

The sketch in openprocessing is using an additional JavaScript library:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4a719e50bdaeafd26f399945b4b1b541f2c4075f.png)

It contains additional helper functions. Here’s the documentation:  
[https://fal-works.github.io/p5ex/doc/index.html](https://fal-works.github.io/p5ex/doc/index.html)  
and this seems to be the homepage: [p5ex.js | p5ex](https://fal-works.github.io/p5ex/)

---

<div class="post-metadata">

**Author:** ![Hiram-Belgium](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hiram-belgium/32/4874_2.png) [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Post date:** [October 21, 2021, 11:55am UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/5 "2021-10-21T11:55:44Z")

</div>

And please what is my mistake because it doesn’t work in local in visualcode this is index.html

```
<head>

<script src="mySketch.js" type="text/javascript"></script>

<script src="https://cdn.jsdelivr.net/npm/p5@0.6.0/lib/p5.min.js" type="text/javascript">

</script><script src="https://unpkg.com/p5ex@0.5.6/lib/p5ex.min.js" type="text/javascript"></script>="http

</head>

```

---

<div class="post-metadata">

**Author:** ![Hiram-Belgium](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hiram-belgium/32/4874_2.png) [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Post date:** [October 21, 2021, 12:35pm UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/6 "2021-10-21T12:35:51Z")

</div>

![2021-10-21_143438](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/645ec81999a1025541f3f71e6262fb21f9c2b7b5.jpeg)

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [October 21, 2021, 12:37pm UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/7 "2021-10-21T12:37:48Z")

</div>

When you open your sketch, does the URL look like `file:///` or like `http://localhost/` ?

Maybe you can open the console, the Network tab, and reload your page, see if any of the files are not found?

But someone else who works with JS should help you. I’m not using it lately.

---

<div class="post-metadata">

**Author:** ![Hiram-Belgium](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hiram-belgium/32/4874_2.png) [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Post date:** [October 21, 2021, 12:46pm UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/8 "2021-10-21T12:46:08Z")

</div>

[http://192.168.1.3:5500/index.html](http://192.168.1.3:5500/index.html) merci

---

<div class="post-metadata">

**Author:** ![Hiram-Belgium](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hiram-belgium/32/4874_2.png) [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Post date:** [October 21, 2021, 3:37pm UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/9 "2021-10-21T15:37:28Z")

</div>

Help with javascript will be very appreciated !

---

<div class="post-metadata">

**Author:** ![KumuPaul](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kumupaul/32/13072_2.png) [@KumuPaul](https://discourse.processing.org/u/KumuPaul)\
**Post date:** [October 21, 2021, 5:17pm UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/10 "2021-10-21T17:17:36Z")

</div>

I’m not sure where those 404s are coming from because the original sketch on OpenProcessing doesn’t load any assets. However, one problem I can see is the order that you are including your script files. Your `mySketch.js` file needs to be included **after** p5 and p5ex. In fact I couldn’t get it to work while being loaded from `<head>` at all and had to move it to `<body>`:

```auto
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8" />
	
	<script src="https://cdn.jsdelivr.net/npm/p5@0.6.0/lib/p5.min.js" type="text/javascript"></script>
	<script src="https://unpkg.com/p5ex@0.5.6/lib/p5ex.min.js" type="text/javascript"></script>

	<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>   
	
	<script src="mySketch.js"></script>
</body>

</html>

```

---

<div class="post-metadata">

**Author:** ![Hiram-Belgium](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hiram-belgium/32/4874_2.png) [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Post date:** [October 21, 2021, 7:38pm UTC](https://discourse.processing.org/t/help-i-m-beginner-and-i-dont-understand-whats-happend/32982/11 "2021-10-21T19:38:47Z")

</div>

Thank you ! Yessssssss ! It s the solution ! I m very very happy !
