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

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

Karthik
5-Regular Member

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

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.

2 REPLIES 2

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);}

 

Karthik
5-Regular Member
(To:RolandRaytchev)

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.

 

Announcements

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