Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Random MovieClip script trouble

    i have a collection of movie clips (mc0, mc1, mc2...etc etc), and when motion is detected
    on a webcam, one of these clips is shown on the stage.

    however, for some reason only mc0, mc1 and mc2 are being displayed,
    and i cannot get mc3, mc4 or any others to be chosen.
    import flash.filters.*

    // Assumes a Video object named "myVideoObject" is on the Stage
    active_cam = Camera.get();

    filterList = [
    /* 0 */ "multiply",
    /* 1 */ "multiply",
    /* 2 */ "multiply",
    /* 3 */ "multiply",
    /* 4 */ "multiply"
    ];

    positionList = [
    /* 0 */ {_x: 512, _y: 288},
    /* 1 */ {_x: 512, _y: 288},
    /* 2 */ {_x: 512, _y: 288},
    /* 3 */ {_x: 512, _y: 288},
    /* 4 */ {_x: 512, _y: 288}
    ];



    myVideoObject.attachVideo(active_cam);
    active_cam.setMotionLevel(95, 100);
    active_cam.onActivity = function(mode)
    {
    trace(mode);
    var randId = Math.floor(Math.random() * 5);

    var init = positionList[randId];
    /* old init... {_x: Math.random() * _root._width, _y:Math.random() * _root._height}; */
    var depth = _root.getNextHighestDepth();
    var movieId = "mc" + randId;
    if(mode) {
    var mc = _root.attachMovie(movieId, movieId + depth, depth, init);
    mc.blendMode = _root.filterList[randId];
    }
    }
    I had the first three working fine, so when i added 2 more to the Filter and position Lists, and changed
    the Mathrandom mutliplier to 5 instead of 3, i thought that would work,

    what else to i have to do / How can i get more than 3 clips to show up ?

  • #2
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Great work .. really informative .. and thanks a lot for sharing ..


    __________________
    Electric adjustable beds prices reviews - Electric adjustable beds prices UK - Sleep Comfort adjustable bed mattress air


  •  

    Posting Permissions

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