I’m trying to combine two classes to create a larger ui component. I have a paging widget and a slider. On the paging widget, a user can click on the left or right arrows to page down or up.
The slider has a number of increments equal to the number of pages on the paging widget. Whatever increment the slider is moved to, the pagination widget goes to the corresponding page. The slider broadcasts a custom event with the relevant information and the paging widget listens and responds accordingly.
And while it works fine if a user uses the slider, if a user uses the paging arrows the slider doesn’t move. I was hoping to accomplish this by calling a public function named serPositions on the slider instance from within the paging widget, but I’m getting a strange error, and I can’t figure out why:
ReferenceError: Error #1037: Cannot assign to a method setPositions on com.as3.ui.PagerSlider.
What’s worse is that when I look up error 1037, the Adobe documentation says it refers to nested packages. But I don’t think that’s the issue. And besides, the two classes are in the same package.
setPositions is a public method on the slider class. It is defined in the interface that the slider is using.
I was thinking that this might have to do with variable scope, or that the slider hadn’t been initialized yet, but this appears to not be the case, because I can trace the slider object from within the paging widget, and it returns [object PagerSlider], as it should. So I’m stumped. Anyone have any ideas?