target nested timelines

56 views
Skip to first unread message

pots...@gmail.com

unread,
Feb 28, 2017, 2:40:23 PM2/28/17
to Google Web Designer beta
Hi guys, I' trying to target a nested timeline to animate some rain falling from a cloud. My tap area component is inside a group as well.


On adobe animate the code would look like this:

this.cloud.addEventListener("click",rain.bind(this));
function rain(){
this.cloud.animatedCloud.rainDrop.play();
}

------
This is what I have been trying without luck.

gwd.rain = function(event){
gwd.actions.timeline.play('cloud').play('animatedCloud).play(rainDrop)';
}

Best!

San Khong

unread,
Feb 28, 2017, 8:05:47 PM2/28/17
to Google Web Designer beta
You can use the timeline events for this.  First pause the timeline event to stop the animation, then play it when the taparea is clicked.

Let's say you have the rain animation inside a cloud element, first you need a timeline event to pause the animation so the rain would not animate until you click on the taparea: 
1. Double click on cloud element go to in its nested mode.
2. Add a timeline event on cloud target to pause cloud receiver.
3. Give the group that contains the taparea an id in the Properties panel.
4. Right click on the group to select Add event...
5. Select Taparea > tap/click event and select timeline > play action on cloud receiver.

Here is the GWD sample file.
Hope it helps.
San
Google Web Designer team

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

pots...@gmail.com

unread,
Feb 28, 2017, 9:48:01 PM2/28/17
to Google Web Designer beta
Thank you San!, I figured it out the code,

gwd.actions.timeline.play('cloud animatedCloud rainDrop');

Although in the end I didn't use it. I used timeline events as you suggested, added animation to the cloud and moved the taparea inside the cloud as well. It worked fine.

Cheers!

Reply all
Reply to author
Forward
0 new messages