Last active
October 11, 2015 13:28
-
-
Save seblavoie/3865896 to your computer and use it in GitHub Desktop.
Switch texts or images with a slider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace _slider by your own slider | |
// Parsing single string | |
// Paste this expression in Source Text attribute | |
// Source Text: "French | English | Spanish" | |
_slider = comp("# Animation").layer("CONTROLLER").effect("Language")("Slider"); | |
value.split(" | ")[Math.floor(_slider)]; | |
// Navigating through frames | |
// Time remap composition containing multiple single frames layers | |
(comp("# Animation").layer("Controller").effect("Language")("Slider") - 1) * thisComp.frameDuration | |
// Showing layers based on their index | |
// Layers(1) will be shown on CONTROLLER[Language=1] | |
// Paste onto each translated layer's opacity | |
_slider = comp("# Animation").layer("CONTROLLER").effect("Language")("Slider"); | |
(index == Math.floor(_slider)) ? 100 : 0; | |
// Filtering layers according to their layer name | |
// Experimental, shouldn't use | |
lang = new RegExp("^" + comp("# Animation").layer("CONTROLLER").effect("Language")("Layer").name, "g"); | |
(name.match(lang) ? value : 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment