Looping a number count in Edge Animate - jquery-animate

I am creating a banner in Adobe Edge Animate with a number count going from 0 to 1000, then slowly going to 1001... 1002... 1003... and then restarting/looping.
I have searched multiple online forums and I am using a code that I found in a previous post that works for the number count (see below), but I cannot get it to loop. Usually when I want to loop a banner I go to a specific time in the timeline and insert a trigger with
this.play (0);
This still loops the banner but not the loop count - it only displays the number 1000 until looping again. Any tips on how to go about this?
Here is link to my banner, when the flashing colors appear is when the banner is looping:
Banner
Here is the code I'm using:
var counter_delay = 0;
var max_count = 1000;
var present_count = 0;
var timer = window.setInterval(stepUp,counter_delay);
function stepUp(){
present_count++;
// Change the text of an element
sym.$("Text").html(present_count);
if(present_count==max_count)
clearInterval(timer);
}

The variables are not working like this. You have to set and get Variables in Edge.
On Composition Ready
sym.setVariable("variablename", 0);
Get Value
var myVariable = sym.getVariable("variablename");
Change Value and Set it again
myVariable++;
sym.setVariable("variablename", myVariable);
For your Loop i think you can use "onupdate" and just use: get variable, increase variable, set the Value for your Variable again.
Then, if your number is high enough, just set the variable to 0 again.

Related

Updating HelpNDoc script to locate library items in help topics

I am trying to write a script to use with HelpNDoc.
I am part way there:
var
aList: THndLibraryItemsInfoArray;
nCnt: Integer;
begin
// Get all items in the library
aList := HndLibraryItems.GetItemList([]);
// Go through each of them
for nCnt := 0 to Length(aList) - 1 do
begin
// Is this a image (1)?
// Is this a image map (9) ?
if(HndLibraryItems.GetItemKind(aList[nCnt].id) = 1 or HndLibraryItems.GetItemKind(aList[nCnt].id) = 9) then
// What is the default alternate text?
var aDefaultAltText := HndLibraryItemsMeta.GetItemMetaStringValue(aList[nCnt].id, 'defaultalttext', '');
// Update the alternate text if required
if(aDefaultAltText = '') then
// Now what do we do? We need to find all instances of where this library item has been used.
// When we encounter one that has an alternate text description we update the meta.
// How?
end;
// What is the default padding?
var aDefaultPadding := HndLibraryItemsMeta.GetItemMetaIntValue(aList[nCnt].id, 'defaultpadding', 0);
// Update padding if required
if(aDefaultPadding = 0) then
HndLibraryItemsMeta.SetItemMetaIntValue(aList[nCnt].id, 'defaultpadding', 5);
end;
end;
end.
I can:
Iterate all library items
Isolate all image / image map items
Extract the default padding / alternate text values.
Update the default padding value to 5 if it is 0.
The issue is with the alternate text. If it does not have a default value then I want to do this:
Iterate all help topics
Iterate all library items used in each help topic
Find if the library item was used in that topic
If it was, it gets alternate text value.
If that value is not empty, apply it to the meta default value. Otherwise find the next instance.
If, by the end of iteration it did not find a alternate text value that was not empty it prints the library item name on screen.
It is not possible to do what I wanted via the API.
Response from HelpNDoc:
HelpNDoc's API doesn't include ways to iterate over topic content.

Carouselview: If only one item in view, items is shown indefinatley

So a carouselview is awesome for showing multiple elements. But once ther eis only one element in the view and the element isnt as large as the whole screen is, the result is:
Result
So I would need to make sure that if only one element is inside the view, it isnt repeated.
How can I set this or work around this issue without making two layouts and making only one visible, depending on how many items there are in the view?
Its quite simple. If the list contains only 1 item, just set the peek area to 0, otherwise to whatever value you wanT:
if (contentOfListView.Count == 1)
carousel_myAds.PeekAreaInsets = 0;
else if (contentOfListView.Count == 2)
carousel_mySales.PeekAreaInsets = Constants.PEEKAREINSETSHALF;
else
carousel_myAds.PeekAreaInsets = Constants.PEEKAREINSETS;

