PDA

View Full Version : How to uses "onclick" with a Scrollbar ?


Tipiweb
08-01-2007, 07:20 AM
Hello all !

I want to use the onclick() or onmousedown() event with the scrollbar.

How to do this ?

Can you help me please ?


Thanks,
Max

Tipiweb
08-01-2007, 07:26 AM
PS : I use an automatic scroll to show many pictures.


<scrollbar onclick="Debug.write('Hello');animscroll.stop();"/>

<animator id="animscroll" attribute="sqrtx" from ="-35" to="35" duration="90000" repeat="Infinity" motion="linear" />

Sorry for my english...

Max

srivats08
09-26-2007, 05:43 AM
<class name="scrollbar" width="50" extends="basescrollbar">

<!-- Upward Button -->
<basescrollarrow direction="-1"
x="0" width="100%" height="80">
<!-- Handlers -->
<handler name="onmousedown">
this.onmousedown.sendEvent();
this.scrollbutton.onmousedown.sendEvent();
</handler>
<handler name="onmousestilldown">
this.onmousestilldown.sendEvent();
this.scrollbutton.onmousedown.sendEvent();
</handler>
<handler name="onmouseup">
this.scrollbutton.onmouseup.sendEvent();
</handler>

<!-- Views -->
<view name="scrollbutton"
width="100%" height="100%"
clickable="false">
<view width="100%"
valign="middle"
fontsize="14">
<simplelayout spacing="-5" />
<view align="center" resource="rsc_scroll_up" />
<text align="center" fgcolor="0x246088">scroll</text>
<text align="center" fgcolor="0x246088">up</text>
</view>
</view>
</basescrollarrow>


<view name="scrolltrack" width="${classroot.width}"
options="releasetolayout">
<basescrolltrack x="0" direction="-1"
width="${parent.width-10}"
height="${parent.thumb.y}"
visible="false" />
<basescrollthumb name="thumb" x="0" width="${parent.width-2}"
visible="false" />
<basescrolltrack x="0" direction="1"
y="${parent.thumb.y+parent.thumb.height}"
width="${parent.width-10}"
height="${parent.height - parent.thumb.y - parent.thumb.height}"
visible="false" />
</view>

<!-- Downward Button -->
<basescrollarrow direction="1"
x="0" width="100%" height="80">
<!-- Handlers -->
<handler name="onmousedown">
this.onmousedown.sendEvent();
this.scrollbutton.onmousedown.sendEvent();
</handler>
<handler name="onmousestilldown">
this.onmousestilldown.sendEvent();
this.scrollbutton.onmousedown.sendEvent();
</handler>
<handler name="onmouseup">
this.scrollbutton.onmouseup.sendEvent();
</handler>

<!-- Views -->
<view name="scrollbutton"
width="100%" height="100%"
clickable="false">
<view width="100%"
valign="middle"
fontsize="14">
<simplelayout spacing="-5" />
<text align="center" fgcolor="0x246088">scroll</text>
<text align="center" fgcolor="0x246088">down</text>
<view align="center" resource="rsc_scroll_down" />
</view>
</view>
</basescrollarrow>

<resizelayout spacing="4"/>
</class>


" Hey you can use like this. It will be very useful to you."