-
1. Re: Stage.Scroll() question?
resdesign Oct 2, 2012 7:17 AM (in response to drew_BD)What are you try to do exactly?
-
2. Re: Stage.Scroll() question?
drew_BD Oct 2, 2012 7:29 AM (in response to resdesign)I just just playing around, but lets say if if the user decides to scroll down, much like a click it will play an animation. Replace the click with a scroll. I am just trying out different things.
-
3. Re: Stage.Scroll() question?
drew_BD Oct 2, 2012 7:37 AM (in response to drew_BD)I just seen this on twitter a minute ago and this is what I had in mind.
http://childrensmiraclenetworkhospitals.org/Soda/index.html
What I was working with was a box changing color when you scrolled down.
-
4. Re: Stage.Scroll() question?
Vinay Nellagi Oct 2, 2012 2:48 PM (in response to drew_BD)Yes, I too was trying that and was confused. It however works when there is scroll bar in the page. If you set the display to scroll for stage and make the div on the stage bigger that the stage then the scroll bars appear. Now if you scroll up and down it must play the aimation.
Here is what I tried - http://dealsdrizzle.com/research/scroll/test1.html
Download - http://dealsdrizzle.com/research/scroll/scroll.zip
I think to acheive what you took as an example http://childrensmiraclenetworkhospitals.org/Soda/index.html we will need to use mousewheel events. Here you can see some code snippet http://brandonaaron.net/code/mousewheel/demos
I may be wrong but that is how it seems to be.
-
5. Re: Stage.Scroll() question?
drew_BD Oct 2, 2012 6:22 PM (in response to Vinay Nellagi)This is what I have done so far, hope you like . Still working on it, so please add if you wish.
Chris
https://creative.adobe.com/share/43bdff34-6ab8-434e-9305-807a8cc4e1fb
-
6. Re: Stage.Scroll() question?
heathrowe Oct 2, 2012 7:09 PM (in response to drew_BD)Looks good drew
Darrell
-
7. Re: Stage.Scroll() question?
drew_BD Oct 3, 2012 4:30 AM (in response to heathrowe)Thanks Darrell.
-
8. Re: Stage.Scroll() question?
stacy.hunt Oct 3, 2012 4:39 AM (in response to drew_BD)Hey Drew, this sounds a lot like what I was trying to do a while back. I finally got control of the mouse scroll and it was largely thanks to a tutorial at JqueryForDesigners.
Here is an example composition I set up to illustrate it:
- On the stage is a symbol called "Text".
- Inside the symbol is a text field which is wider than the Symbol
- The Overflow of the symbol is set to "hidden"
- The Javascript file "jquery.mousewheel.js" is in the same folder as the Edge project. It's a plugin that can be downloaded from a link at that tutorial, or just google it.
Here is the code that makes this symbol respond to the mouse scroll:
If you set it up right, scrolling the mouse wheel will make the contents of the symbol scroll horizontally.
The good thing about gaining control of the scroll this way is that you can use it for other things. I made a slider that controlled a list, and used the mousewheel to drive the thumb on the slider along if the user didn't want to drag it. Among other things.
Hope that helps!
-
9. Re: Stage.Scroll() question?
Vinay Nellagi Oct 3, 2012 11:37 AM (in response to drew_BD)Drew, that was nice. Based on your code I researched and found that it works in Firefox too when we use
event.originalEvent.detailalong withDOMMouseScrollElse, for other browsers
event.originalEvent.wheelDeltaalong withMousewheelworks perfect.Here is an example - http://www.dealsdrizzle.com/research/scroll/scroll2.html
Source - http://www.dealsdrizzle.com/research/scroll/scroll2.zip
-
10. Re: Stage.Scroll() question?
drew_BD Oct 3, 2012 11:47 AM (in response to Vinay Nellagi)VERY nice Vinay!!
on a side note do we have any mac users? If so do you know how to stop the brower from scrolling when you dont need to scroll. Much like an iPad when you move the browser around.
-
11. Re: Stage.Scroll() question?
Vinay Nellagi Oct 3, 2012 11:56 AM (in response to drew_BD)Yes, I use Mac.. But can you rephrase the query ?
-
12. Re: Stage.Scroll() question?
Vinay Nellagi Oct 3, 2012 11:59 AM (in response to drew_BD)Are you referring to the bounce effect in Safari browser when you try to scroll beyond the page ?
-
13. Re: Stage.Scroll() question?
drew_BD Oct 3, 2012 12:01 PM (in response to Vinay Nellagi)That would be it!
-
14. Re: Stage.Scroll() question?
Vinay Nellagi Oct 3, 2012 12:05 PM (in response to drew_BD)Try this..
$(window).bind(
'mousewheel',
function(e) {
e.preventDefault();
}
); -
15. Re: Stage.Scroll() question?
Jam Zhang Apr 28, 2013 7:01 AM (in response to drew_BD)drew_BD and Vinay, you guys rock! Saved my life!!
-
16. Re: Stage.Scroll() question?
Vinay Nellagi Apr 29, 2013 9:08 AM (in response to Jam Zhang)Glad that it helped you..
-
17. Re: Stage.Scroll() question?
mirifarr Aug 26, 2013 2:08 PM (in response to Vinay Nellagi)vinay!!!!!!!!!!!! you rock Mannnnnnnnn thanks a lot .....
after spending the all day digging finaly found this !!!!
u made my day
thanks a lot!!!
-
18. Re: Stage.Scroll() question?
mirifarr Sep 5, 2013 6:33 AM (in response to mirifarr)what should i do to make the scroll timeline work on touch?
-
19. Re: Stage.Scroll() question?
drew_BD Sep 5, 2013 7:23 AM (in response to mirifarr)I am guessing here now.... but how about using these:
-
touchstart,touchmove- taphold, swipe, swipeleft, swiperight
I haven't tried these yet. ALso you might have to include jQuery mobile
-
20. Re: Stage.Scroll() question?
mangustas Apr 18, 2014 3:26 AM (in response to Vinay Nellagi)// 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();
});
Is it possible to implement some line for this code to stop at the end of timeline? Currently when it reaches the end of timeline, it goes back to the first frame.





