Load random FLV with NetStream

Dear Adobe members,
I'm puzzeling for days on this one. I'm a bit of a noob so please help me
I want to create a videowall in a grid of 7 x 7 flv's.
In this grid, the flv's have to be loaded at random and when finished, a new
random flv has to be loaded and played.
I've come so far that I have a MovieClip that loads an flv at random and then
loops it, but it loops the same video, not a random new one.
Can anybody help me out please?!
The code:
var video:Video = new Video();
addChild(video);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = {onMetaData:ns_onMetaData, NetStatusEvent:ns_onPlayStatus};
var video_array = new Array("Scenes/001.flv", "Scenes/002.flv", "Scenes/003.flv", "Scenes/004.flv");
// Function that gets a random video from the array
function getRandomVideo():String {
return video_array[Math.floor(Math.random() * video_array.length)];
video.attachNetStream(ns);
ns.play(getRandomVideo());
function ns_onMetaData(item:Object):void {
// Resize video instance.
video.width = item.width;
video.height = item.height;
// Center video instance on Stage.
video.x = (stage.stageWidth - video.width) / 2;
video.y = (stage.stageHeight - video.height) / 2;
//loop the video
function ns_onPlayStatus(event:NetStatusEvent):void {
if(event.info.code == "NetStream.Play.Stop"){
     ns.seek(0);
ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus);
Thanks!

For those who want to know how I solved it:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.bufferTime = 0;
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
var video_array = new Array("Scenes/001.flv", "Scenes/002.flv", "Scenes/003.flv", "Scenes/004.flv");
// Function that gets a random video from the array
function getRandomVideo():String {
return video_array[Math.floor(Math.random() * video_array.length)];
ns.play(getRandomVideo());
var vid:Video = new Video(182,137);
vid.attachNetStream(ns);
addChild(vid);
function asyncErrorHandler(event:AsyncErrorEvent):void{
// ignore error
// loop video
ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus)
function ns_onPlayStatus(event:NetStatusEvent):void{
if(event.info.code == "NetStream.Play.Stop"){
ns.play(getRandomVideo());
ns.seek(0);

Similar Messages

  • Load random flv

    This is my catch 22 ...
    Im trying to load random flv's into my mc. I cant seem to figure out how to loop random flv's.  Currently, it plays a random flv the 1st time, plays a random flv the 2nd time around, but the 3rd time (and so on) it loops the same 2nd flv.  I need it to constantly loop random flv's every time.  Any suggestions? 
    var randomNum:Number=Math.random();
    var connection:NetConnection = new NetConnection();
    var stream:NetStream;
    var video:Video=new Video(stage.stageWidth,stage.stageHeight);
    var metaObj:Object = new Object();
    var isPaused:Boolean=true;
    connection.connect(null);
    stream=new NetStream(connection);
    stream.client=metaObj;
    metaObj.onMetaData=onMetaData;
    function onMetaData(data:Object):void {
    video.attachNetStream(stream);
    mc.addChild(video);
    //load background video
    function videoInit():void {
         if (randomNum<=.333) {
              stream.play("clipA.flv");
         if (randomNum>.333&&randomNum<.666) {
              stream.play("clipB.flv");
         if (randomNum>=.666) {
              stream.play("clipC.flv");
    videoInit();
    function videoLoop(stat:Object):void {
         if (stat.info.code=="NetStream.Play.Stop") {
              if (randomNum<=.333) {
                   stream.play("clipA.flv");
              if (randomNum>.333&&randomNum<.666) {
                   stream.play("clipkB.flv");
              if (randomNum>=.666) {
                   stream.play("clipC.flv");
         stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);
    Thanks in advance!

    First, you can shorten code and remove function videoLoop altogether. As for random issue, you need to reset random number to a new one - I don't see other issues with it. See code below:
    import flash.events.Event;
    var randomNum:Number;
    var connection:NetConnection = new NetConnection();
    var video:Video = new Video(stage.stageWidth, stage.stageHeight);
    var metaObj:Object = new Object();
    var isPaused:Boolean = true;
    connection.connect(null);
    var stream:NetStream = new NetStream(connection);
    stream.client = metaObj;
    metaObj.onMetaData=onMetaData;
    function onMetaData(data:Object):void {
    video.attachNetStream(stream);
    mc.addChild(video);
    videoLoop();
    function videoLoop(stat:Event = null):void {
         if (!stat || stat.info.code == "NetStream.Play.Stop") {
              randomNum = Math.random();
              if (randomNum <= .333) {
                   stream.play("clipA.flv");
              else if (randomNum > .333 && randomNum < .666) {
                   stream.play("clipkB.flv");
              else {
                   stream.play("clipC.flv");
        stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);
    Also, you may want to reconsider how you reference videos and put the into an array and choose from it - this is more scalable:
    import flash.events.Event;
    var videoArray:Array = ["clipA.flv", "clipB.flv", "clipC.flv"];
    var connection:NetConnection = new NetConnection();
    var video:Video = new Video(stage.stageWidth, stage.stageHeight);
    var metaObj:Object = new Object();
    var isPaused:Boolean = true;
    connection.connect(null);
    var stream:NetStream = new NetStream(connection);
    stream.client = metaObj;
    metaObj.onMetaData=onMetaData;
    function onMetaData(data:Object):void {
    video.attachNetStream(stream);
    mc.addChild(video);
    videoLoop();
    function videoLoop(stat:Event = null):void {
         if (!stat || stat.info.code == "NetStream.Play.Stop") {
              stream.play(videoArray[Math.random() * videoArray.length]);
         stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);

  • NaN with loading external flv

    Hi all
    I'm having some strange diffulties which I can't solve.
    I'm starting off with a website.swf which loads different
    external swf's depending on the button that has been pressed.
    One of those swf's is a file with different buttons to load
    different external flv's.
    While loading a flv a progressbar shows the percentage of the
    loaded part of the flv
    Now: If I play the first video file everything works fine
    While switching to another button to load another flv during
    the loading of the first flv, My percentage says NaN. and stops
    loading.
    On each button I say:
    on (press) {
    stream_ns.close();
    connection_nc.close();
    _parent.videoloader_mc.unloadMovie();
    on (release) {
    _parent.videoloader_mc.loadMovie("movies/binnenkomers01.swf");
    This is the part I use for loading a flv in f.ex
    binnenkomers01.swf.
    stop();
    delete _global.loaded_interval;
    delete _global.connection_nc;
    delete _global.stream_ns;
    delete _global.pctLoaded;
    // video URL
    video1_url = "movies/binnenkomer06_Floriane.flv";
    _global.connection_nc = new NetConnection();
    connection_nc.connect(null);
    _global.stream_ns = new NetStream(connection_nc);
    videoholder_mc.video.attachVideo(stream_ns);
    stream_ns.play(video1_url);
    stream_ns.seek(0);
    // Zet de video op stop om te wachten tot hij volledig is
    ingeladen
    stream_ns.pause();
    _global.playstatus = "pauze";
    play_pauze_mc.gotoAndStop("pauze_lb");
    this.createEmptyMovieClip("progressBar_mc",
    this.getNextHighestDepth());
    progressBar_mc.createEmptyMovieClip("bar_mc",
    progressBar_mc.getNextHighestDepth());
    with (progressBar_mc.bar_mc) {
    beginFill(0xCCE6FF);
    moveTo(0, 0);
    lineTo(300, 0);
    lineTo(300, 23);
    lineTo(0, 23);
    lineTo(0, 0);
    endFill();
    _xscale = 0;
    progressBar_mc.createEmptyMovieClip("stroke_mc",
    progressBar_mc.getNextHighestDepth());
    with (progressBar_mc.stroke_mc) {
    lineStyle(0, 0xCCE6FF);
    moveTo(0, 0);
    lineTo(300, 0);
    lineTo(300, 23);
    lineTo(0, 23);
    lineTo(0, 0);
    progressBar_mc._x = 640;
    progressBar_mc._y = 400;
    this.createTextField("loaded_txt",
    this.getNextHighestDepth(), 0, 0, 200, 22);
    loaded_txt._x = 645;
    loaded_txt._y = 405;
    var my_fmt:TextFormat = new TextFormat();
    my_fmt.color = 0x333333;
    my_fmt.font = "Verdana";
    my_fmt.size = 9;
    my_fmt.align = "left";
    _global.loaded_interval = setInterval(checkBytesLoaded, 500,
    stream_ns);
    function checkBytesLoaded(stream_ns) {
    trace("my_ns.bytesLoaded: "+stream_ns.bytesLoaded);
    trace("my_ns.bytesTotal: "+stream_ns.bytesTotal);
    _global.pctLoaded =
    Math.round(stream_ns.bytesLoaded/stream_ns.bytesTotal*100);
    trace("_global.pctLoaded: "+_global.pctLoaded);
    loaded_txt.text = "loading... "+pctLoaded+"%";
    loaded_txt.setTextFormat(my_fmt);
    progressBar_mc.bar_mc._xscale = pctLoaded;
    if (isNaN(pctLoaded)) {
    clearInterval(loaded_interval);
    } else {
    trace("OK");
    if (pctLoaded>=100) {
    clearInterval(loaded_interval);
    Hope you guys can help me....

    Maybe they have hotlink protection enabled
    "indierockmedia" <[email protected]> wrote
    in message
    news:f3c4mo$ddn$[email protected]..
    > Hi, I am having trouble with some loading issues. I
    design ecards for
    > bands and
    > their tour dates, bio, and video files all load external
    files (text files
    > for
    > bio/tour, flv files for the video, and an swf skin file
    for the video).
    > Its
    > only a problem when I have to embed those ecards into
    sites that don't
    > host the
    > ecard. I have used crossdomain.xml and every fix ive
    read about, and still
    > have
    > issues. Let me detail below:
    >
    > For example, I have an ecard for a band at
    >
    http://bandwebsite.com/ecard/ecard.swf
    > The tour and bio and video files load simply "tour.txt,
    bio.txt,
    > video.flv,
    > skin.swf"). Works great because no external servers are
    being called.
    >
    >
    But when I want to embed the file elsewhere, or use different
    domains,
    > I
    > have issues:
    > I want to embed the ecard on to
    http://www.otherwebsite.com,
    so I can't
    > have
    > it simply call "tour.txt" for example, the ecard will
    think the tour file
    > comes
    > from www.otherwebsite.com/tour.txt. So I call the full
    path
    >
    http://bandwebsite.com/ecard/tour.txt
    > I go to the ecard and click the button to load the tour
    dates. The text
    > box
    > that worked before says "undefined". So I put a cross
    domain file at the
    > root
    > of
    http://bandwebsite.com that
    allows access to files from
    > www.otherwebsite.com. Still getting undefined. I go to
    the embed code for
    > flashobject and have allowscript access to "always".
    Still undefined. I go
    > and
    > add System.security.allowDomain to my timeline and
    specify
    > www.otherwebsite.com. Still undefined. Still won't load
    my video or video
    > skin
    > and text files.
    >
    > Am I missing something?
    >
    > mikey
    >

  • Loading FLV problem (NetStream)

    Hi all,
    I'm having some problems loading a FLV and I've been searching on google for 2 days now and I can't seem to find a anwser for my problem, maybe one of you guys can help me out here.
    here is the scenari I have a SWF that loads a FLV
    code:
    var videoConnection:NetConnection = new NetConnection();
    videoConnection.connect(null);
    var videoStream:NetStream = new NetStream(videoConnection);
    var video:Video = new Video();
    videoStream.play("myVideo.flv");
    video.attachNetStream(videoStream);
    video.width = 720;
    video.height = 480;
    video.x = 0;
    video.y = 0;
    loaderVid_mc.x = 152;
    loaderVid_mc.y = 144;
    The problem is everytime I try to load the video I get the following error message:
    Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onXMPData. error=ReferenceError: Error #1069: Property onXMPData not found on flash.net.NetStream and there is no default value.
              at content_fla::MainTimeline/frame1()
    Anyone? Any ideas?

    Thanks very much for your HELP....I was looking at the help.adobe website you sent me and found a anwser for my problem.
    In case anyone comes to the same problem here is what I did for solving it.
    I just added the following lines to my code:
    original
    var videoConnection:NetConnection = new NetConnection();
    videoConnection.connect(null);
    var videoStream:NetStream = new NetStream(videoConnection);
    var video:Video = new Video();
    videoStream.play("myVideo.flv");
    video.attachNetStream(videoStream);
    new lines:
    var customClient:Object = new Object();
    videoStream.client = customClient;

  • AS3, 33rd FLV loaded loses sound: with solution

    Loading FLVs into an flvplayback component, the 33rd FLV
    loaded is silent, and no FLVs loaded after this will have sound.
    I had assumed that as the instance was leaving the stage and
    it's parents etc were being deleted, and there were no persistent
    references to the content, the player would deal with garbage
    collection.
    It seems this is not the case.
    I don't know why the 33rd is the one to fail, but I guess 32
    might be the maximum number that work?
    So, if loading multiple FLVs into your movie, remember to
    manually close the FLVs once they are finished, before loading the
    next one.
    I used
    myFlvPlayback.getChildAt(0).close();
    you could also use
    currentVideoPlayerIndex =
    myFlvPlayback.activeVideoPlayerIndex;
    myFlvPlayback.closeVideoPlayer(currentVideoPlayerIndex);
    but I found that this errors when you have only loaded one
    video, as you can't closeVideoPlayer where the current index is 0.
    I can't find anywhere in the documentation that states that
    you can only load a maximum of 32 videos into the player, perhaps
    it's a sound channel limitation? It would have been helpful for
    there to be a note of it in the help files!
    Maybe I should have known to manually clean up anyway, but
    hopefully this will save a few people a few hours of head
    bashing.

    Good question!
    They are all being loaded into a single component. However,
    the component is in a MC being attached dynamically using "new
    VideoPanelClass()" (the name of my specific class for the MC that
    includes the FLVPlayback), and is being removed from the stage in
    between loadings - not just for a split second but for significant
    lengths of time. I had imagined it would count as a new component
    each time, but it seems this is not the case, despite it tracing as
    a new instantiation of the parent MC each time.

  • Need help with netstream crossdomain issue

    Our company has a main server for our web site. But all of
    our graphics are then copied from the main server to a special
    caching server to speed things up. I am trying to use netstream to
    create a universal video player for our company and it works fine
    as long as the source .swf and .flv are being called from the same
    server. But when I call the .swf from our main server and then the
    .swf tries to load the .flv from the graphics server, it doesn't
    play. I have tried the crossdomain.xml thing and it still doesn't
    work. I've looked for information relating to netstream crossdomain
    issues but haven't found anything. I know the easy solution is to
    make sure everything is called one server, but many people might
    use this and I can't always be sure they know what they are doing.
    Can anybody help???? OR could this be a problem with the way our
    servers are setup?

    forgot to add that i did delete and re add the Drivers thinking that might be an issue
    Ran system test on everthing and it show its working just fine
    but still no  SPOKEN VOULUME TO SPEAK OF
    the music or Sound side works fine 
    Paul

  • Please help me load an .flv video that has been embeded onto a web page

    Hello there,
    I was hoping someone on this forum could please help me with one specific problem that I am having. I would like to embed the a flash player into an html page, and load the video from a service that has the streaming video provided.
    This is the context of the situation...
    We have created a site that was to be used on a showroom floor (no internet connection) and loaded the .flv videos at the local root level for the site.
    Now however, we would like it to be an online site. I have been able to use the flash "jw player"to load videos to play using the shadowbox javascript, but when I try to embed it onto a page and have it play, it isn't working and I am not sure why.
    Below is the code that is currently working to load the videos on the local root level.
    Might someone have any ideas on what I need to replace to have it load the videos from the streaming service?
    I would greatly appreciate any assistance that could be provided.  I can also provide a URL if it would help.
    I would GREATLY appreciate any assistance provided.
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    swfobject.registerObject("player1","9.0.98","expressInstall.swf");
    </script>
    <object id="player1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="640" height="380">
    <param name="movie" value="player.swf" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    <param name="flashvars" value="file=assets/videos/Bob_Peebler.flv&image=images/videoStatic_Peebler.jpg" />
    <object type="application/x-shockwave-flash" data="player.swf" width="640" height="380">
    <param name="movie" value="player.swf" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    <param name="flashvars" value="file=assets/videos/Bob_Peebler.flv&image=images/videoStatic_Peebler.jpg" />
    <p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p>
    </object>
    </object>

    Hello,
    Thanks  a lot for the reply.  However, I am pretty confident that the jw player supports the streaming video option, but as I mentioned that I was able to use it as a popup using the shadowbox javascript before. After doing a bit of investigating on how the videos are hosted, I am using "progressive download" method for these videos.
    I think the problem is that the player.swf is hosted on my website server -  and the videos are then hosted on the media hosting service.  I think that the player needs to be located on the media hosting service, and then embedded onto the page along with where to point to the .flv video.  Does that sound right?
    If so, the paramater I am using to embed the player as I mentioned in my original post is simply:
    <param name="movie" value="player.swf" />
    does the "value" then have to change to the http:// address for the video player.swf that would then be hosted on my video hosting service?
    Little help?
    Please let me know if there is anything I can provide to clarify the issue.
    Thanks
    M

  • Importing flv with external playback.. loop?!

    Hi!
    I'm trying to create google ads under the 50kb limit which is causing some headaches...anyway! I've noticed something. If I import my flv (which I've created in after effects) into adobe flash CS5.5 with "load external video with playback component" and then export the whole thing out as a SWF the file size is really small. 50 kb's compared to 795.6 kb's if the "embed flv in SWF" option is used.
    So my problem is this, I want to use the option of "load external video with playback component" but I want the video to loop when it's exported out as an SWF. Is this actually possible?
    I've tried some scripts which I've found, but I cant get it to work.
    Any help or advice would be very much appreciated.
    Many thanks!
    M

    Well yes, you can loop the video using the FLVPlayback, but I think you are missing the point of the 50kb google ad limit.
    When you use FLVPlayback, you must also use an external .flv file. So besides the <50kb .swf file, you will also have the >700kb .flv file. You cannot just use the .swf. So together, those two files put you way over the 50kb limit.
    Best wishes,
    Adninjastrator

  • FLV with SWF trigger

    Hi there,
    i have read a few forums on how to do this but none seem to work for me.
    I have created a SWF file with a button which is action scripted to load a FLV video.  However i am still not sure that i am filepathing the inserted FLV file correctly.
    I have set the absolute file path including http://www.etc..com however the movie does not load
    is the _root correct?
    should this be cleared?
    any other thoughts/ideas
    Thanks

    That would be correct were you loading a SWF file.
    An FLV is a different type of file, and requires the use of the Video classes, or the FLVPlayback component to play it.
    If you place an FLVPlayback component on the stage, and set its contentPath property to the absolute path when you click the button, it will load and play your video.

  • Cannot associate media file types .swf .flv with Adobe Flash media player

    I have been trying to associate these media types ( .swf .flv ) with Adobe Flash media player (9.0.124 latest from Adobe site) but cannot see the program in the list (looked under Adobe, Flash, Macromedia, Common etc) after loading. I have repeated the process, rebooted, and no luck.
    Any ideas why a new program should not show in the Programs list ? 
    thanks
    Simon 
    X300 Vista  

    kevpatts wrote:
    Hey sdalek,
    It's actually not all sites. I've found a few that work. I'll have a look for any difference in implementation to try to narrow down the issue.
    Regards,
    Kevin
    Thanks, I'm curious to find out what's different. I've repair disk permissions again using the one in Disk Utility instead of Cocktail with not luck As far as I can tell, all my issues seem to be occurring solely on www.adultswim.com and is sill happening with Camino, Firefox, Safari, and SWF & FLV Player. I'll keep checking other sites to see if the problem manifests itself elsewhere and I'll post any other changes I make to my system that might appear to help.
    Regards
    Message was edited by: [email protected]

  • Load random iframe

    Hi: I would like to know if anyone can help me with this
    issue:
    I'm developing a web site with an iframe in the center of its
    main content with featured products.
    I want the index.html, where the iframe it's included, to
    change it every time the page reloads, loading random htmls from a
    specified folder to display in the iframe area.
    I don't know if I'm clear enough... perhaps my English is not
    very good. I would appreciate any help. Thanks a lot.

    javichampagne wrote:
    > Hi: I would like to know if anyone can help me with this
    issue:
    >
    > I'm developing a web site with an iframe in the center
    of its main content
    > with featured products.
    >
    > I want the index.html, where the iframe it's included,
    to change it every time
    > the page reloads, loading random htmls from a specified
    folder to display in
    > the iframe area.
    >
    > I don't know if I'm clear enough... perhaps my English
    is not very good. I
    > would appreciate any help. Thanks a lot.
    >
    Does your server support a server langauge like php?
    If so insert the following piece of php code into the top of
    your page.
    1,14 being the number of files in your specified folder,
    change it to
    suit how many files there are ie (1,5) (1,8) (1,11) etc
    <?php
    // Set the lowest & highest numeric point in you series
    names of your
    includes files
    $sl = rand(1,14);
    ?>
    Then insert this in the table cell or <div> where you
    need the random
    file called in
    <?php
    include ('random_pages/file_'.$sl.'.php');
    ?>
    'random_pages' being the folder name the files are in. Name
    the files in
    the folder file_1.php, file_2.php, file_3.php etc
    Obviously you need php running on a server but you can use
    other server
    languages as well but youll have to google to find out some
    code. I'm
    sure it works similar.

  • Load random swf but not same

    someone here helped with the code to load random SWF files
    into a movie clip...however, i need to make sure it doesnt load the
    one that's already playing, that it goes on to a new one
    everytime..

    i dont think saying thank you really does it, but really,
    thank you.. you've helped me countless number of times, and it's
    only made me better at what I do, so I really am great full .
    Thanks again

  • FLV with two sound

    Hi my friends
    I need a flv with two sound. I want to load load two different sound for one flv file. for example I want to load my flv file in frame 1 with sound 1 then I want to load my flv file in frame 2 with sound 2. How can I do it?
    Best regards
    Hanif

    you should use two flvs that contain the two sounds if sync'g is an issue.  if it's not an issue, then use two sound class instances to play your two sounds.
    you can improve your current sync'g by disabling the autoPlay of your flv and starting by the flv and your timeline after the flv completely downloads and your swf completely downloads.

  • Random move with dragable in bouded area

    respected sir i m doing hard work since 6 months,u r god 4 me
    ,if u help me..plzzz
    My prb : i want make a object (random movement with dragable
    in bounded area like a farm hause.
    ----------------------Bounded movement
    onEnterFrame = function() {
    with (_root.yash){
    x1 = _x;
    y1 = _y;}
    var shapeFlag = true;
    if (_root.dragArea.hitTest(x1,y1,true)) {
    if (dragArea._x < yash._x-20){
    yash._x = dragArea._x+(yash._x-100)
    } else
    if (dragArea._x > yash._x+20){
    yash._x = dragArea._x-(yash._x+100)
    } else
    if (dragArea._y < yash._y+20){
    yash._y = dragArea._y+(yash._y-100)
    }else
    if (dragArea._y > yash._y+20){
    yash._y = dragArea._y-(yash._y+100)
    ----------------random movement and dragable
    onClipEvent (load) {
    //data you may want to change
    width = 550;
    height = 400;
    speed = Math.round(Math.random()*2)+1;
    //initial positions
    x = Math.random()*width;
    y = Math.random()*height;
    this._x = x;
    this._y = y;
    x_new = Math.random()*width;
    y_new = Math.random()*height;
    onClipEvent (enterFrame) {
    //x movement
    if (x_new>this._x) {
    sign_x = 1;
    } else {
    sign_x = -1;
    dx = Math.abs(x_new-this._x);
    if ((dx>speed) || (dx <-speed)) {
    this._x += sign_x*speed;
    } else {
    x_new = Math.random()*width;
    //y movement
    if (y_new>this._y) {
    sign_y = 1;
    } else {
    sign_y = -1;
    dy = Math.abs(y_new-this._y);
    if ((dy>speed) || (dy <-speed)) {
    this._y += sign_y*speed;
    } else {
    y_new = Math.random()*height;
    onClipEvent(enterFrame){
    if(drag){
    _x = _parent._xmouse;
    _y= _parent._ymouse;

    The else part modified:
    else
    { // not a corner point: keep handles in same relative position to their shifted anchor
        var aShift = Math.random()*cShift;
        var bShift = Math.random()*cShift;
        thisPoint.anchor = [va  + aShift, vb + bShift];
        thisPoint.leftDirection = [la + aShift, lb + bShift];
        thisPoint.rightDirection = [ra + aShift, rb + bShift];

  • Existing 'load external .flv' code?

    Recently, I found a great little Flash  project that acts like a jukebox for external mp3 song files, and am using it on my website to play my song demos.
    I'm now trying to find if there is an existing solution like that for video.  I just need some way to progressively download video files from my webspace when the thumbnail is clicked... and am now looking into some sort of Flash jukebox.
    I've tried just embedding the video files into HTML, but they don't progressively download for some reason (even though they are saved as Progressive With Compressed Header).  I've even tried using prettyPhoto (...a script that mimics a Lightbox like feature, where the whole page dims, and a floating window appears over your site, displaying any media, and allowing you to move back/forth through your list of media)..... works great, but again, not a progressive download, so you stare at a blank screen for a while.
    Seems the only way it works is if I have the file on YouTube or some other site, then embed it or use the prettyPhoto app.
    So, can someone either tell me how to make the embedded file download (OT, but I figured I'd ask), or point at some existing Flash file that serves as a video jukebox, showing all media on a common window?

    Hi,
    You can load external .flv files which is placed on your web server. You have to add a small amount of AS3 code into your flash document. Please click on the below link
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/media/Video.html
    Please use the sample code which is provided in the bottom of the page. In the code, you will find a line
    private var videoURL:String = "Video.flv";
    In the above line, instead of "Video.flv", you have to give your webserver path like http://www.domainname.com/foldername/videofilename.flv
    (The above code does the progressive download of an video)
    You can play the video through progressive download, by click on an image. To achieve that, you need to place the above code inside the mouse click function of an image.
    Thanks

Maybe you are looking for

  • Boot Camp is no longer bootable after tech tool pro.

    Really need som guidance today! A few days ago i created an eDrive with techtool pro, honestly I don't know why I even did this my computer was running fine...curiousity I guess. I booted in to the eDrive and ran a volume optimization on my mac os 10

  • Do Flash Player runtime and AIR runtime work differently?

    This question is asked as a follow up from a recent discussion, http://forums.adobe.com/message/6260447#6260447, regarding how getObjectsUnderPoint() works. The discussion was marked as correct as the answer provided by kglad was correct for the ques

  • Right click for image info

    Most of my photos are hosted on Pbase. I am going thru some of my pics to get to the original files. Right click using Firefox gives "image info" as an option. This shows the original file no. However, right clicking on an image in Safari does not gi

  • How to make the book demo work?

    Hi The following code is copied from the book "Learning Flash Media Server 3" chapter one package import flash.net.NetConnection; import flash.display.Sprite; import flash.text.TextField; import flash.events.NetStatusEvent; public class FMS3Connect e

  • Suicide .... TaskQueryService.getTaskDetailsById     S.O.S

    What hell is that !!!! please ?? java.lang.NullPointerException at oracle.bpel.services.workflow.query.impl.TaskQueryService.getTaskDetailsById(TaskQueryService.java:435) at completeTask.jspService(_completeTask.java:95) at com.orionserver[Oracle Con