|  | basic timeline scroller |  | |
| | | chrisP489 |  |
| Posted: Tue Sep 02, 2008 8:43 pm Post subject: basic timeline scroller |  |
Hi.
Basic thing, I know, but I've been searching for a while cant find what I need.
We are used to using scrollers that control a Netstream object, but now we have a project where the same scoller needs to control the playback of the main timeline. So have the scruber move automatically when as the movie plays, but also be dragable to advance or rewind the SWF.
Anyone got code or tutorial we could use?
thanks |
| |
| | | kglad |  |
| Posted: Wed Sep 03, 2008 2:00 am Post subject: Re: basic timeline scroller |  |
create a scrollbar and determine the slider's two extreme positions. use the following function to find the parameters needed for a linear equation to have the sliders extreme positions associate with frame 1 and _totalframes of your timeline of interest and the linear equation parameters that will associate frame 1 and _totalframes with the slider's extreme positions.
you can then define drag and drop methods for the slider and start a loop when the slider is being dragged so you can update the timeline's _currentframe and use a loop to update the slider's position when your movieclip is playing.
function solveF(x1,x2,y1,y2):Array{ m=(y1-y2)/(x1-x2); b=y1 - m*x1; return [m,b] } |
| |
| | | chrisP489 |  |
| Posted: Wed Sep 03, 2008 2:43 pm Post subject: Re: basic timeline scroller |  |
| Thanks, I will give this a try! |
| |
| | | kglad |  |
| Posted: Wed Sep 03, 2008 3:09 pm Post subject: Re: basic timeline scroller |  |
| |
|
|