Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hello everyone,
I am trying to add some instruction text in a popup label, i have found some solutions here on the conumity, like showing the stepname, and that is working, however some of my instructions contain 2 lines of text.
Replacing the stepname by step_description is not working.
Note: I am new to coding, and have no experience.
Does anyone already done this and can share me some code?
This is what i have now:
var labelId = "label-1";
$scope.$on('newStep', function(evt, arg) {
$scope.setWidgetProp( labelId, "text", arg); // get the currentStep from the arg
var labelText = $scope.view.wdg['label-1'].text;
var InstructText = step_description
$scope.setWidgetProp( "label-1", "text", InstructText);
});
Solved! Go to Solution.
Hi, not sure if you still need the solution, but here is one for reference. In this example I use 2 buttons (play and rewind). Code sample:
$scope.hideStepDesc = function() { //this function hideStepDesc(); is also added to my rewind button, to hide label after rewinding
$scope.view.wdg['label-1'].visible = false;
}
$scope.showStepDesc = function() {
var stepNo = $scope.view.wdg['model-1'].currentStep; // model-1 is my model Studio ID
$scope.view.wdg['label-1'].visible = true; // this function showStepDesc(); is assigned to my play button
if (stepNo == 1){
$scope.view.wdg['label-1'].text = '1. This is your step 1 description'
}
if (stepNo == 2){
$scope.view.wdg['label-1'].text = '2. This is step 2 description'
}
//and here you can add as many steps as you need before your function is over
}
Kick up
Hi, not sure if you still need the solution, but here is one for reference. In this example I use 2 buttons (play and rewind). Code sample:
$scope.hideStepDesc = function() { //this function hideStepDesc(); is also added to my rewind button, to hide label after rewinding
$scope.view.wdg['label-1'].visible = false;
}
$scope.showStepDesc = function() {
var stepNo = $scope.view.wdg['model-1'].currentStep; // model-1 is my model Studio ID
$scope.view.wdg['label-1'].visible = true; // this function showStepDesc(); is assigned to my play button
if (stepNo == 1){
$scope.view.wdg['label-1'].text = '1. This is your step 1 description'
}
if (stepNo == 2){
$scope.view.wdg['label-1'].text = '2. This is step 2 description'
}
//and here you can add as many steps as you need before your function is over
}