Comment RSS Site RSS
Users
  • Register

  • Log in


    Flash Redirect Tutorial

    I have noticed several requests for a flash movie redirect since my origional tutorial on HTML redirects, so here it goes, short and sweet.

    A Flash redirect that performs as the movie ends only requires one simple line of code to be put into the last keyframe:

    getURL(”http://www.whitesandsdigital.com“);

    This simply uses the getURL funtion that you would use for buttons embeded into the last key frame.

    Now supose your video is a looped, and you don’t want your visitor to wait for the end of the movie to be finished. Then you can put this into your loop once your loop parameters are met:

    onEnterFrame = function() {
    getURL(”
    http://www.whitesandsdigital.com“);
    }
    stop();

    This works the same way as the above except it doesn’t require you to be on the last keyfame for it to work properly.

    Finally, you can also use an FLVPlayback component, which is the Adobe prefered way of handling redirects:

    import mx.video.*;
    var listenerObject:Object = new Object();
    listenerObject.complete = function(eventObject:Object):Void {
    trace(”Elapsed play time at completion is: ” + my_FLVPlybk.playheadTime);
    };
    my_FLVPlybk.addEventListener(”complete”, listenerObject);
    my_FLVPlybk.contentPath = “
    http://www.whitesandsdigital.com/flash/water.flv“;

    Basically this creates an event listener that can be fired at any time regardless of where your at in the video.

    That’s all. Have fun.



    Posted March 21, 2008 By Bryan
    Filed under: Design, Tutorials, Web

    Leave a Reply

     


    Menu