flash - Using a graphic to scroll the timeline in AS3 -
I have a movie clip with the instance name 'core' which has 500 frames in the core, and from the root timeline I have a I want to be able to click on the filmclip which I have the example 'scroller' and it has to clean 500 frames, front or back in a limited area.
I have tried some things like timelinemax, but I'm having trouble doing the work of troubles. The timeline is created manually (without twitsmax or anything).
Any thoughts? I can not find good examples anywhere.
Thanks
If you made a simple example, you could catch the argument. You can tune up the Scroll Range according to the needs of your value.
import flash.events.MouseEvent; Import flash.geom.Rectangle; Import flash.events.Event; Var scrollP: point = new point (scroller.x, scroller.y); Var scroll range: int = 100; Var timelineetleframes: int = core.totalFrames; Var rect: rectangle = new rectangle (scrollP.x, scrollP.y, scrollRange, 0); Core.stop (); Function OnDown (E: MouseEvent): Zero {scroller.startDrag (wrong, rect); AddEventListener (Event.ENTER_FRAME, Onskol); } Function Onup (e: MouseEvent): Zero {scroller.stopDrag (); If (Hewitt Listener (Event .ENTER_FRAME)) Remove EventListener (Event.ENTER_FRAME, Onskol); Work on Crawl (E: Event): Fix zero {// (scroller.x - scrollP.x) if your scroll is different from 0 var calcframe: int = ((scroller.x - scrollP.x) * timelineetlframe ) / ScrollRange; Core.gotoAndStop (calcFrame); } Scroller.addEventListener (MouseEvent.MOUSE_DOWN, OnDown); Scroller.addEventListener (MouseEvent.MOUSE_UP, onUp); // Release the mouse outside the scroll stage. AddEventListener (MouseEvent.MOUSE_UP, onUp);
Comments
Post a Comment