Solved

Control Flash video with mouse

Posted on 2009-06-28
1
381 Views
Last Modified: 2013-11-11
Hi,

I'm not sure if this is possible, but is there a way to control flash video with mouse movement? For instance, if you move the mouse to the right of center over a video, it advances, if you move the mouse to the left of center it rewinds. I guess the functionality I'm looking for would be similar to that of a thumbnail slider.

Another solution could perhaps be, to put frames of the video on separate frames in the timeline, then have the mouse movement advance or rewind the timeline?

I've been researching this quite a bit, but I haven't found any viable solutions. Any help from the experts here would be greatly appreciated!!!

Thanks!
0
Comment
Question by:Coobakai
1 Comment
 
LVL 8

Accepted Solution

by:
ccarey earned 500 total points
ID: 24744145
if you put the video on the timeline in a movieclip (say with an instance name 'mc') then this will do the job:



// mc is present on root timeline

// this code lives on frame 1 of root timeline
 

stage.addEventListener(MouseEvent.MOUSE_MOVE, _onMouseMove, false, 0, true);
 

function _onMouseMove(evt:MouseEvent) : void {

    var pct:Number = Math.max( stage.mouseX / stage.stageWidth, 0);

    var frame:Number = Math.ceil(pct * mc.totalFrames);

    mc.gotoAndStop(frame);

}

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now