Need advice on making a simple Flash video file. Trying to accomplish two things.

I have some video files (.avi) that I am trying to convert to a Flash video format. I am trying to export it to a Flash player to go into a Powerpoint file. With this, I am trying to accomplish two goals:
1. To have the short clip (15sec, 30fps) endlessly loop, like an animated .gif.
2. To allow the user to click on the video player and drag left/right to ff/rew.
The video itself is a turntable animation. One of our products is making a complete 360degree turn. By allowing the user to grab and drag, it will simulate them rotating the model.
So far, I have already accomplished Goal 1. I made a new Actionscript 3 file, imported video (embed flv in swf and play in timeline), and then made the video loop on the timeline. This seems to export properly, and the video loops as needed. The only thing I can't figure out is how to make the video "interactive" and let the user drag left/right.
For context, I have never used Flash before. Any help would be greatly appreciated.

This will come down to essentially moving the playhead of Flash based on the movement of the mouse. It's certainly not going to be smooth however, you'd need a timer to be responsible for moving your playhead and reversing spatial compression is very CPU intensive (moving backwards on the timeline). I'd recommend having a forward and backward version of the video so you could flip between them but if you're new to flash you're already in way above your head.
Add a new layer and try adding this example script (or Download Source example here, saved to CS5):
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.MouseEvent;
// make sure we don't trip this frame twice
if (!stage.hasEventListener(MouseEvent.MOUSE_DOWN))
          // stop playhead
          stop();
          // set state (forwards? backwards?)
          var movingForward:Boolean = true;
          var curFrame:int = 1;
          var mouseStartX:int; // used later to determine drag
          // detect mouse click and drag left or right
          stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseF);
          stage.addEventListener(MouseEvent.MOUSE_UP, onMouseF);
          // create new timer to control playhead, start it
          var phTimer:Timer = new Timer(33,0);
          phTimer.addEventListener(TimerEvent.TIMER, movePlayheadF);
          phTimer.start();
          // function to control playhead
          function movePlayheadF(e:TimerEvent):void
                    curFrame += movingForward ? 1 : -1;
                    // validate frame (60 total frames)
                    if (curFrame > this.totalFrames) curFrame = 2;
                    else if (curFrame < 1) curFrame = this.totalFrames;
                    // goto the next frame
                    this.gotoAndStop(curFrame);
          // function that controls the direction variable
          function onMouseF(e:MouseEvent):void
                    if (e.type == MouseEvent.MOUSE_DOWN)
                              // user started touching, record start spot
                              mouseStartX = int(stage.mouseX);
                    else if (e.type == MouseEvent.MOUSE_UP)
                              // user let mouse go, determine direction change (swipe stype)
                              if (stage.mouseX > mouseStartX)
                                        // swiped right, move forwards
                                        movingForward = true;
                                        trace('Moving forward now');
                              else if (stage.mouseX < mouseStartX)
                                        // swiped left, move backwards
                                        movingForward = false;
                                        trace('Moving backwards now');
This is pretty simple. In the example source link above an object on the timeline (nice ugly red circle) moves right over 60 frames and then left over 60 frames (120 total). Consider that your movie.
A timer ticks at a speed of 33ms (30fps). This is where it isn't necessarily going to be too smooth with video. If you increase it to 60FPS then decrease the timer by half (16.5ms), season to taste. Each time the timer goes off the playhead is moved, either forwards or backwards.
To know if it should go forward or backwards a simple variable (movingForward) keeps track of the last 'swipe'. The swipe is simply captured when a user touches the screen (mouse/finger), moves in a direction and then lets up. If they moved to the left the direction will be reverse. If they moved to the right it will move forward. This doesn't take into consideration any more than that logic, but illustrates how you can watch the mouse for movement and "do something" based on it.
A very simple validatior in the timer event function checks to see if the next frame (in either direction) is valid and if it's not, it corrects it so it stays within your videos timeline length.
Note there is a MOUSE_MOVE event you can try to hook to which can be used to literally let the user drag the video forwards and backwards the amount they drag their finger/cursor. Also if this is some kind of circular surface like a record spinning, the direction the user moves the mouse based on where they touch the record would change which direction they expect it to move. Etc etc..
That should get your feet wet in how much you need to consider for your project.

