cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Disable toggle until all steps finished playing

SOLVED
AS_9764990
Garnet

Disable toggle until all steps finished playing

Hi, 

 

I have a toggle to change from one view to another view(e.g View A to View B). I need to disable the toggle from the start of the sequence being played in View A. When all steps in view A has finished playing, then the toggle is visible to be clicked to change to view B. 

 

How can I solve this issue?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Disable toggle until all steps finished playing

Hi,

 

you can call a function like this from the Play Stopped event of your model:

 

$scope.showToggle= function(){
  if($scope.view.wdg['model']['steps'] == $scope.view.wdg['model']['currentStep']){
      $scope.view.wdg["toggle-1"].visible = true
  }
  else{
      $scope.view.wdg["toggle-1"].visible = false
  }
}

 

I hope that helps.

View solution in original post

4 REPLIES 4

Re: Disable toggle until all steps finished playing

Hi,

 

you can call a function like this from the Play Stopped event of your model:

 

$scope.showToggle= function(){
  if($scope.view.wdg['model']['steps'] == $scope.view.wdg['model']['currentStep']){
      $scope.view.wdg["toggle-1"].visible = true
  }
  else{
      $scope.view.wdg["toggle-1"].visible = false
  }
}

 

I hope that helps.

View solution in original post

Re: Disable toggle until all steps finished playing

I have tried the code, but it didn't work. Can I know the steps to call the function correctly. Sorry for any inconvenience. I'm still new to Vuforia Studio. 

Re: Disable toggle until all steps finished playing

Make sure the studio id of the model is "model" and the toggle is "toggle-1" or change it in the code so it matches your id's.  Enter in the JS field of the Play Stopped event showToggle(); Note that the  code will hide the toggle after the first step finished.  If you want to hide it when the first step starts you need to write another function and call it from the Play Started event:

$scope.hideToggle= function(){
  if($scope.view.wdg['model']['steps'] != $scope.view.wdg['model']['currentStep']){
      $scope.view.wdg["toggle-1"].visible = false
  }
}

Re: Disable toggle until all steps finished playing

Great. Thank you so much for your help. 

Announcements
Join an
AR Working Group!

Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection