-
getTitle
called on:
CerosExperience
arguments: noneReturns a string that contains the title of the ceros experience.
var experienceTitle = myExperience.getTitle();
-
getCurrentPage()
called on:
CerosExperience
arguments: noneReturns a
CerosPage
representing only the current page of the experience.var page = myExperience.getCurrentPage();
-
getAllPages()
called on:
CerosExperience
arguments: noneReturns the ID of the current user viewing the experience as a string.
var userId = myExperience.getCurrentUserId();
-
getAllPages
called on:
CerosExperience
arguments: noneReturns a
CerosPageCollection
representing all the pages of the experience.var pageCollection = myExperience.getAllPages(); var thirdPage = pageCollection.pages[2]; thirdPage.disable();
-
findPageById(pageId)
called on:
CerosExperience
arguments: pageId – the SDK ID of the page to retrieveReturns a
CerosPage
representing either the single page that has IDpageId
, or null if the ID can not be found.var myPage = myExperience.findPageById('a-page-id'); if (myPage){ myPage.disable(); //disables the page, if it was found }
-
findPagesByTag(tag)
called on:
CerosExperience
arguments: tag – a stringReturns a
CerosPageCollection
containing all pages in the experience that have been tagged withtag
in the Studio.var taggedPages = myExperience.findPagesByTag("foo");
-
goToPage(pageNum)
called on:
CerosExperience
arguments: pageNum – The number of the page to go to. Must be between 1 and the total number of pages in the experience, inclusive.Navigates the experience to the page specified by
pageNum
. IfpageNum
is not a valid page in the experience, the command will do nothing.myExperience.goToPage(3);
-
goToNextPage()
called on:
CerosExperience
arguments: noneNavigates the experience to the page directly after the one the user is currently on. If the user is on the last page (if the experience is not a carousel), or if the experience only has one page, the command will do nothing.
myExperience.goToNextPage();
-
goToPreviousPage()
called on:
CerosExperience
arguments: noneNavigates the experience to the page directly before the one the user is currently on. If the user is on the first page (if the experience is not a carousel), or if the experience only has one page, the command will do nothing.
myExperience.goToPreviousPage();
-
findAllSyncedObjects()
called on:
CerosExperience
arguments: noneReturns a
CerosSyncedObjectCollection
. All syncedObjects in the experience are returned.var syncedObjects = myExperience.findAllSyncedObjects(); syncedObjects.show(); //shows all syncedObjects in the experience
-
findSyncedObjectById(syncedObjectId)
called on:
CerosExperience
arguments: syncedObjectId – the SDK ID of the syncedObject to retrieveReturns a
CerosSyncedObject
representing either the single syncedObject that has IDsyncedObjectId
, or null if the ID can not be found.var mySyncedObject = myExperience.findSyncedObjectById('a-syncedObject-id'); if (mySyncedObject){ mySyncedObject.hide(); //hides the syncedObject, if it was found }
-
findSyncedObjectsByTag(tag)
called on:
CerosExperience
arguments: tag – a stringReturns a
CerosSyncedObjectCollection
containing all syncedObjects in the experience that have been tagged withtag
in the Studio.var taggedSyncedObjects = myExperience.findSyncedObjectsByTag("foo");
-
findSyncedObjectsWithAnyTags(tags)
called on:
CerosExperience
arguments: tags – an array of stringsReturns a
CerosSyncedObjectCollection
containing all syncedObjects tagged with any of the tags passed in thetags
array in the studio.var taggedSyncedObjects = myExperience.findSyncedObjectsWithAnyTags(["foo","bar"]);
-
findSyncedObjectsWithAllTags( tags )
called on:
CerosExperience
arguments: tags – an array of stringsReturns a
CerosSyncedObjectCollection
containing all syncedObjects tagged with all of the tags passed in thetags
array in the studio.var taggedSyncedObjects = myExperience.findSyncedObjectsWithAllTags(["foo","bar"]);
-
findAllLayers()
called on:
CerosExperience
arguments: noneReturns a
CerosLayerCollection
. All layers in the experience are returned.This includes layers within syncedObjects. Commands run on layers within syncedObjects apply to all uses of the syncedObject.
var layers = myExperience.findAllLayers(); layers.show(); //shows all layers in the experience
-
findLayerById( layerId )
called on:
CerosExperience
arguments: layerId – the SDK ID of the layer to retrieveReturns a
CerosLayer
representing either the single layer that has IDlayerId
, or null if the ID can not be found.This will also fetch layers within syncedObjects by their SDK ID. Commands run on layers within syncedObjects apply to all uses of the syncedObject.
var myLayer = myExperience.findLayerById('a-layer-id'); if (myLayer){ myLayer.hide(); //hides the layer, if it was found }
-
findLayersByTag( tag )
called on:
CerosExperience
arguments: tag – a stringReturns a
CerosLayerCollection
containing all layers in the experience that have been tagged withtag
in the Studio.This includes layers within syncedObjects. Commands run on layers within syncedObjects apply to all uses of the syncedObject.
var taggedLayers = myExperience.findLayersByTag("foo");
-
findAllComponents()
called on:
CerosExperience
arguments: noneReturns a
CerosComponentCollection
. All components in the experience are returned.This includes components within syncedObjects. Commands run on components within syncedObjects apply to all uses of the syncedObject.
var layers = myExperience.findAllComponents(); components.show(); //shows all components in the experience
-
findComponentById( component-id )
called on:
CerosExperience
arguments: component-id – the SDK ID of the component to retrieveReturns a
CerosComponent
that represents the component with IDcomponent-id
. If there is no component with this ID, the command will return null.This will also fetch components within syncedObjects by their SDK ID. Commands run on components within syncedObjects apply to all uses of the syncedObject.
var component = myExperience.findComponentById('a-component-id');
-
findComponentsByTag( tag )
called on:
CerosExperience
arguments: tag – a stringReturns a
CerosComponentCollection
containing all components in the experience that have been tagged withtag
in the Studio.This includes components within syncedObjects. Commands run on components within syncedObjects apply to all uses of the syncedObject.
var taggedComponents = myExperience.findComponentsByTag("foo");
-
findComponentsWithAnyTags( tags )
called on:
CerosExperience
arguments: tags – an array of stringsReturns a
CerosComponentCollection
containing all components tagged with any of the tags passed in thetags
array in the studio.This includes components within syncedObjects. Commands run on components within syncedObjects apply to all uses of the syncedObject.
var taggedComponents = myExperience.findComponentsWithAnyTags(["foo","bar"]);
-
on(eventName, callback)
called on:
CerosExperience
arguments: eventName – The name of the event to subscribe to callback – The function to run when this event is receivedvar pageChangedCallback = function(page){ var payload = page.getPayload(); } myExperience.on(CerosSDK.EVENTS.PAGE_CHANGED, pageChangedCallback);