Similar Messages

  • Importing existing flash video files??

    howdy
    quick question. if you import existing flash video files into an encore project, will this help reduce the final render time? or will encore rerender the existing flash video files?
    cheers
    angus

    Encore CS3 won't import FLV files. You must render the project to Flash.
    You may want to file a feature request at Adobe's support page asking for support for Flash-ready assets, to eliminate the need to transcode in Encore.

  • I need to change a photo into a video file in order to post on youtube. How can I do this with my mac?

    I need to change a photo into a video file in order to post in youtube. How can I do this with my mac mini?

    When I go to import, the choices are :
    movies
    camera archive
    imovie for IOS
    imovie for HD
    It refuses to import a photo with any of these choices, which is located on the desktop or in a folder. It's a regular .jpg
    There are instructions to drag it. I put it there, and it bounces right back. The photo will not stay.
    I just need this one picture to go on so I can post a meditation on youtube.  It doesn't come from a camera.

  • Have AE7; Problem importing prproj file into pc; get placeholder instead. What do I need to do to open up the video files here. They are .mov in quicktime.

    Have AE7; Problem importing prproj file into pc; get placeholder instead. What do I need to do to open up the video files here. They are .mov in quicktime.

    Please be more specific. What Premiere project? What version of Premiere? Which operating system? What CoDecs do the QT fiels use? Are all the video files in the correct folders inside the Premiere project structure? Your description sounds like you are attempting to open a Mac based project on a PC and your video files are either in the wrong location or use a Mac-specific CoDec, hence they cannot be read on a PC.
    Mylenium

  • HT3775 How can I open a flv (flash video) file on my iMAC OS Snow Leopard??

    My problem:
    How can I open a flv (flash video) file on my iMAC OS Snow Leopard?

    Try VLC Media Player 2.0.3 or MPlayerX 1.0.14.

  • Flash video file not loading

    Hi,
    I'm having a problem getting some flash video files to load.
    So far it's affecting 2 files located on these pages:
    Martin
    O'Brien movie and
    John
    Gormley movie
    The .flv files are being hosted on amazon s3. I have done
    several things so far to try to figure out why they aren't loading:
    * Having the .swf file in the same folder as the web page
    (doesn't work)
    * Inserting a different .flv file from a different folder in
    amazon s3 (doesn't work)
    * Changing file permissions (doesn't work)
    * Linking to the .flv file in same manner from a different
    site on same ISP (video does work)
    * Embedding .swf file in a html file instead of a php file
    (doesn't work)
    I can only guess that it's something specific to the
    www.bmfconferences.com site. As I said i've tried the same .flv
    file on a different site with the same ISP (it says Bruce Robinson
    but it's the John Gormley video file (
    John
    Gormley movie on different site) and this works, but I don't
    know what else to look for to get the files to work on the bmf
    site.
    Any help would be much appreciated.
    Louise.

    Hi All
    I found the solution!... I had to add the MIME type .flv =
    video/x-flv to my web server (Windows 2003).
    Thank anyway
    Rit

  • Converting a flash video file to work with in FCE

    Does anyone know how to grab a flash video file off the web and convert it to a format that can be edited in FCE 2.0.3? Thanks

    Generally Flash video is streamed off a server and is not downloadable as some QuickTime files are.

  • I need a software to download stream flash video

    I want to download stream flash video from the NBA page,and I need some software to recommend me.

    I just want to keep it to myself to replay it as much  as I needed...
    thats the excuse shoplifters use
    I guess you didn't see the copyright warning on the NBA site?
    Copyright © 2012 NBA Media Ventures, LLC. All rights reserved. No portion of NBA.com may be duplicated, redistributed or manipulated in any form. By accessing any information beyond this page, you agree to abide by the Privacy Policy /     Your California Privacy Rights and Terms of Use
    anyway the website flash settings prevent you from downloading.

  • Flash Video File STUMP!

    Okay, I'm totally stumped by this issue:
    I just created a simple Flash file that is programmed to play a little animation and then play a video when the user clicks (video uses FLVPlayBack and and RTMP connection). Everything works fine when I export it from the Flash IDE, and in fact the video streams from a remote CDN server right to my desk top.
    So, then I go to test the SWF on our remote web site server with a simple embed into HTML using SWFObject.  I use a standard block of code to do this that I'm currently using for a different video player I also made that works just fine--I just swap the SWF file name and adjust a few details.
    Yet, when I go to test the file, the SWF does nothing!  The simple animation does not play, and the video does not load.  What could be causing this?  My first thought was that it was something in the SWFObject method, and I've played around with it trying all kind of things I think should work.  I'm not sure what it is.
    Here is the simple code in the flash file:
    import fl.video.FLVPlayback;
    import flash.display.Sprite;
    var videoPath:String = "rtmp://fstream.imediasee.com/basic/user/preview_video";
    init();
    // init
    function init() {
         player.autoPlay = true;
         bPlay.addEventListener(MouseEvent.CLICK, beginPlay);
         anim.addEventListener(MouseEvent.CLICK, beginPlay);
    // begin play
    function beginPlay(e:Event) {
         player.source = videoPath;
         bPlay.visible = false;
         anim.visible  = false;
    Again, this works fine when run on my desktop.  "player" is an FLVPlayBack component, and "anim" an "bPlay" are MCs on the stage.
    Here is the HTML file:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <script type="text/javascript" src="http://www.website.com/video-player/scripts/swfobject.js"></script>
    <script type="text/javascript">
    var flashvars = {};
    var params = {};
    var attributes = {};
    swfobject.embedSWF("http://www.website.com/video-player/home-page-preview-video-player.swf", "flashDiv", "240", "180", "9.0.0", false, flashvars, params, attributes);
    </script>
    </body>
    </html>
    Any insights?

    I have not had trouble with uploading flash video (.html and .swf) files to my remote server until about 3 weeks ago. I have a .mov made up of stills, graphics, and short video clips with a sound track cued to the video. It plays perfectly on my computers (iMac and G5 with CS4). It will not play on the website. What is playing there now is a video with sound that I made in SlideShowPro for Flash that sort of works, but is not syncing well, which is why I had the .mov made by my sound engineer friend.
    Others seem to be having this same problem. What's up? Anyone?

  • Creating a Flash Video File

    Hello,
    I'm in desperate need of some guidance on how to actually
    convert an avi file over to a Flash Video (FLV) that I can
    eventually insert into a Captivate movie. I do have Flash but have
    no clue where to start (new to Flash personally). Can anyone
    possibly provide some step by step instructions on how to do this?
    I do have the AVI file on my hard drive and would really appreciate
    some step by step instructions.
    Since I'm new to Flash and haven't yet received any training,
    I'm really in the dark.
    Thanks for any assistance!
    Helen

    I'm also new to flash and have never done it before, but I
    think all you need to do is use the Flash 8 Video Encoder that
    comes with flash. That should convert the avi and a few other kinds
    of video files into FLV's.

  • I want my flash video file NOT to load until I hit play...how can I do that?

    I am wanting this to improve the initial download speed of the page. I have already added a Poster Frame to video's, however it still seems to be loading the video file and just autoplaying.  Is there a way to NOT load the video file until the person hits play?  This is the AS3 script I used...
    import fl.video.VideoEvent;
    myPoster.addEventListener(MouseEvent.CLICK, playMovie);
    function showPosterFrame(event:Event):void {
    myPoster.visible = true;
    function hidePosterFrame(event:Event):void {
    myPoster.visible = false;
    function playMovie(event:MouseEvent):void {
    myVideo.play();
    myVideo.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, hidePosterFrame);
    myVideo.addEventListener(VideoEvent.COMPLETE, showPosterFrame);
    I am using Dreamweaver to put the pages together via the Insert - Media - Flash...then putting the .swf file in the page.
    Thanks,
    Arguilo

    you can start the video and then stop it.  it will continue to download (which you can monitor).  when the time is right, you can enable the video's play button.  before the video's ready to start, you can entertain your users.

  • Need help converting photo jpg to a video file.

    So I have a 6 minute animation that was sent to me as a series of photo-jpgs. I need to convert them to a video file rather than a huge sequence of stills so I can add some transitions. The images are 1920 by 1080. I don't want to compress them at all until the final render. What sequence settings should I use and how should I export? I know there a billion and two different ways to do this but for some reason I keep screwing it up.
    Jon

    As long as the images are sequentially numbered, 001, 002 etc,
    1. open up QT Pro and import as a still image sequence and save is as an animation codec.
    2. create a sequence using the animation codec as the basis, import all the images and drop them into the timeline.
    Recognize that the animation codec requires a huge bit of horsepower and disk throughput to edit in real time.
    x

  • Need help with conversion progrma for MTS video files.  Can't download videos from Sony TX-10 camera

    Have new macbook pro 13".  Can't download videos from our Sony TX-10 camera.  I understand I need some kind of conversion program for MTS video files.  Need recommendation for a good conversion program to convert the video files.
    Thanks, chieftd

    Well, sigh, that's not going to work.
    I love how I can do months of research to choose the best camera for my needs and budget, which is NO easy task these days, but surprisingly find it on the unsupported list when it's a very popular camera.  So, while it seems to support a whole bunch of other AVCHD options from Sony, not the NEX cameras.
    The NEX cameras are the latest generation of mirrorless cameras (which, ironically, are great b/c they give dSLR quality still images while actually producing HD video that always records silently and stays in focus b/c it's mirrorless).  The NEX 7 was just reviewed as Camera of the Year.
    Bleh. Oh well. Maybe someday.
    And, for anyone reading, Roxio Toast Titanium did convert it just fine but it took about 20 min or my time to set up a handful of clips and then a couple hours to complete converting them for the quality I was looking for.  One was about 10 minutes of a kids' performance on Christmas and it took a long time. It's just not feasible given how many video clips I do with the camera a week - well, feasible when you consider all the cameras where this would be seamless.
    Thanks for posting your reply - I appreciate it.

  • Needs help Linking back the audio to video files (MXF)

    I already unlinked the audio from certain video files (MXF) because I needed only the video, but now I would need only the sound, but it seems like the audio of those clips is gone. I tried importing the clip again (audio + audio linked to it) but there is no waves in the sound. Can't hear anything. Tried to import the sound by itself, but still no sound. When I look in the P2 viewer there are only 2 soundraks showing (3&4). Track 1 & 2 are gone and still no sound. How can I get the sound back for these clips. There must be a way?
    Thanks for your time

    Import the entire P2 Contents Folder again.

  • Simple Flash Video Cue Point Problem (I assume)

    Hello everyone. Quick question. After I have added a cue
    point to an end of a video, how can I have the cue point trigger an
    action such as "gotoAndPlay" or "fscommand("quit");" etc.?
    I thought this would be an easy thing to find by checking on
    the various websties for other posts or tutorials but nothing I
    found addressed this. Any info will be most appreciated.
    Thanks.

    You don't even need a cuepoint to do this.
    Using the FLVComponent or the VideoPlayer object, use the
    "complete" event to execute code. You set up an event listener
    object to listen to the video object (using
    videoobject.addEventListener(listenerObject) ), and create a
    function for the listener object to do when the "complete" event
    occurs (such as listenerObject.complete = function() { do whatever
    Here's a link to a useful pdf about the VideoPlayer object.
    http://download.macromedia.com/pub/documentation/en/flash/fl8/VideoPlayer.pdf

Maybe you are looking for