Solved

Control Flash video with mouse

Posted on 2009-06-28
1
383 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Failed download 57 563
Flash Slides/Presnetation 4 74
Converting CFGRID from Flash to HTML in Coldfusion 1 96
How do I have music file play continuously on a website? 6 103
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to record live broadcast.

770 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