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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Vuforia Studio Javascript

Aditya1702
15-Moonstone

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
13-Aquamarine
(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
15-Moonstone
(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
13-Aquamarine
(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.

Announcements

Top Tags