Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
I have different pvi files created which I have extracted from different pvz files. I have one button whose text value keeps on updating. Now I want make an experience, depending on the value of the button text, n clicking the button different sequence should be played.
Currently I amusing the following code. But it's not working...
$scope.buttonPlay = function() {
if($scope.app.mdl['Car1'].properties['Part']=="Part1") {
setWidgetProp( 'model-1', 'sequence', 'Part1.pvi');
}
if($scope.app.mdl['Car1'].properties['Part']=="Part") {
setWidgetProp( 'model-1', 'sequence', 'Part.pvi');
}
}
Please suggest some way to achieve the task.
Thank you...
Regards,
Dipika
updating the properties of widgets should include " $scope.view.wdg['widgetID']......." Let me know if that didn't work.
try this
$scope.playseq = function(seqname) {
var modelEle1 = angular.element(document.getElementById('model-1'));
$scope.view.wdg['model-1']['sequence'] = seqname;
$timeout(function() {modelEle1.scope().playAll();},100);
$scope.$applyAsync();
}
call it with the sequence name; it will set the sequence value and the a short time later will kick off the player.