Solved

Control Flash video with mouse

Posted on 2009-06-28
1
386 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

689 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