Electric Simulation--Half Done

Hi,
below is the code i am using to associate a [COLOR=darkred]ULScrollbar Component[/COLOR] with a Text field so that on every single scroll point (divided in 4 portions) a value is displayed in text field [COLOR=blue]“TextBox”[/COLOR]
Scroll position is stored in a variable [COLOR=blue]“ScrollP”[/COLOR]

[COLOR=darkred]Here is the Code :[/COLOR]

Scroller_mc.[COLOR=#000000]setScrollProperties[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]1[/COLOR], [COLOR=#000000]0[/COLOR], [COLOR=#000000]4[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#f000f0][COLOR=gray]//[/COLOR][/COLOR]
[COLOR=#993300]var[/COLOR] scrollListen = [COLOR=#000000]{[/COLOR][COLOR=#000000]}[/COLOR];
scrollListen.[COLOR=#993300]scroll[/COLOR] = [COLOR=#993300]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"eventObj.target = "[/COLOR]+eventObj.[COLOR=#993300]target[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]var[/COLOR] scrollP = eventObj.[COLOR=#993300]target[/COLOR].[COLOR=#000000]scrollPosition[/COLOR];
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"ScrollP = "[/COLOR]+scrollP[COLOR=#000000])[/COLOR];
TextBox.[COLOR=#993300]text[/COLOR] = .[COLOR=#000000]6[/COLOR] + COLOR=#000000[/COLOR] * .[COLOR=#000000]2[/COLOR];
[COLOR=#000000]}[/COLOR]
Scroller_mc.[COLOR=#000000]addEventListener[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]“scroll”[/COLOR], scrollListen[COLOR=#000000])[/COLOR];

[COLOR=gray]//code end[/COLOR]

Now i want to add another functionality :
There are 4 Movie clips of Bulbs on the stage : [COLOR=blue]mc1, mc2, mc3, mc4[/COLOR]

what i want is :

_visible property of the Clips is interacting with the slider…so that when [COLOR=blue]ScrollP[/COLOR] is 0,None of the Movie clips are visible,[COLOR=blue]when its 1,Mc1 displays on the screen[/COLOR],[COLOR=blue]when it is 2,mc2 and mc1 **both **are visible[/COLOR] and so on and so forth ,[COLOR=blue]when the ScrollP is “4” all Movieclips are visible,[/COLOR]when we go back ,the Movie clisp turns off one by one …till ScrollP is “0”

I can imagin a [COLOR=blue]Switch Condition[/COLOR] is required here but i guess i am missing something on it …

Can anyone help with this plz …

Thanks alot in advance :slight_smile: