Random MovieClip script not selecting from all possible outcomes

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 more to be chosen.
Code:
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.
Im really stumped, id like the script to choose from many more than 3 movie clips

You should put a trace to check the movieId value to confirm that the code calls for movies > 2.
The random selection code should be fine as is, so you may have to wait a bit to see one of the movies you say is not displaying.  If you were to increase the number of them, the chances of seeing some in the range > 2 is better.  The only thing I can think of from your code that might prohibit showing something > 2 is the mode value, since that's the only thing that prohibits display of anything.
I am not at all familiar with video cams andactionscript regarding them, but would it be necessary to clear out the current mc# from being present/active before adding a new one?

Similar Messages

  • How do I set up my iTunes Genius to play selections from all, not just some, of my songs in my currently playing playlist?

    Last night, when I played my playlist songs with iTunes Genius, my iTunes, with one of my playlists selected, and set on "Shuffle On," "Genius Shuffle On, "Genius On," "Match On," and "Play," played selections from all of my songs in my playlist. Today, my iTunes Genius went back to the same problem it was giving me before last night. My iTunes Genius has been playing selections from just a few of my playlist albums. How do I set up my iTunes Genius to play selections from all, not just some, of my songs in my currently playing playlist?

    No backup is a huge mistake.
    You can redownload some itunes purchases in some countries:
    Downloading past purchases from the App Store ... - Apple - Support

  • Can not select from SAPTOOLS.DB6PMCF

    We use third-party tool to monitor our SAP systems. We receive an error
    Can not select from SAPTOOLS.DB6PMCF
    when we monitor DB2 database.
    Function DB6PMCF is registered in SAPSID schema. Can I register it also in SAPTOOLS schema? What is a correct procedure for this?

    Hi Milan,
    I think you have to issue the following command for the affected user.
    db2 "grant execute on function saptools.db6pmcf to <user>"
    regards, Javier Rocha

  • Why are my emails not deleting from all devices when deleted from one?  I have iCloud set up and turned on. I have ipad2, iphone5 and a Mac. What am I doing wrong?  Thank you

    Why are my emails not deleting from all devices when deleted from one?  I have iCloud mail set up and turned on. I have ipad2, iPhone 5 and a Mac desktop. What am I doing wrong?  Thank you.

    It depends on the type of email account you are using, not on iCloud.  If you are using an IMAP or exchange account, when you delete from one device, it is deleted from all devices.  If you are using a POP (POP3) account, it won't.  (iCloud email, Gmail and Yahoo are all IMAP accounts.)

  • Apple reminders do not disappear from "all" and "missed" view when dismissed from "today" view of notification center by marking the circle by the reminder. why is this?

    Firstly, I really like the new reminders in iOS 7. However, I noticed that apple reminders do not disappear from "all" and "missed" view when dismissed from "today" view of notification center by marking the circle by the reminder. it requires me to take an extra step and click on "all" and then click the "x" to make it completely disappear and clear from notification center.
    why is this? am i doing something from?

    unfortunately, that does not address my question. your link describes how to clear the missed section of center.  I know how to clear the missed section of notification center, as I said in the original question. I will re-peat my question to clarify. it is:
    apple reminders do not disappear from "all" and "missed" view when dismissed from "today" view of notification center by marking the circle by the reminder. it requires me to take an extra step and click on "all" and then click the "x" to make it completely disappear and clear from notification center. 
    why is this? am i doing something wrong?
    the behavior I would expect would be that when i click the circle on the "today" view. it would clear it out from the missed and all view so i would not have to clear in 2 areas.
    I Hope this clarifies...

  • Insert into all tables on a Database on Test Server select from all tables on a database A from production server

     
    hi Friends ,i need a suggestion from  you on how to
    insert data to all tables on a Database  "A " on Test server
    Select data from all tables on  a Database  "A" on Production Server
    where id=123
    Database A is same with Structures on Test and Production also all Tables  will have  Id column in common.
    The purpose of this insert is ,as we all know Production has the latest data and i need to push to test server on request for particular ID only  ( may be weekly once or  twice a week )
    I  have a linked server setup name "LINQ" 
    Example for one table is below , like wise i need a script which does for 154 tables.
    Insert into ABC( id, name)---insert to test server
    Select Id, name  from  LINQ.ProdSerevrname.databasename.ABC where id = 123
    Please help me ..
    Thanks

    Why not use export import wizard for this if you've read access to production?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Can not select from data dictionary view from a procedure

    Hi,
    I wonder, which privilege is missing here:
    my schema has this roles and privs:
    GRANT CONNECT, RESOURCE TO cb ;
    GRANT CREATE SESSION TO cb ;
    GRANT SELECT_CATALOG_ROLE TO cb ;
    GRANT CREATE SYNONYM TO CB;
    GRANT CREATE VIEW TO CB;
    I create a procedure:
    create or replace procedure dd_test as
    begin
         dbms_output.enable(2000000);
         for r in (select table_name from sys.dba_tab_partitions     where owner = 'CB') loop
                   dbms_output.put_line(r.table_name);
         end loop;
    end;
    sho err
    4/38 PL/SQL: ORA-00942: table or view does not exist
    When I run the core statement form sql prompt, it works !
    so what privilege is missing here ???
    thanks for any hint, Lao De

    Hi,
    thanks for that reply, after doing that I can not select this DD-view from sql-prompt anymore (which I don't wonder ;-). Can you tell me, what idea you had behind that test ?
    I found another instance, where the procedure works and I will compare those privileges, but it's hard to sort out that complex structure of nested roles and sys_privs.
    How ever, I will update here, when I found the missing privilege.
    regards LaoDe

  • Can not select from my own MV. Please help.

    Hello Gurus,
    I have created a MV with following clauses
    CREATE or REPLACE MATERIALIZED VIEW "OWNER_NAME1"."MV_Name1"
    BUILD IMMEDIATE
    USING INDEX
    REFRESH COMPLETE
    AS
    SELECT column1, column2 .... from table1,table2
    where .....
    I have logged in to DB with the 'owner_name1' schema itself which is the owner of the MV.
    But, when I try to select from the above MV. It gives error "Ora-00942 table or view does not exist"
    I can see the same under 'user_objects' view as an object of owner_name1 schema.
    Could you please help me in understanding where I have gone wrong?
    DB - Oracle 9i on unix platform.
    Thanks in advance!
    Abhijit.

    Oh! I missed to mention the exact steps followed by me which created error for me,
    viz.
    1) I have 2 Database and their users as follows
    bq. i) DB1 in local server - 'localUser'
    bq. ii) DB2 in remote server - 'RemoteUser1' and 'RemoteUser2'
    2) 'RemoteUser2' user in DB2 has 'select' privilage on table 'RemoteTable1' of 'RemoteUser1' ( both are remote DB's users ! )
    i.e. select * from RemoteUser1.RemoteTable1; --works okay when logged into RemoteUser2. no synonyms are created hence using schema_name.table_name convention.
    3) Logged in to 'localUser' in DB1.
    4) Created a DB link 'local_to_remote2' in 'localUser' schema ( in DB1) to 'RemoteUser2' schema (in DB2)
    i.e.
    create database link local_to_remote2 connect to RemoteUser2 identified by password using 'connection_string';
    DBLink was created successfully.
    5) I could select from the tables of 'RemoteUser2' using DB Link. (by logging in to 'localUser')
    i.e. select * from RemoteUser1.RemoteTable1@local_to_remote2 ; --- gives me expected output. no issues!
    6) Now, I created below MV in 'localUser' ( no need to tell in 'DB1' )
    the exact syntax I used is as follows,
    CREATE or REPLACE MATERIALIZED VIEW "localUser"."MV_Name1"
    BUILD IMMEDIATE
    USING INDEX
    REFRESH COMPLETE
    AS
    SELECT column1, column2
    From RemoteUser1.RemoteTable1@local_to_remote2
    where condition1
    and condition2;
    The MV was created successfully, and I could see it as an 'Valid' object of 'localUser' schema.
    i.e. select * from user_objects where object_name ='MV_NAME1' and status ='VALID' --- tells that above create MV is an object of owner 'localUser'
    But, when I try to select from the said MV. it gives me error "Ora-00942 table or view does not exist"
    i.e. select * from MV_Name1; ---- neither this
    select * from localUser.MV_Name1; ---- nor this works :(
    Even when I try to drop the same MV it gives me same error. :(
    Could you please suggest me anything so that I will be able to select from MY OWN MV ?
    Please help Gurus.

  • Problem Windows 8 logon script not working from windows server 2008 R2

    hi there , this is third post regard this problem, here is my problem goes .....
    Is a very simple logon script for mapping drive purpose .... PLS take note Domain users can access and run this script for domain users using windows XP / WINDOWS VISTA / WINDOSWS 7 and only  users " WINDOWS 8.1 " Does NOT run
    at all . the script I put on logon script in Windows server 2008R2 group policy ... 
    @jrv :- http://social.technet.microsoft.com/profile/jrv/?ws=usercard-mini , insist said is my group policy setup problem so I post here agn...
    Manually run the script on WINDOWS 8.1 is 100 % perfect so it is definitely not my logon script issue , PLS any guidance pls share for me ok ?? thanks
    Below is my script syntax ;-
    @echo off
    REM Login.bat Version 1.0
    REM Exit if user has logged on to the Server
    IF %COMPUTERNAME%.==SL2011. GOTO END
    REM Delete pre-existing drive mappings
    REM
    REM Map M: to SL2011 on sl2011
    NET USE M: /DELETE >nul
    NET USE M: \\SL2011\sl2011 /YES >nul
    REM
    REM Map Y: to AccScan on rss2
    NET USE Y: /DELETE >nul
    NET USE Y: \\rss2\Public\AccScan /YES >nul
    REM

    Hi Tee Ee Foong,
    According to your post, the gpresult showed the GPO was applied and the script could run successfullymanully in the client. Right? Please follow the following step to narrow down
    the issue:
    1. Change the script to the following command: add 
    > %SystemDrive%\Users\test.txt to the script.
    2. Log on to a client with a regular user account, run gpupdate/force, and then re-log on to this client.
    3. Check if the test.txtfile exists in this location %SystemDrive%\Users.
    If the test.txtfile exists, the GPO with logon script is applied successfully when user logs on. But the result of running logon script achieves the goal we excepted or not which
    is still not sure.
    Regards,
    Lany Zhang

  • ICloud photostream photos not deleting from all devices

    how can i delete my photos from my icloud photostream on  EVERY device on the cloud account. I
    have deleted them but they still can see them.      My photostream is off, however i want to prevent my parents seeing them on their photostreams on our iCloud account. Thanks for any help

    It depends on the type of email account you are using, not on iCloud.  If you are using an IMAP or exchange account, when you delete from one device, it is deleted from all devices.  If you are using a POP (POP3) account, it won't.  (iCloud email, Gmail and Yahoo are all IMAP accounts.)

  • Can not select from v$mttr_target_advice

    Hello
    When i try to select from the view it never comes back and is a problem for the mmon process. Anyone have any ideas.

    Could you pleasse post the error message and the version you are using?
    Best Regards
    Krystian Zieja / mob

  • Why won't Dreamweaver code view allow me to select from all of my system fonts?

    I am trying to change the font for my code view in Dreamweaver CC.  However, it does not let me choose from a list of all fonts installed on my computer...it just gives me about 50 or so random fonts (some of them glyph fonts which are completely useless in this scenario).  It doesn't even include basics like Courier.  I had previously been using CS4, and it allowed me to choose any font I wanted.  Any ideas?

    I've just checked Dreamweaver CC on my MacBook Air. I don't know whether it lists every single font on my machine, but the list was very long. It certainly wasn't just a short, random list. Are you trying to change the Code view font in the right place?
    Dreamweaver > Preferences > Fonts

  • AS Random letter script not working

    I have the Flash AS Bible and one of the exercises is to
    create a random letter displayer. I am not getting any errors in my
    AS code, so I believe I have that o.k, but when I test movie I only
    get a blank screen. One part I am unsure about is "using the text
    tool, add an authoring time dynamic TextField object offstage on
    the embedded font layer.
    I see ta dynamic text box created, but I am not sure about
    the rest. I also have it in the embedded font layer.
    Also this part. "Open the Character Embedding dialog box and
    choose the "specify ranges" option and the value abcdef in the
    "include these characters" field.
    I see the character embedding dialog box, but not the option
    to choose "specify ranges". I do see the "include these characters"
    field.
    Someone please explain what I may be doing wrong.
    Also just FYI herre is the AS code:
    //Create the array of letters.
    var aLetters:Array = ["a", "b", "c", "d" , "e", "f"];
    //Set the interval at which a new letter should be displayed.
    var nDisplayInterval:Number = setInterval(this,
    "displayLetter", 1);
    //Define an associative array to store data about ecach
    letter.
    var oLetters
    bject = new Object();
    function displayLetter():Void {
    //Create a random integer to yield one of the indices from
    the
    //aLetters array.
    var nRandomIndex:Number = Math.floor(Math.random()
    *aLetters.length);
    //Create random numbers to use for x and y coordinates of
    // the letter TextField.
    var nRandomX:Number = Math.random() *550;
    var randomY:Number = Math.random() *400;
    //Get the next available depth;
    var nDepth:Number = this.getNextHighestDepth();
    //Create a new Textfield object at the random x and y
    //coordinates.
    var tLetter:TextField = this.createTextField("tletter" +
    nDepth,
    nDepth, nRandomX, nRandomY, 0, 0);
    //Set the autosize and text properties so the random letter
    displays
    tLetter.autosize = "left";
    //Set the text.
    tLetter.text = aLetters[nRandomIndex];
    //Initialize the _alpha property to 0.
    tLetter._alpha=0;
    //Tell Flash to embed the font for the TextField.
    tLetter.embedFonts = true;
    //Define a new object into which to store some data for the
    letter.
    var oLetter
    bject = new Object();
    //Assign the object to the oLetters assocaitive array usimg
    the instance name
    //of the TextField object as the key
    oLetters[tLetter._name] = oLetter;
    //Set a element called fadeDirection that determines
    //the increment by which the alpha will change. And set the
    //alpha to 0 initially.
    oLetter.fadeDirection = 5;
    //Define an element that references the TextField.
    oLetter.letterField = tLetter;
    //Create a TextFormat object that tells Flash to use the
    //Verdana font and sets the size to 15.
    var tfFormatter:TextFormat = new TextFormat();
    tfFormatter.font="Verdana";
    tfFormatter.size= 15;
    //Assign the TextFormat to the TextField.
    tLetter.setTextFormat(tfFormatter);
    //Set an interval at which the letter will fade in and out.
    Assign the ID
    //to a property of the oLetter onject so we can clear it
    later. Pass the
    //alphaFade() function a reference to the oletter object.
    oLetter.interval = setInterval(alphaFade, 10, oLetter);
    function alphaFade(oLetter
    bject):Void {
    //Retrieve the TextField object reference.
    var tLetter:TextField = oLetter.letterField;
    //Increment the letter TextField's alpha.
    tLetter._alpha += oLetter.fadeDirection;
    //Check to see if the letter has faded in completely. If so
    //set the fadeDirection property to -5 so that The TextField
    //Starts to fade out. Otherwise, if the letter has faded out
    //completely clear the interval and remove the TextField.
    if(oLetter.fadeDirection > 0 && tLetter._alpha
    >=100) {
    oLetter.fadeDirection = -5;
    else if(oLetter.fadeDirection < 0 &&
    tLetter._alpha <=0) {
    clearInterval(oLetter.interval);
    delete oLetters[tLetter._name];
    tLetter.removeTextField();
    //make sure to update the screen.
    updateAfterEvent();
    thanks!

    Sounds ok but here is how you do that.
    With the text tool selected, draw a text box anywhere you
    like but not on the stage. Using the property inspector set the
    text field to be dynamic. Type some text in the text field, select
    it and using the property inspector, select Verdana for the font.
    In the property inspector click 'embed' and select the character
    sets you want to embed or just use the "include these characters"
    field to embed the characters you are using in your aLetters array.
    If you do not embed the font, you'll get a blank screen. I've
    tested the code and it works properly.

  • Library sharing not working from all accounts

    I am using iTunes Library sharing from my iMac to enable access to mucis & movies on ios devices on my local network.  From my login on the iMac this works fine and the shared library appears on the "more" menu in the music app on my ipad whenever itunes is open on the iMac.
    I have made the same set up on my daughters login on the same iMac but her shared library will not show up on any devices on the network.  Her shared library is however visible in iTunes when I log into my account on the same iMac via fast user switching.  Other functionality of itunes from her login seems fine & it can airplay to my ATV without problem.
    There is no difference in the set up of iTunes between her login and mine:  neither have home sharing enabled, and both have 'share my library on my local network/entire library' selected in itunes prefence.
    I have tried with home sharing enabled and this made no difference.
    I can only guess that there is a preference pane or similar in her login that is corrupted.  Any ideas welcome.
    Thanks
    JW
    itunes 10.6.3
    osx 10.7.4
    imac mid 24" mid 2007
    ipad latest model 3g/wifi
    ios 5.1.1

    Once again updating and hoping (praying) somebody will get this:
    I still cannot get Library Sharing to work, and I think it is a bug with Windows7 64 Bit Version:
    1) Uninstall
    I have uninstalled everything as per Knowledge Base http://support.apple.com/kb/HT1923
    I even removed all regstry-entries pointing to Apple software (mainly under HKLM and HKLU). I removed all "Apple Computers" Folders in USER\AppData
    2) Re-Install
    Reboot & Clean reinstall
    New empty itunes library (Removed old itunes Folder in MyMusic)
    Imported one CD
    3) Sharing
    Turned on sharing in the settings.
    Started up another PC: nothing:
    Started up Apple Remote (2.0.1 - 229) on iPad (iOs 4.2.1): Entered correct four digit code in Itunes
    A greyed-out Itunes symbol without a name appears (normally reading "BlaBlas Library")
    4) Sharing Part 2
    Using the other Computer (Notebook W32bit)
    using sharing feature in the other direction (Notebook -> Windows 7 64Bit PC) works
    Apple Remote to this PC also works.
    5) Sharing Part 3
    Created an entire Blank new User with a new empty Itunes Library. Imported one CD: Same Problem.
    Conclusion: Bonjour or some other component of ITunes sharing is broken. What should I do. Can I leave a bug report somewhere?
    Please help me!

  • Can not select from gv$ table in trigger...please help.

    I have the following SQL in my trigger which I am using in mt cursor.
    cursor sessioninfo is
        SELECT s.LOGON_TIME,
               i.INSTANCE_NAME,
               s.SERIAL#,
               s.MACHINE,
               s.PROGRAM,
               s.MODULE
          FROM gv$SESSION s, gv$instance i
         where i.INST_ID = s.INST_ID
           and s.SID = (select sys_context('USERENV', 'SID') from dual)
           and s.USERNAME =
               (select sys_context('USERENV', 'SESSION_USER') from dual);I get the following error:
    Compilation errors for TRIGGER DBAGUNNER.TRG_SERVICENAMELOGON
    Error: PL/SQL: ORA-00942: table or view does not exist
    Line: 22
    Text: FROM gv$SESSION s, gv$instance i
    Now, I have the DBA role and when I run this query by itself it works fine. But when I try and compile the trigger I get the error. I am creating the trigger as me as well.
    Version of DB is 11gR1
    Any idea's why I am getting this or a way around this?
    Edited by: Gunners on Feb 4, 2010 1:05 PM

    Privileges granted through roles are not valid in pl/sql.
    GRANT SELECT ON gv$SESSION to YOURUSERMax
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/31/le-direttive-di-compilazione-pragma/]

Maybe you are looking for

  • How do I update interactive links across a document created from importing other indd pages?

    Hello! First time writing up a query to please bear with me! Situation - I am creating singe page templates for various uses (cover page variations/index page variations/content page variations/etc-) - The index page has all the chapters listed which

  • Easy DMS - where does it store available systems list

    Hello, We have Easy DMS installed. If the client has a saplogon.ini file, this seems to be picked up in the list of Available Systems. If there is no other SAP software installed, systems can be input via the [.] button. Does anyone know where this i

  • How do I send a pdf file by email

    How do I send a PDF file as an attachment to an email?

  • IPhoto duplicates all my pictures?!!!

    Hi, i found out that after i add a pict to the library and than modify it (via iPhoto), if i spotlight the file name of that picture it finds 3 copies in 3 different folders of the library: one in "originals", one in "data" and one in "modified". is

  • BPC 7.5 NW - ICMATCHING

    Hi I am using the main Consolidation application to do ICMatching using (ICDATA AND ICBOOKING). Bothe Datamanager packages are executing.  ICBOOKING check the Payables and Receivable and books the difference. My problem is that I have LEQ accounts as