A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Flash Video FAQ

  1. #1
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    Please read before posting on the forum

    1. Take a look at the other posts to see if your question has already been answered. You could even do a search first (look up on the right side of the page - there it is!) you may just find what your looking for quite easily. It's a handy tool.

    2. When describing a problem, please tell us what version of Flash you are using, describe the methods of scripting and targeting you are using, and if there is a possibility that hardware or software may play into the issue - tell us how your machine is set up. Most of the questions that end up not getting answered are because there is just too little information there for anyone to be of any help.

    3. Code listed in the FAQ is tested and works - but if you are a cut-and-paster, don't be surprised if something does not work right. You should have a working knowledge of actionscript if you want to use any advanced method shown here in the FAQ or in the forums.

    4. Be nice, and don't act stupid! As with all the forums here, no cussn', no stealin' (warez talk), and no solicitation.

    These are some the most common questions and answers here on this forum, for more in depth tutorials - look under the Flash video tutorials thread at the top of the video forum.

    How do I load a external (dynamic) movie


    There are two methods for loading external movies into your Flash movie. These methods are the same for video as they are for loading any external information or standard Flash movies, but there is often some confusion on how to use these methods.

    Either method will allow the video to stream provide the video is either on the main timeline or created with encoding software.

    1. loadMovie();
    This method is used to load external data or a movie (.swf) into a movie clip on the timeline, so targeting is the key. Here's how you use it:

    In this example, you have a movie clip on the root timeline called target_MC, my.swf is located in the same folder as your main movie on the server. You can place this code on a frame, a button or in a function.
    Code:
    loadMovie("my.swf", target_MC);
    You may want to use an empty movie clip for this method, as whatever is currently in the clip will be removed when the external movie is loaded.

    2. loadMovieNum();
    This method is used to load external data or movies to a level (_level).

    In this example, you want to load an external .swf to level 10 of your main movie. The name of the external .swf is my.swf, it is located in the same folder as your main movie on the server. Again, you can place this code on a frame, a button or in a function.
    Code:
    loadMovieNum("my.swf", 10);
    Bandwidth and proper compression for your target audience is the key to making your external movie stream instantly. Loading another movie into the same level will clear the memory and clear the screen of the first dynamically loaded .swf, my.swf.


    How do I control a dynamically loaded video .swf

    Once you have used one of the above methods to load a video .swf to either a movie clip or the main timeline, you may want to know how to target it so that you can control it's properties and timeline.

    1. If you loaded into a movie clip using the loadMovie(); method, you just target the movie clip that you loaded into - as that will now be your video. By loading into a movie clip you remove any other content in that clip, and now control of that clip is like control of your loaded movie (you may want to use an empty MC in the above method).

    In the above example we loaded the .swf into target_MC, so to play the movie:
    Code:
    target_MC.play();
    2. If you used the loadMovieNum();, you target the level that you placed the new movie on, in the above instance - _level10.
    Code:
    _level10.play();
    Last edited by Wheels; 05-08-2004 at 03:04 PM.

  2. #2
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590

  3. #3
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590

    Linked video...

    To link or embed, common question.



    This is the little popup you are greeted with when you attempt to import a video file to Flash. But which one to choose?

    Embed You choose embed when you want to create a Flash encoded video from your source that can be exported as a Flash MX movie.

    Linked You choose the linked option for movies that will be exported or published back to their source format with a Flash layer included. For example, a QuickTime movie (.mov) source exported as a QuickTime movie (.mov) that includes a Flash layer.

    On the same note, you must publish as Flash 5 for QT 6 and Flash 4 for QT 5. There is no support for Flash 6 content or scripting in QT.

    If you want to create Flash video, choose embed.
    Last edited by Wheels; 05-08-2004 at 02:55 PM.

  4. #4
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590

    Video and sound codecs

    Here is a link to Macormedia's dicussion on all known issues with MX. There is good information for video and sound codec issues that affect video.

    http://www.macromedia.com/support/fl.../mx/rn_mx.html
    Last edited by Wheels; 05-08-2004 at 03:03 PM.

  5. #5
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590

    PAL-SECAM-NTSC information

    Listing of standards by country.

    http://www.aefreemart.com/technical/worldvid.html

  6. #6
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590

    Load and Fade with AS

    This function will load a movie, place it on the stage, fade the video and audio in and fade them out on exit - then unload the movie.


    http://www.flashkit.com/board/showth...hreadid=424522

  7. #7
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590

    How to load a percentage of .swf before playback

    Code:
    this.targ = "http://www.yoururl.com/your.swf";
    function loader (t,b) {
            removeMovieClip(this.hold);
            var p;
            var h = this.createEmptyMovieClip("hold", 1);
            var c = h.createEmptyMovieClip("clip", 1);
            c._visible=false;
            h._x = 38;
            h._y = 71;
            var l = h.attachMovie("preloader", "preloader", 2, {_x:152, _y:112});
            l._xscale=0;
            c.loadMovie(t);
            h.onEnterFrame = function() {
                    c.stop();
                    p = Math.floor((c.getBytesLoaded()/c.getBytesTotal())*100);
                    l._xscale = p*(100/b);
                    if (!isNaN(p) && p>=b) {
                            this.onEnterFrame = null;
                            l._xscale = 100;
                            removeMovieClip(l);
                            c._visible = true;
                            c.play();
                    }
            };
    }
    loader(this.targ, 20);
    stop();
    Of course, this will not work locally or from CD - only streaming from server will return real results.

    var l is a movie clip in your library.
    Last edited by Wheels; 05-08-2004 at 03:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center