Problem on Java Script


#1

I am trying to use these codes for coordinate the 3 images - Step 1 , 2 & 3 ( maintenance process ) with the animation . When I press the Play button , all animation continue playing till the end but in sequence 1 - 3 . Can anyone advise ? What I want when I press play Step 1 ( image appear + animation) , press Play again Step 2 (image appear + animation )

// $scope, $element, $attrs, $injector, $sce, $timeout, $http, $ionicPopup, and $ionicPopover services are available

var currentSetting = 1;

$scope.Next= function() {

if (currentSetting == 0) {

$scope.app.view[‘Home’].wdg[‘3DImage-1’][‘visible’]= false
$scope.app.view[‘Home’].wdg[‘3DImage-3’][‘visible’]= false
$scope.app.view[‘Home’].wdg[‘3DImage-4’][‘visible’]= false

currentSetting = 1;
}

else {

$scope.app.view[‘Home’].wdg[‘3DImage-1’][‘visible’]= true
$scope.app.view[‘Home’].wdg[‘3DImage-3’][‘visible’]= true
$scope.app.view[‘Home’].wdg[‘3DImage-4’][‘visible’]= true

cureentSetting = 0;

}