About 4 years past. But still if there are someone who want to learn that how to do it with Adobe's native way. They can find it:
https://forums.adobe.com/message/9855214#9855214
The following steps may sound pretty complicated, but as you asked for
the basic principle you will have to bear the elaboration. In fact, it
is a simple procedure and as soon as you have familiarized with it
(including setting up custom template files), it is dead easy.
Open a new document and name Layer 1 "Cyan"
Add three main layers and name them "Magenta", "Yellow" and "Black"
On each layer draw a shape and colour it according to the Layer's name.
Save the file as "My_first_Variables.ai"
Target Layer "Cyan" (click the circle at the right hand of the Layer's name)
At the bottom of the Variables Palette click the Make Visibility Dynamic button
Now you've created your first Layers Visibility Variable. Continue
with …
Target Layer "Magenta" and click the Make Visibility Dynamic button in the Variables Palette
Target Layer "Yellow" and click the Make Visibility Dynamic button in the Variables Palette
Target Layer "Black" and click the Make Visibility Dynamic button in the Variables Palette
Done. You have created four Layers Visibility Variables. The next step
is to define the Data Sets:
Layers Palette: Show Layer "Cyan" and hide all other layers
Variables Palette: Click the Capture Data Set button (the camera icon)
Layers Palette: Show Layer "Magenta" and hide all other layers. Now in the Variables Palette the first Data Set becomes italic, indicating
that you can create a new Data Set. So click the Capture Data Set
button to define Data Set 2.
Layers Palette: Show Layer "Yellow" and hide all other layers
Variables Palette: Click the Capture Data Set button to create Data Set 3
Show Layer "Black" and hide all other layers. Click the Capture Data Set button to create Data Set 4
Show all layers and click the Capture Data Set button to create Data Set 5
Done. You have created five Data Sets. Just play arround by toggling
them in the Variables Palette (Next/Previous Data Set button or via
Popup menu/Flyout menu) and notice one feature among other things: The
Variables Palette as a remote control of the Layers Palette. If you
like, rename the Data Sets according to the Layers names, for
instance.
By the way, showing the Next/Previous Data Set is actionable (that is,
a shortcut can be assigned).