Making the looping banner stop after 30 seconds

3,600 views
Skip to first unread message

robi...@gmail.com

unread,
Jan 20, 2015, 8:58:58 AM1/20/15
to gwd...@googlegroups.com
Hi,

I have just started trying GWD and so far I've mostly managed to find my way around. However I haven't yet managed to make my animation stop after a set amount of time.

My banner is going to have 2 pages, that are alternating. However after 30 seconds this looping should stop. A set number of loops would work too.

Is it possible to do this, considering I'm using 2 pages?

Kind regards,

Robin

Jaz

unread,
Jan 21, 2015, 1:04:32 PM1/21/15
to gwd...@googlegroups.com
Hi Robin,

You can select the number of times an item loops by clicking on the loop icon in the animation layer (advanced mode). Check out the instructions here and let us know if this helps.

https://support.google.com/webdesigner/answer/6065570

thx!
jaz

Jasmine Rogers
Program Manager, GWD

robi...@gmail.com

unread,
Jan 22, 2015, 9:42:35 AM1/22/15
to gwd...@googlegroups.com
Hi Jaz,

Thanks for the reply. This however seems to be instructions for making a specific item loop. I was trying to make the entire banner stop.

Maybe its possible to set a limit to the amount of times my event is forwarding the animation to page 2? This would make the animation stop i suppose.

Kind regards,

Robin Zwiers

felix.mi...@googlemail.com

unread,
Oct 8, 2015, 7:10:21 AM10/8/15
to Google Web Designer beta
This problem appears to be unresolved for some developers. I came up up with this simple solution. Total duration is 15 seconds, so 2 loops equal 30 seconds.


1.) Define a label "loop" at timeline´s first frame.
2.) Set a timeline event at timeline´s last frame (set the loop label as gotoandplay target).
3.) Switch to code view and search for the "gwd-events=handlers" section.
4.) Insert the var counter = 0; line.
5.) Insert the if-statement inside the loop function.

<script type="text/javascript" gwd-events="handlers">
var counter = 0;
gwd.auto_Gwd_tapareaClick = function(event) {
// GWD Predefined Function
gwd.actions.gwdDoubleclick.exitOverride('gwd-ad', 'clickTag', 'http://www.your-url.com', true, true);
};
gwd.auto_Page1Event_1 = function(event) {
// GWD Predefined Function
if(counter < 1){
counter++;
gwd.actions.timeline.gotoAndPlay('page1', 'loop');
}
};
</script>

oshr...@gmail.com

unread,
Oct 12, 2015, 12:30:14 PM10/12/15
to Google Web Designer beta
Felix, thank you so very much!!!

I did something similar based on your script:

var counter = 0;
gwd.auto_before_end = function(event) {
if (counter < 2) {
counter++;
} else {
gwd.actions.timeline.pause('page1');
}
};
gwd.end = function(event) {
gwd.actions.timeline.gotoAndPlay('page1', 'start');
};

The first event is at the end of the animation, but few frames before the text fades out.
The Second event is at the final frame,
I guess you can see what I did there :)

Reply all
Reply to author
Forward
0 new messages