Confirmation Draw has completed

I have created a custom button that will allow users to select with columns to output to CSV so the button is not created as part of the table initialization. I have a modal that pops up with checkboxes created off the column headers for selection. It is worth noting I have regex search on each column header. The issue is I am using server side processing and as a result the only exported rows are those visible. As a work around I have set it up to get the page.info().recordsDisplay and set the length of the page to that and draw. The modal pops up and says it is loading data from server once table is fully populated the HTML of the modal will change to the checkboxes for export. Once exported the table is reverted back to the default length. What I need to do is capture when the rows are fully rendered so I can do the HTML switch. Right now I am setting a timeout. The data can take a while to populate as there are some 13k rows if now search is applied. What is the best way to do this and is there a more efficient way?
var tableHeaders = [];
var table = $('#example').DataTable().columns().every( function () {
tableHeaders.push( $(this.header()).text() );
});
var pageLength = table.page.info().length;
table.context['0']._iDisplayLength = table.page.info().recordsDisplay;
table.draw();
There could be an issue with server-side processing parameters start/length that define the portion of data being requested from the server upon each draw.
If your source data has huge number of rows, chances are they're not sent all at once to make use of server-side processing. So, you can try to manipulate those parameters.
Alternatively, you may try to make use of draw event fired upon each redraw.

How do I display the output of a function of multiple qualtrics sliders in real time?

My colleague and I am designing a survey using Qualtrics. On one page respondents must move a series of sliders.
We need to display the output of a function of the values of the sliders on the same page, ideally also in the form of another slider.
All of this must be done while the respondent moves the sliders.
Concretely, suppose the following:
value of slider 1 = 30;
value of slider 2 = 10;
value of slider 3 = 0
Output to be displayed = 30 x 20 + 10 x 5 + 0 x 15 = 650
where the 20, 5 and 15 are just arbitrary constants in the background.
If the user were to move slider 1 to 31, the displayed output should automatically update in real time to 670.
Any tip on how this is done? We're newbies to qualtrics and completely inexperienced with Java, so we'd be very grateful to anyone willing to provide us with working code. Thanks!
An update on my question, and a clarification after a comment received.
We were of course not asking for someone else to do our job. Just for a pointer in the right direction.
Based on an answer to a different question, I've managed to put this javascript together. It works, which is encouraging..
Code follows.
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
var that=this.questionId;
jQuery("<p style='width:100%'><br><strong> Output <span id='OUT'>0</span></strong>").insertAfter("table.sliderGrid");
jQuery(document).on('change', function(){
var firstslider=parseInt(jQuery("[id='"+that+"~1~result']").val());
var secondslider=parseInt(jQuery("[id='"+that+"~2~result']").val());
var N=firstlider+secondslider*2;
jQuery("#OUT").text(N);
});

pChart Bar Charts set color depending on threshold

Good Day To All
I'm new to pCharts, works great!
I'm trying to create a bar chart with 2 thresholds and display different bar colors. Setting the thresholds is done and works well. Now I would like to set the standard palette to a set color and only the bars that exceed the specified second threshold should be a different color.
My data consists of times file were imported
So in theory, if possible, all bars exceeding the 2nd limit should be red or pink or whatever.
Is this possible? If so, where do I start fiddling?
I have tried OverideColors with an if statement but it seems not to work so well.
Any info would be very helpful.
Thanks
Ok, so here is the code. I know there might be better or cleaner ways of doing it but this works:
/*Palette per Bar*/
$thold = strtotime("09:30:00");
foreach ($lastdate as $over) {
if ($over < $thold) {
$color = array("R"=>0,"G"=>204,"B"=>204);
$Palette[] = $color;
}
else {
$color2 = array("R"=>224,"G"=>46,"B"=>117);
$Palette[] = $color2;
}
}
Hope this helps