Scrollview element's parent is not the scrollview

I would like to do things with the scrollview if I interact with one of the elements that I’ve inserted into it.

However, the element.parent is not the scrollview.

Here is some test code:

local widget = require("widget") local sv = widget.newScrollView() local test = display.newGroup() sv:insert(test) print(sv) print(test.parent)

Am I wrong in assuming those two tables should be the same value?

This isn’t too much of a problem however as I can just pass the scrollview’s reference to each element when I create them.

test.super = sv

The ScrollView is a complex object that has a display.newGroup() as a child/member of the object. When  you insert an object into the scrollView you’re actually putting it into something like sv._view. You’re work around is probably the best course of action.

Rob

The ScrollView is a complex object that has a display.newGroup() as a child/member of the object. When  you insert an object into the scrollView you’re actually putting it into something like sv._view. You’re work around is probably the best course of action.

Rob