Hello,
After doing a search I found exactly what I need in this thread:
Example - http://dealsdrizzle.com/research/scroll/test1.html
Download - http://dealsdrizzle.com/research/scroll/scroll.zip
But I want to replace the "stage timeline" to an "symbol timeline", assuming that my symbol is called "container", how should be the code in compositionReady to get/target my symbol?
Vinay Nellagi code:
// Works in firefox
$(window).bind('DOMMouseScroll', function(event) { // to enable scroll for entire window use this
//sym.$("Rectangle2").bind('DOMMouseScroll', function(event) { //to enable scroll for a selected div in firefox //alert(event.originalEvent.detail); var dirf = event.originalEvent.detail > 0 ? 'Up' : 'Down'; var velf = Math.abs(event.originalEvent.detail); $(this).text(dirf + ' at a velocity of ' + velf); //return false; if(dirf == 'Up') sym.play(); else sym.playReverse(); });
//Works in other browsers
$(window).bind('mousewheel', function(event) { // to enable scroll for entire window use this
//sym.$("Rectangle2").bind('mousewheel', function(event) { //to enable scroll for a selected div in other browsers
//alert(event.originalEvent.wheelDelta); var diro = event.originalEvent.wheelDelta > 0 ? 'Up' : 'Down'; var velo = Math.abs(event.originalEvent.wheelDelta); $(this).text(diro + ' at a velocity of ' + velo); //return false; if(diro == 'Up') sym.play(); else sym.playReverse(); });
Thanks in advance.