Would like to have an Adobe Animate CC banner ad to loop 2x - jquery-animate

I'm working on a basic banner ad and would like it to loop 2x then stop. I can't figure it out. Any simple answers?

Write this in the last frame:
if (!this.loop)
this.loop = 1;
if (this.loop++ == 2)
this.stop();

Related

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

Looping a number count in Edge 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.

Xbox One Right Trigger Not Working

I have an Xbox One controller setup with Unity3d, and when I try to use the RT button nothing happens.
With the following setup, the RB button works fine:
I have looked at this but setting that up doesn't make sense to me. I have tried 3rd Axis 0_10th and I have tried 3rd Axis 0_1 but those are not valid. What is the proper settings for this to work?
To the get the result I was looking for, I needed to set it up the following way:
Then to get the button to work we need to use:
if(Mathf.Round(Input.GetAxisRaw("Fire1")) < 0){
// Firing code here
}
instead of:
if(Input.GetButton("Fire1")){
// Firing code here
}
Yes, thanks for posting. I was having the same problem using a 360 wired controller in Unity3d. It looks like the Left and Right triggers now both use the 3rd axis (Joystick) with the Left generating positive (0 to +1) values and the Right trigger generating negative (0 to -1) values. This differs from all the documentation I was finding.

How to convert a panorama item into page/data grid

I am new to Windows phone dev. I am following this excellent article ( http://developer.nokia.com/Community/Wiki/Weather_in_Windows_Phone_7 ) and have learnt something about how to load xml data and show it as a useful info in a paronama view. But now instead of panorama i want it to be shown as a page. I am not sure if its in a page tag or data grid tag that I should work with. Can someone please help me with how to convert this piece of code to some thing which can be displayed in a page
// create PanoramaItem
PanoramaItem panoramaItem = new PanoramaItem();
panoramaItem.Header = queries[query];
// modify header to show only city (not the country)
int index = queries[query].IndexOf(",");
if (index != -1)
panoramaItem.Header = queries[query].Substring(0,queries[query].IndexOf(","));
else panoramaItem.Header = queries[query];
// use ForecastTemplate in Panorama Item
panoramaItem.ContentTemplate=(DataTemplate)Application.Current.Resources["ForecastTemplate"];
panoramaItem.Content = pio; // add Panorama Item to Panorama
Panorama.Items.Add(panoramaItem); // query next city forecast
At first, be sure that Pivot is useless for you. Its like Panorama, but Pivot :) See differences here, here, here(nice one) or here
Tried to paste some code here, but SO is not showing tags. So, take a look at <.Grid.ColumnDefinitions> and <.Grid.RawDefinitions>. Dots at the beginning are just for rendering.

Problems with MediaElement showing Video inside a Panorama

This script sets up a Panorama Control with 5 items, then loads up a video inside a MediaElement in the second Panorama item.
If I reduce this down to 2 items then no video shows (the media element is "invisible"), but you can still hear the audio - i.e. something like:
panorama = Panorama.new
panorama.title = "Video panorama"
Host.content_holder.children.add panorama
for i in 1..2 # if this is >2, then the video shows
panorama_item = PanoramaItem.new
panorama_item.header = "Child " << i.to_s
panorama.items.add panorama_item
if i == 2
panorama_item.orientation = Orientation.horizontal
media_element = MediaElement.new
media_element.source = Uri.new("http://files.ch9.ms/ch9/f2c3/b59b6efb-3c70-4bc2-b3ff-9e650007f2c3/wp7ces_ch9.wmv")
panorama_item.content = media_element
else
text_block = TextBlock.new
text_block.text = "Hello world"
panorama_item.content = text_block
end
end
I guess this is something to do with the animation and timing of the initial Panorama show - but I've not been able to get any grip on the problem.
The problem does appear to be the same in C#/XAML so it's not a scripting issue.
Has anyone got any ideas of where to look?
Don't have less than 3 items in your Panorama - I've heard it from MSFT peeps as a UX guideline. When technical issues have come up relating to a panorama with only 1 or 2 items those same people have pointed out that the Panorama is not intended to be used with so few items and so you may get weird behaviours.
Also be careful showing video in a PanoramaItem - as this is not the way the Panorama control is used in the standard applications - so it may fall outside the guidelines.