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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Vuforia Studio Javascript

Aditya1702
14-Alexandrite

Vuforia Studio Javascript

Hi,

 

I want to trigger an event after completion of each step in Vuforia Studio.

Can someone help me with the same.

 

Thanks in advance.

 

4 REPLIES 4

with the use Switch case in javascript we can acheive this

sebben
12-Amethyst
(To:Aditya1702)

Hi,

the 'playstopped' event of a model widget is triggered automatically after each step of a sequence.

You can use it to do something in your experience.

 

 

Aditya1702
14-Alexandrite
(To:sebben)

Hi @sebben 

 

I am using the below code it is still not working. Correct me if there is any mistake in the code. Also I wanted to ask the commented out code below is it the right way to call a function which is already defined? 

 

Thanks in advance.

 

$scope.$on('playstopped', function(evt, arg) { 
 
if($scope.view.wdg['modelMaintenance'].currentStep == 3){
      $scope.view.wdg['ping1'].visible = true;
    //$scope.pressPing(1);
      //$scope.showPing(2);
    }
  
  else if($scope.view.wdg['modelMaintenance'].currentStep == 5){
      $scope.view.wdg['ping2'].visible = true;
    //$scope.pressPing(2);
      //$scope.showPing(3);
    }
sebben
12-Amethyst
(To:Aditya1702)

This should work, assuming that your widgets are named the same. (Make sure you change the studio ID not only the friendly name)

You can check the console of the browser in preview and see if there are any errors.

If you can share the project, I could also take a look.

 

The way you call the functions is also correct.

Top Tags