Discuss Scratch

A-E-
Scratcher
27 posts

JS Bridge: Sync a Scratch variable and a JS variable.

I made a script that when run before Scratch loads, basically puts itself in between Scratch and the Cloud Data server, and makes the
(☁ jsbridge)
cloud variable sync with the value of window.jsbridge.value

It may be useful for making extension-type things in the future, but right now it does nothing useful.
I will post the code in a subsequent post. Only use it if you know what your'e doing!
It has comments to help make the meaning clear, so I hope it is acceptable to post here.


















Kumquat
A-E-
Scratcher
27 posts

JS Bridge: Sync a Scratch variable and a JS variable.

Moved code to GitHub: easrng/jsbridge

Last edited by A-E- (Feb. 13, 2020 16:51:21)



















Kumquat
DeleteThisAcount
Scratcher
1000+ posts

JS Bridge: Sync a Scratch variable and a JS variable.

removed because sarcasm is no longer allowed on scratch - Scratch Team

Last edited by DeleteThisAcount (Feb. 13, 2020 19:18:17)




A-E-
Scratcher
27 posts

JS Bridge: Sync a Scratch variable and a JS variable.

I thought I read that if the meaning of the code was clear it was OK…


















Kumquat
A-E-
Scratcher
27 posts

JS Bridge: Sync a Scratch variable and a JS variable.

Last edited by A-E- (Feb. 6, 2020 18:50:48)



















Kumquat
rdococ
Scratcher
100+ posts

JS Bridge: Sync a Scratch variable and a JS variable.

A-E- wrote:

I thought I read that if the meaning of the code was clear it was OK…
It should be, I don't see why not. Your code looks legitimate to me, at least.

Start of Signature

Search the forums.
Search my posts.

My collection of custom blocks you can use without credit!
(Includes first-class lists with tracing garbage collection!)

End of Signature
Sheep_maker
Scratcher
1000+ posts

JS Bridge: Sync a Scratch variable and a JS variable.

DeleteThisAcount has an implied /s in their post. The only code that doesn't seem to be allowed on Scratch are standalone JavaScript functions

- Sheep_maker This is a kumquat-free signature. :P
What's happening? This is my signature; it appears below all my posts. Discuss it on my profile, not the forums.
To make your own, click “Change your signature” at the bottom of the discussion home page.

Yes
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
A-E-
Scratcher
27 posts

JS Bridge: Sync a Scratch variable and a JS variable.

Can anyone see my edited posts? They are showing as blank for me after I edit.


















Kumquat
SimpleScratch
Scratcher
500+ posts

JS Bridge: Sync a Scratch variable and a JS variable.

I see nothing in #2 or #5
A-E-
Scratcher
27 posts

JS Bridge: Sync a Scratch variable and a JS variable.

SimpleScratch wrote:

I see nothing in #2 or #5
Thanks, I figured it out/asked for help in another thread


















Kumquat
SimpleScratch
Scratcher
500+ posts

JS Bridge: Sync a Scratch variable and a JS variable.

Moved code to a Gist so ST won't ban me: easrng/0e815beb507f24da94354a8892819d69

I can't work out how to get to your code using that reference - does it need extra info adding to it?
A-E-
Scratcher
27 posts

JS Bridge: Sync a Scratch variable and a JS variable.

SimpleScratch wrote:

Moved code to a Gist so ST won't ban me: easrng/0e815beb507f24da94354a8892819d69

I can't work out how to get to your code using that reference - does it need extra info adding to it?
It's in a actual repo now: easrng/jsbridge


















Kumquat

Powered by DjangoBB

Standard | Mobile