Holy crap that’s a lot to digest… I never understood the loader hacking in the first place, so this might be a bit too big-brain for me. Unless I get blessed by eating a waffle for breakfast (I did eat a waffle, and it probably won’t bless me) I’m not gonna be able to grasp it… therefore I can’t help you
NP; always nice to hear from someone, even if they cannot give you the solution right away
The thing is: I use Wick in a slightly off-kilter way. I try to make my files so small as possible in my project. Also, I want “small animations” without all the hassle of needing to press play, pause, hiding progressbars etc that normal videoplayers need. (And without even the possibility of interactive stuff.) Wick is great for that!
But I also need to be able to remove the animations from my current page (live) and, maybe, even insert a different one.
I don’t want to start and reload whole animations at a time, so I try to 1) cache and 2) make the final file(s) I need to load as small as possible.
That’s why I was trying (and, ultimately succeeding) in “hacking” the loader and now working to destroying and restarting animations - without, if possible, reloading (parts of) the screen.
So I fully understand that this is not a standard way to use Wick - still very excited
Paul
This is too much for my bread brain. Is this some sort of HTML? Haven’t finished my khan academy HTML course.
Paul, you seem to be the best coder here, so I won’t guess
you’d have a big problem finding a solution, especially since
your IQ is around a couple of millions
EDIT:
(I’m not trying to make fun of ur IQ, so don’t get me wrong, I was
referring to your intelligence in a good way)
still thinking-
Well, I’m not one of the authors of Wick, so…
But I was hoping to hear from one of them; they would know! :-)
hmm do you mean adding another project to your new project? if so here:https://www.youtube.com/watch?v=zdMpY9cUFQU&feature=youtu.be
Hi @ToastyGhost,
no, sorry, I’m referring to the playback of a exported HTML-wick-project inside another website.
regards,
paul
Here’s what my tiny brain understood: your trying to delete an object/ clip/ button, and once you do, you’ll start getting js errors saying that it doesn’t exist because your unable to make calls to an object that got deleted?
(I’m probably no where near what you meant)
Hi @Hamzah_Alani,
I really wish you and others would stop making an Einstein out of me
If I wrote Wick - you would be right, but I did not
No, I want to remove/destroy the wick player I embedded in a page, as a result of the files I downloaded with export/html with Wick. But lets not risk everybody’s brain by keeping this discussion going here! I solved the problem (for me) by writing the whole thing via JS into an iframe. If I destroy that, nothing bad happens, as this is a separate DOM. So - no worries!
It might be a nice addition for a future release of Wick to be able to nicely stop the payer, but that is for the real brains here
thanks for all your time and effort!
regards,
Paul
At first when you said wick-player I thought you meant a player inside a game, when I looked at the desc it was completely off… I think you want the html to delete its own html…?
Yeah - more specifically, I want to “delete” or stop the javascript that is driving the animation.
Hi,
this issue is still relevant. If a Wick animation is playing on a page, hiding the div/frame in which it plays will spew errors:
VM1248:13015 Uncaught TypeError: Cannot read property ‘_transformBounds’ of null
at CanvasView.getBounds (:13015:42)
at CanvasView.getCenter (:13071:15)
at CanvasView.setZoom (:13086:9)
at Wick.View.Project._renderSVGCanvas (:63097:28)
at Wick.View.Project.render (:62919:10)
at Wick.Project.tick (:51505:15)
at :51464:24
I’ve spend an hour to find out how to stop the wick player of this occurs, but so far not succesfull. It cannot really be hard to stop the player if something like this occurs? Can some of the authors chip in with this?
regards,
Paul
Try to use a try / catch error thing
try{
// Code
}catch(Err){
console.warn("The div/ iframe doesn't exist");
}
Solving this issue might not be that simple though, so hopefully one of the authors could jump in and help.
Also, as a side note, the built-in assets have a text box that uses a div element (it was created by the authors). Stealing some code from that asset might help you
I’m not sure if I understand correctly but it’s likely that you can replace (erase) the content of a div containing your canvas with element.innerHtml property.
that should do the trick
Hi @Hamzah_Alani,
yeah, I know about try/catch, but I am not sure where to put them in de (large!) wick-code.
I tried putting them around the call that calls the animation, but that does not work
regards,
Paul
Hi @blurredPixels,
thanks for your answer. That does indeed work, but that means I need to actively remove wicks all the time, and keep track of wicks I removed and might need again. That is doable, but a bit tiresome…
regard,
Paul
what if you place the div offscreen leaving it visible?
Hi @blurredPixels,
yeah, that would work, probably. Thank you for thinking along! But I am using these animations in a quite complex HTML environment. I would like to change as little as possible.
For now, I am starting every wick in a iFrame and "fysically " removing the iFrame from the DOM if is being hidden, but even that is quite a lot of work to keep track of. I would much rather wick behaving a bit more aware of its environment…
regards,
Paul
In another thread I suggested to develop a wick player as browser extension and had a try at minifying the engine
I know it is not the answer at your questions but the two requests have points in common