attempt to index upvalue ‘widget’ (a boolean value)
I suspect the required library is not being loaded? Could it be a SDK vs Enterprise issue?
I am aware of your hitman service and if I ever get into the situation where I am truly stuck, I’ll take you up on it.
In the meantime, I appreciate hints and while I am new to all this, whenever I see the posibility to help someone else, I try to do so, since we’re all solving problems, only at different levels.
Make sure you have more objects in the scroll than it is tall.
Use placeholder fills (like a 16x16 transparent image) for off-screen objects.
Detect the drag portion of the interaction and detect whether more objects will be needed before the finger is released and momentum takes over. If so, add objects then.
Following these steps will ensure you don’t run out of elements to show, you don’t waste memory on fills for offscreen objects, and you don’t stop the momentum part of the scroll.
Also, don’t forget you can download and modify the widget library to suit your needs.
I forgot to mention that what populates the list are images from the loadRemoteImage callback, in batches of 50 small images.
When they are created, I insert them into the list as they arrive.
Of course I can wait until all are downloaded and insert all in a loop but whichever way i do this, the resizing of the scrollView halts the slowdown momentum.
Point 1 is given but to my knowledge, I cant use a placeholder and then replace it with a different object since i’d have to insert the new one anway after destroying the old, and scrollView will always recalculate heigh (in my case) when an object is inserted. Or am i wrong?
Point 3 is gonna be hard as I do not know when the images will be finished loading.
What i’ve done as an alternative solution to keep scrolling smooth is that once the scroll reaches the end, it freezes, pops a loading tag, and once all is downloaded and checked, removes the tag and unlocks for forther scrolling.
It works quite well, albeit not exactly how I wanted in the first place.
Note: If you want to till the scroller on the fly from remote images whose size you do not know and you also want those images to be shown full sized, then this will be a bit harder, but probably not impossible.
However, that sounds like bad design to me. I’d change the design so that all images must be displayed at a uniform size, even if that means you scale and or clip parts of the image when it arrives.
In this case, a little uniformity in the design rules will help a lot.
cut my code down to bare minimum to figure this out and found that the culprit to this hick-up is that i do my progressive preload check in the scrollView event which only fires when finger is on the board. The release slow down scrolling does not fire any events.
I’ll fix this with a enterFrame runtime check instead tomorrow. it should work.
In my case the rect fill doesn’t work as I have lots of text objects and filters. Plus doing dynamic insert/remove saved over 70MB RAM so it was win/win.
Read the post you linked to and wonder if you’d mind sharing the improved dynamic load/unload version of this script that you fixed? It’s exactly what i’m looking for.
If not, thats fine too, just want to know before I “get to it”.
downloaded the script from github, removed the line in question, and tried to require it and use it, but it seems i’m too inexperienced to get it to work in my code.
all i need is to get rid of that pesky line that stops the scrolling.
any pointers is appreciated as to how i setup/use the modified script
There are some internal referencing issues that need addressing if I remember correctly - check all the requires have valid paths. This will depend on how you have the project physically laid out.