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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Is it possible to call multiple functions at same time in same time in js of button ?

M_shah
10-Marble

Is it possible to call multiple functions at same time in same time in js of button ?

 
ACCEPTED SOLUTION

Accepted Solutions

instead of having 5 models in the 3d canvas, use only one model and use the BUTTON to change the source.

 

 var modelEle1 = angular.element(document.getElementById('model-1'));

 

$scope.A=function(){

$scope.view.wdg['model-1']['src'] = 'app/resources/Uploaded/A.pvz';

$timeout(function() {modelEle1.scope().playAll();},300);
};

 

AT THE EVENT OF BUTTON 1       RECALL                         A();

 

 

 

 


$scope.B=function(){


$scope.view.wdg['model-1']['src'] = 'app/resources/Uploaded/B.pvz';

$timeout(function() {modelEle1.scope().playAll();},300);

};

 

AT THE EVENT OF BUTTON 2       RECALL                         B();

 

etc......

 

I hope to be proved helpful

 

Giuseppe

 

 

 

View solution in original post

4 REPLIES 4
dupatel
19-Tanzanite
(To:M_shah)

@M_shah Yes you can call multiple JS function at the same time. e.g. on click of button try updating value of 2 label widget text and it should work.

 

-Durgesh

M_shah
10-Marble
(To:dupatel)

Hi @dupatel

thank you for your concern..but i have one doubt mentioned below

If i have 5 model in my 3D canvas and 5 corresponding buttons to each model in 2D canvas....Then how to make experience in such a way that if i can click on particular button than only that model is visible and play it's sequence .?

instead of having 5 models in the 3d canvas, use only one model and use the BUTTON to change the source.

 

 var modelEle1 = angular.element(document.getElementById('model-1'));

 

$scope.A=function(){

$scope.view.wdg['model-1']['src'] = 'app/resources/Uploaded/A.pvz';

$timeout(function() {modelEle1.scope().playAll();},300);
};

 

AT THE EVENT OF BUTTON 1       RECALL                         A();

 

 

 

 


$scope.B=function(){


$scope.view.wdg['model-1']['src'] = 'app/resources/Uploaded/B.pvz';

$timeout(function() {modelEle1.scope().playAll();},300);

};

 

AT THE EVENT OF BUTTON 2       RECALL                         B();

 

etc......

 

I hope to be proved helpful

 

Giuseppe

 

 

 

Thank you soo much @Giuseppe_Fiore

Each and every you have been proved very helpful 

-Manthan

Announcements

Top Tags