Evening all,
I come humbly before you to ask for assistance.
I currently have a map beacon on my map (natch) and have a toggle button that shows the user how far their character can move, displayed as a 0.2 opaque circle, centred on them.
I want this to be togglable, to prevent lots of data clouding the UI. I have made a button in my interface that, depending on the button’s state (up/down) will hide/show the circle.
I am using removeChild() to remove it, and also set it to null as recommended elsewhere. Delete doesn’t work because of it’s nature (dynamically drawn from a value in database)
I then use a method of my Map class to redraw/attach the circle. I thought this all worked fine, until I just started flipping the button repeatedly… and noticed the colour gradually getting darker.
I check each button press and it is only calling the creation method… so presumably the previously removed circle is still lurking? To test I commented out the creation code and just left the addChildAt() line in, whihc did nothing, as expected. Also tried specifically targeting it with getChildByName() and it returns null, as I expected.
I can’t seem to access the ‘opacity’ property, so I can’t see if it’s something there (the opacity is hard-coded, shouldn’t be altered by other things.
Any ideas are gratefully welcomed. Have a nice Friday