Skip to main content
7-Bedrock
August 12, 2020
Question

Blink function timing changes, when I return to main menu and then back to experience

  • August 12, 2020
  • 1 reply
  • 1485 views

In my project the blink function timing changes(flashing is incorrect) when I return to main menu and then back to experience.

I have used 3D image with interval function JS.

$scope.blink= function(){
interval= $interval( function(){
$scope.app.view.View2.wdg["3DImage-1"]["visible"] = !$scope.app.view.View2.wdg["3DImage-1"]["visible"];
$scope.app.view.View2.wdg["modelItem-1"]["visible"] = !$scope.app.view.View2.wdg["modelItem-1"]["visible"];},
600);}


It works perfect on first time with 600 milliseconds, It going wrong(flashing is incorrect & 300 milliseconds) when I return to main menu and then back to experience.

can someone tell me how to solve this.

1 reply

21-Topaz I
August 13, 2020

Hi @Karthik ,

there should not be a difference in the behavior when you use different time interval. The ony reason , I think , could be the update time.

Therefore you can  try:

1.) after change to call $scope.$applyAsnc()

2.) to change the property using setWidgetProp

e.g. some thing like this:

$scope.blink= function(){
interval= $interval( function(){
$scope.setWidgetProp('3DImage-1','visible',!$scope.app.view.View2.wdg["3DImage-1"]["visible"]);
$scope.setWidgetProp('modelItem-1','visible',!$scope.app.view.View2.wdg["modelItem-1"]["visible"]);
$scope.$applyAsync();
600);}

 

Karthik7-BedrockAuthor
7-Bedrock
August 13, 2020

Hi Roland,

Thanks for your replay,

I tried that code you suggested. Its not working.

 

Its not about using different time interval(300 or 600 milliseconds). I have fixed the function for 600 milliseconds.

I have totally 10 views in this experience. The blink function I'm using is the view2. Its works fine every time when we start the vuforia view app on first time.

When I return to main menu then switchover between each view and then back to View 2. Its not blinking properly, the 600 millisecond function automatically turned into 200 or 300 milliseconds.

 

hope now you understand the situation.