26 May 2013 1:41 AM #1
a few nobs questions about image deleting and video playing on specific keyframe
Hello guys i am trying animator and i have a few questions, (sorry for my bad english)
1- i am sliding images and i have a background image , my img1 start changing his opacity from 0 to 100 in 2 seconds, then this image will stay for like 15 seconds and the other img2 appear in the scene, now i change the opacity of the img1 to 0, but my questions is example if i have a lot of images like 50 or more , how i can do for while my sliding is playing deleting the images are invisible at the stage ?
2- i add a video mp4 , how i can play it in specific keyframe? cos i used autplay but it start from the begining of my timeline .
3- for sliding this images exist other way coding for repetive tasks?
Thanks for ur help guys.
28 May 2013 7:31 AM #2
1) You can set up a custom JS on the animEnd action for an object. That action will run when the object is done animating. If you give the object and id e.g. "image1", you can use the following snippet to delete the image.
var image1 = controller.getElementById('image1'); image1.parentNode.removeChild(image1);
3) You could change the images and just repeat the same scene e.g. something like this on the scene end action.
var image1 = controller.getElementById('image1'); image1.src = controller.getUrlForLocalAsset('my_next_image.jpg');