array splice prob
- Started
- Last post
- 4 Responses
- jpea
weird issue, but i'm trying to just use splice(myVar, 1) to delete something from an array in flash, but for some reason it just deletes the first item in the array, no matter what the var is. i know the var is being captured in the clip correctly, but it doesn't delete the proper part of the array. if i hard code a number though it'll correctly delete that part of the array.
any ideas?
- jpea0
bump
- caseyc0
Somethings wrong with myVar obviously, where/how is the value of myVar being set?
- jpea0
here's the gist of it:
there an attachMovie loop that creates clips down the y axis. the loop creates mc.buttonVar = [z] in each clip. the method for deleting the spot in the array is by an onRelease action inside the clip, saying splice(buttonVar, 1), thus deleting the index of the array, and once done, rebuild the clips on the stage.problem is that it just deletes the first spot in the array, and not the buttonVar number.
buttonVar seems correct though. i have it set to show the buttonVar in a text field onRollOver, and it traces out fine within the clip.
can't figure it out for the life of me though.. seems obvious since it traces correctly :(
- jpea0
http://pastebin.coconut.se/?id=4…
code in question ^