seblavoie
10/10/2012 - 2:15 PM

Switch texts or images with a slider

Switch texts or images with a slider

// 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)