Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Piggybacking...

Avatar

Level 3

Is there an example somewhere of piggybacking a SharedProperty on an existing CollectionNode.

Just for clarity, what I'm trying to do is have multiple SharedProperties use the same CollectionNode. What does the code to do that look like?

Right now I'm doing something like:

---------------------------------------------

var p1:SharedProperty = new SharedProperty();

var p2:SharedProperty = new SharedProperty();

p1.sharedID = foo;

p1.nodeName = 'prop1';

p2.sharedID = foo;

p2.nodeName = 'prop2';

p2.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE, onSync);

p1.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE, onSync);

p1.subscribe();

p2.subscribe();

---------------------------------------------

These nodes have been created on the server already. But they don't both get synchronized, only one does.

What's the correct way for them to share a CollectionNode?

thanks,

-sandy

0 Replies

Avatar

Level 10

Hi,

We do have instances in our code where a collectionNode is used in multiple SharedProperties. See the subscriber function in NoteModel.as class inside com/adobe/rtc/pods/noteClasses/... . We use the same SharedProperty for vertical scrolling as well as text.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Level 3

Awesome! That's exactly what I was looking for.