AS3 getting a random multiple number of table

Hello:

I have a hard time finding ways to manage the division with random numbers of tables using AS3.

On my stage, I have two dynamic boxes; Box1 and box2 and a button, btn.

in the Assembly, I have the following berries:

var myDivisor:Array = [3,6,9,12,15,18,21,24,27,30];

var myDivider:Array = [1,3,6];

The idea is to divide 1 box per box of 2, so myDivisor should be a random number greater than a random number between myDivider

WITH THE HELP OF BTN, HOW CAN I GET A RANDOM OF EACH TABLE, SO THIS DIVISOR NUMBER IS HIGHER THAN THE DIVISOR?

In the timeline for button, here is the code:

btn.addEventListerner (MouseEvent, CLICK, rNum);

function rNum (MouseEvent): void

{

Box1. Math.Floor (Math.random) * myDivisor.length) / box2. Math.Floor (Math.random) * myDivider.leng th);

}

Please suggest ways to make this work.

German

var myDivisor:Array = new Array (3,6,9,12,15,18,21,24,27,30,23,89,90,1,34,56,78,99,345,456);
var myDivider:Array = new Array (1,3,6);
var divisor: int;
var divisor: int;

getNumbers();
function getNumbers() {}
divisor = getRandom (myDivisor);
divisor = getRandom (myDivider);
checkValues();
}
function getRandom(array:Array):int {}

var NombrAl = Math.floor (Math.random () * array.length);
return table [NombrAl];

}
function checkValues() {}
If (getRandom (myDivisor) > getRandom (myDivider)) {}
trace (getRandom (myDivisor));
trace (getRandom (myDivider));

} else {}
getNumbers();
}
}

Tags: Adobe Animate

Similar Questions

  • How to get the values separated by commas of multiple records in table

    How to get the values separated by commas of multiple records in table

    for example

    name address age sex
    a 12 m e
    b hh 12 f
    BB c 13 h

    I need to get output as a, b, c from a query

    Use the query as below he works for me, change the names of tables and columns

    SELECT SUBSTR (SYS_CONNECT_BY_PATH (PROXY_EMAIL, ','), 2) csv FROM (SELECT PROXY_EMAIL, ROW_NUMBER () ON the rn (ORDER OF PROXY_EMAIL), COUNT (*) NTC (STARS_PROXY_ASSIGNMENT) WHERE EMPLID = #EMPLID) WHERE rn = cnt START WITH rn = 1 CONNECT BY rn = rn + 1 ADVANCE

  • date max with multiple joins of tables

    Looking for expert advice on the use of max (date) with multiple joins of tables. Several people have tried (and failed) - HELP Please!

    The goal is to retrieve the most current joined line of NBRJOBS_EFFECTIVE_DATE for each unique NBRJOBS_PIDM. There are several lines by PIDM with various EFFECTIVE_DATEs. The following SQL returns about 1/3 of the files and there are also some multiples.

    The keys are PIDM, POSN and suff

    Select NBRJOBS. NBRJOBS.*,
    NBRBJOB. NBRBJOB.*
    of POSNCTL. Inner join of NBRBJOB NBRBJOB POSNCTL. NBRJOBS NBRJOBS on (NBRBJOB. NBRBJOB_PIDM = NBRJOBS. NBRJOBS_PIDM) and (NBRBJOB. NBRBJOB_POSN = NBRJOBS. NBRJOBS_POSN) and (NBRBJOB. NBRBJOB_SUFF = NBRJOBS. NBRJOBS_SUFF)
    where NBRJOBS. NBRJOBS_SUFF <>'LS '.
    and NBRBJOB. NBRBJOB_CONTRACT_TYPE = 'P '.
    and NBRJOBS. NBRJOBS_EFFECTIVE_DATE =
    (select Max (NBRJOBS1. NBRJOBS_EFFECTIVE_DATE) as 'EffectDate '.
    of POSNCTL. NBRJOBS NBRJOBS1
    where NBRJOBS1. NBRJOBS_PIDM = NBRJOBS. NBRJOBS_PIDM
    and NBRJOBS1. NBRJOBS_POSN = NBRJOBS. NBRJOBS_POSN
    and NBRJOBS1. NBRJOBS_SUFF = NBRJOBS. NBRJOBS_SUFF
    and NBRJOBS1. NBRJOBS_SUFF <>'LS '.
    and NBRJOBS1. NBRJOBS_EFFECTIVE_DATE < = to_date('2011/11/15','yy/mm/dd'))
    order of NBRJOBS. NBRJOBS_PIDM

    Welcome to the forum!

    We don't know what you are trying to do.
    You want all of the columns in the rows where NBRJOBS_EFFECTIVE_DATE is the date limit before a given date (November 15, 2011 in this example) for all rows in the result set with this NBRJOBS_PIDM? If so, here is one way:

    with         GOT_R_NUM     as
    (
         select       NBRJOBS.NBRJOBS.*,
                NBRBJOB.NBRBJOB.*     -- You may have to give aliases, so that every column has a unique name
         ,       rank () over ( partition by  NBRJOBS.NBRJOBS_PIDM
                                   order by      NBRJOBS.NBRJOBS_EFFECTIVE_DATE     desc
                          )             as R_NUM
         from          POSNCTL.NBRBJOB NBRBJOB
         inner join      POSNCTL.NBRJOBS NBRJOBS       on    (NBRBJOB.NBRBJOB_PIDM = NBRJOBS.NBRJOBS_PIDM)
                                            and      (NBRBJOB.NBRBJOB_POSN = NBRJOBS.NBRJOBS_POSN)
                                      and      (NBRBJOB.NBRBJOB_SUFF = NBRJOBS.NBRJOBS_SUFF)
         where       NBRJOBS.NBRJOBS_SUFF             != 'LS'       -- Is this what you meant?
         and        NBRBJOB.NBRBJOB_CONTRACT_TYPE   ='P'
         and       NBRJOBS.NBRJOBS_EFFECTIVE_DATE  <= to_date ('2011/11/15', 'yyyy/mm/dd')
    )
    select       *     -- Or list all columns except R_NUM
    from       GOT_R_NUM
    where       R_NUM          = 1
    order by  NBRJOBS_PIDM
    ;
    

    Normally this site does not display the <>inequality operator; He thinks it's some kind of beacon.
    Whenever you post on this site, use the other inequality operator (equivalent), *! = *.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT, only relevant columns instructions) for all the tables involved and the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.
    You will get better results faster if you always include this information whenever you have a problem.

  • How to have a dynamic number of tables where new rows can be added

    Hello
    I'm new to ADF and have a task where I on a single page should I show that a dynamic number of tables and each table below should show some fields and create a button to create new lines in the table. To be more precise each table show an education for the individual and the rows of the table shows the meanders of specific education.
    I thought to use a treetable but don't think it's the right way to go because of the new line add feature - I'm not sure of the combination of having a dynamic number of tables and the ability to create new lines of each table.
    If you know where I can find a model similar to the one above or just give me your opinion on how to solve it, it would be much appreciated.
    I get the data from a Web service.

    This is a small sample.
    It could be improved for more information.
    work for you?

    Class Education
    public class {education
    private string ID;
    description of the private channel;
    private list class ArrayList = new();
    Public Education() {}
    }

    {} public void setId (String id)
    This.ID = id;
    }

    public String getId() {}
    return the id;
    }

    {} public void setDescription (description of the chain)
    This.Description = description;
    }

    public String getDescription() {}
    return description;
    }

    public void setCourses (list of courses of ) {}
    This.courses = run;
    }

    public getCourses() {list
    return of the course;
    }
    }

    classroom

    public class {course
    private string ID;
    description of the private channel;
    teaching of teaching private;
    public Course() {}
    }

    {} public void setId (String id)
    This.ID = id;
    }

    public String getId() {}
    return the id;
    }

    {} public void setDescription (description of the chain)
    This.Description = description;
    }

    public String getDescription() {}
    return description;
    }

    {} public void setEducation (education)
    This.Education = education;
    }

    Public Education getEducation() {}
    return of education;
    }
    }
    Managed Bean

    public class {Manage
    private list of educations of ;
    selectedEducation of teaching private;
    selectedCourse of course private;

    public Manage() {}
    educations = new ArrayList ();
    for (int x = 1; x)<= 10="" ;="" x++="" )="">
    E education = new Education();
    e.setId(""+x);
    e.setDescription ("education" + x);
    for (int i = 1; i)< 3;="">
    Class c = new Course();
    c.setId (e.getId () +'.) » + i) ;
    c.setDescription (e.getDescription () +": courses"+ i);
    e.getCourses () .add (c);
    }
    This.Educations.Add (e);
    }

    }
    public String actionAdd() {}
    Add the code in the event here...
    TODO invoke the web service proxy to add courses
    Class c = new Course();
    c.setId (this.selectedEducation.getId () +'.) (' + (this.selectedEducation.getCourses () .size () + 1));
    c.setDescription (this.selectedEducation.getDescription () +": courses"(this.selectedEducation.getCourses () .size () + 1));
    this.selectedEducation.getCourses () .add (c);
    Returns a null value.
    }

    public String actionQuit() {}
    Add the code in the event here...
    TODO invoke the proxy web service to stop the course of education
    int index = this.selectedEducation.getCourses () .indexOf (this.selectedCourse);
    this.selectedEducation.getCourses () .remove (index);
    Returns a null value.
    }
    public void setEducations (list of educations ) {}
    This.Educations = educations;
    }

    public getEducations() {list
    TODO invoke the web service proxy to get educations
    return of the educations;
    }

    {} public void setSelectedEducation (selectedEducation education)
    this.selectedEducation = selectedEducation;
    }

    Public Education getSelectedEducation() {}
    Return selectedEducation;
    }

    {} public void setSelectedCourse (course selectedCourse)
    this.selectedCourse = selectedCourse;
    }

    public class getSelectedCourse() {}
    Return selectedCourse;
    }
    }

    JSPX



    xmlns:h = "http://java.sun.com/jsf/html".
    xmlns:f = "http://java.sun.com/jsf/core".
    xmlns:afh = "http://xmlns.oracle.com/adf/faces/html".
    xmlns:af = "http://xmlns.oracle.com/adf/faces" >

    DOCTYPE system = "http://www.w3.org/TR/html4/loose.dtd".
    doctype-public = ""-/ / W3C / / DTD HTML 4.01 Transitional / / IN "/ >"





    Content = text/html"; charset = windows-1252 "/ >"








    var value = "#{Education.courses}" = "course" rows = "5" "
    strips = "row" bandingInterval = "1" >












    to = "#{Manage.selectedEducation}" / >





    to = "#{Manage.selectedEducation}" / >

    to = "#{Manage.selectedCourse}" / >











    faces config xml


    "- //Sun Microsystems, Inc.//DTD JavaServer Faces 1.1 Config / / IN".
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd" >


    manage
    com.test.Manage
    session


    Oracle.ADF.Core

  • How can I get the 6 digit number to associate my watch.  It doesn't give me a 5-digit number?

    When I try to manually associate my watch it only gives me a 5 digit number, but not the number 6 to complete the pairing.  How can I get the 6 digit number?

    Hello

    When pairing manually, you must press the name of 5 digits on the screen of your iPhone (when he shows the same device name that is shown on your watch, after typed it on your watch's 'i'):

    Your watch then displays a six-digit code, you will then enter on your iPhone:

    More information:

    Set up your Apple Watch - Apple Support

  • How can I get the COMPLETE serial number to display? This number shows except for the 4 last digits.

    How can I get the COMPLETE serial number to display? This number shows except for the 4 last digits.

    Hi Infogoddess,

    Thank you for using communities Support from Apple! If you try to find the serial number of your iPod touch or another Apple product, you can find information and the steps in the following articles useful:

    iPod: how to find the serial number - Apple Support

    Find the serial number of your Apple - Apple Support product

    See you soon

  • When you try to update Windows XP, I get the message: error number: 0 x 80245001

    When you try to update Windows XP, I get the message: error number: 0 x 80245001

    Hello

    If you have configured the installation of the automatic update of your computer, the computer downloads the files necessary for the installation of Windows updates in the background and records them in certain folders on your computer. During installation, these downloaded files are extracted by the requirement by the services of update running on the computer.

    The error you are getting means that some of these extracted files required by Windows Update have been damaged. Now, in order to solve the problem better, we need more information about the computer that has the problem. José asked a few questions about this computer in the first reply to your message, it will be very useful if you could answer these questions.

    Here is some important information that we need:

    1. What is the level of service pack installed on your computer?
    (Click the Start button, click run, type winver, and press Enter to know that information)

    2. what update failed to install with this particular error code?
    (Please refer to the method 1: search for the installation error code in the Windows Update troubleshooting tool section of this article to learn how to check your update history to find this information)

    In the meantime, you can follow these steps on the computer and see if that helps:

    Note: These steps will give the files associated with Windows Update in your computer. Perform these steps would be clear Windows Update history on the computer.

    1. click on Start, click run , and then type Services.msc in the run box and press ENTER. This should open the windows of Services for you.

    2. then find the following three services in the list of Services and stop them (by clicking on it and click on stop) one by one:

    Automatic update service

    (BITS) Background Intelligent Transfer Service

    Cryptographic services

    3. open Windows Explorer and navigate to the following location:

    C:\Windows\

    Rename the folder C:\Windows\SoftwareDistribution in SoftwareDistribution.old

    4. go to the following location:

    C:\Windows\System32\

    Rename the Catroot2 in Catroot2.old folder

    (be careful here, do not rename the C:\windows\system32\catroot folder, you must rename the Catroot2 folder only)

    5. now go back to the Services window and start the services of three you had stopped earlier.

    Now, close all open windows, restart the computer and try updates and install them. If it fails again, please answer with the information that we requested.

    I hope that the information I provide here helps you. If you still need assistance, we know. We are happy to be of assistance.

  • I can't do widows update updates, I get this error error number: 0x8024400A.

    When I go to windows update I can't do updates I get this error error number: 0x8024400A.

    I can't use fixit until I can get the updates. When I download the net framework that I can get up to 2 sp 2 when you usually try 3 we net connect for 4 days now and I minimum these DOWNLOAD Center...

    Hello

    I suggest you try the steps from the following link:

    Temporary connection related errors may occur when you use Windows Update or Microsoft Update
    http://support.Microsoft.com/kb/836941

    Note: Microsoft does not recommend that you disable the antivirus protection in most conditions. Disable the antivirus protection that temporarily to restore a computer.

  • Whenever I try to update Windows I get this message; Error number: 0 x 80244004

    Please tell me how to solve this problem. Whenever I try to update Windows I get this message; [Error number: 0 x 80244004] The website has encountered a problem and cannot display the page you are trying to view. The options provided below may help you solve the problem.

    Original title: Please help me solve this problem I can no longer update Windows XP!

    The website has encountered a problem and cannot display the page you are trying to view.

    There is an MS article that lists some measures to this error message. Have a look at it and try the steps in there. It should help:

    http://support.Microsoft.com/kb/883614

  • How can I get rid of multiples (same thing listed 3 to 4 times) in my control panel "Classic view."

    When I go into my control panel "Classic view" things appear too often, just after, below, on the other (and I can not delete additional ones)

    Examples: "Accessibility Options" is listed FOUR times in a row.

    "Add Hardware" is mentioned THREE times

    Then "Add or Remove Programs" is listed TWICE

    Oddly, the following list is "Administrative Tools" and it appears only ONCE! (As it should be)

    The following list is "Automatic updates" and it is listed SIX times!

    Curiously once again, the following inscription "Data Sources" is only registered correctly, ONCE (as it should)

    Return to chaos, the following inscription "Date and time" appears FOUR TIMES

    And these strange, random, multiple registrations continue at the bottom of list 'Classic view' on my control panel.

    What should do?

    Hi Saratonin,

    -Did you of recent changes made to your computer before this problem?

    -Have you run an anti-virus program to check if it helps fix the problem? If not, run the same and check if it helps fix the problem.

    I would also recommend to start safe mode and check if the same behavior is noticed there too.

    Safe mode starts Windows with a limited set of files and drivers. Startup programs do not work in safe mode, and only the basic drivers needed to start Windows are installed.

    See this link for more information about starting in safe mode:

    A description of the options to start in Windows XP Mode

  • When you try to use windows update I get this error: error number: 0 x 80070424. In addition, automatic updates in Security Center is disabled, and I can't activate it.

    When you try to use windows update I get this error: error number: 0 x 80070424.  In addition, automatic updates in Security Center is disabled, and I can't activate it.

    Tre,

    A KB was created for the error code 0 x 80070424 that appears when you install Microsoft Windows Update/Microsoft Update. The KB includes an automated Microsoft Fix it 50686 that corrects the problem. Look at the following KB: http://support.microsoft.com/kb/968002>

    Suggest you download and save the fix it.

    Then close all open programs and browsers before running MS fix 50686.msi.

    `~`

    Suggest that you first spread malware as the cause of the problem by following these steps:

    (1) have your system scanned by the antivirus/security suite installed.
    (2) run this tool from Kaspersky: how to remove malware belonging to the family Rootkit.Win32.TDSS

    http://support.Kaspersky.com/viruses/solutions?QID=208280684>
    (3) download, install, update and run full scans with two of these tools free anti-malware:

    MalwareBytes AntiMalware

    http://www.Malwarebytes.org/products/malwarebytes_free>

    SUPERAntiSpyware

    http://SUPERAntiSpyware.com/superantispywarefreevspro.html>

    (4) run the Windows XP and Windows Server 2003 System File Checker (Sfc.exe) tool:

    http://support.Microsoft.com/kb/310747>

    `~`

    If no malware has been detected, there's a Fixit on this page which will reset the Windows Update components:

    How to reset Windows Update http://support.microsoft.com/kb/971058components >

    Suggest you download and Save it. Then, close all the open programs and web browsers.
    Run Microsoft Fixit 50202.msi and choose its default mode.
    After that he finished the race, see if the return code is displayed again when looking for updates.

    If not, then run the Fixit once more and choose his Aggressive mode.
    Restart once it is finished and see if the return code always appears when the updates.

    IF malware is detected, then please post if it has been removed and that the specific name of what has been detected.

    Please let us know if it did or did not help to solve your problem.

    If this ANSWER helped, my post as ANSWER of marking close your thread.

    06/26 / 1108:34:03

  • How to get the full phone number?

    I try to get the full phone number using the device.

    I + 1 807 1234567 number and copy the following code:

    Phone *phone = new Phone(this);
    QMap lines = phone->lines();
    foreach(Line line, lines)   {
        if(line.type()==LineType::Cellular)
            phoneAns = line.address();
    }
    

    Gets only 1234567.

    Could you help me, please?

    Thanks in advance

    There could be a problem with the way the SIM card has been implemented.  I would recommend give you carrier a call to see what they say.

  • Number of table gap

    RDBMS Version: 11.2.0.4

    OS: RHEL 6.6

    Total number of tables in this schema is 282. But, why East-County of user_segments.segment_type = 'TABLE' watch only 119? What is there such a difference?

    SQL > select count (*) from user_Tables;

    COUNT (*)

    ----------

    282

    SQL > select count (*) from user_objects where type_objet = "TABLE";

    COUNT (*)

    ----------

    282

    SQL >

    SQL > select count (*) from WHERE user_segments where segment_type = 'TABLE ';

    COUNT (*)

    ----------

    119

    -Various types of objects in this diagram and the number

    SQL > select segment_type, count (*) group WHERE user_segments by order segment_type of count (*) desc;

    SEGMENT_TYPE COUNT (*)

    ------------------ ----------

    INDEX 158

    TABLE                     119

    66 INDEX PARTITION

    LOBSEGMENT 33

    33 TABLE PARTITION

    LOBINDEX 33

    LOB PARTITION 33

    7 selected lines.

    Empty tables with delayed segment usually have a row in user_segments WHERE

  • Can we restrict the number of table rows to display on a page that is only 2 or 3 rows appear? How to do this?

    Mr President.

    Can we restrict the number of table rows to display on a page that is only 2 or 3 rows appear? How to do this?

    Concerning

    Tender,

    Set the RangeSize property on the table.

    See you soon

    AJ

  • my hard drive crashed and I am trying to re - install acrobat pro XI but I get an incorrect serial number

    my hard drive crashed and I am trying to re - install acrobat pro XI but I get an incorrect serial number

    Hi dalw30232244 ,

    Please refer to this article:- error: "serial number is not valid for this product". Adobe Creative Suite

    Let me know how it goes.

    Kind regards

    Christian

Maybe you are looking for

  • Toshiba Service Station v2.6.13 vs MSI Wizard Toshiba Service

    Is - better Toshiba Service Station towards. 2.6.13 or MSI Wizard Toshiba Service Station last updated on 02.26.2015?Also why, if I remove the first in favour of the second, it will be impossible to put it back in the future?

  • Tecra M4: Known issues with the display of graphical interfaces user written in Java?

    Hello I am developing software in Java which will run on the M4 model and have acquired a M4 to test the application. In fact, my GUI looks good when the monitor is in a normal "standing" position. However, when I fold the monitor down and transform

  • HP Officejet 6500 has more E710n: HP Officejet 6500 has more E710n

    Hello world If have just updated from Windows 7 to Windows 10 and are now facing problems of scanning. During the scanning of the computer, the ADF (ADF) don't market work. When the printer scanning the ADF works fine. The printer/scanner is connecte

  • Why I constantly get a message that says... "Stop running this script?"

    I constantly get a pop of message asking me if I want to "stop running this script"... a script on this page slows down Internet Explorer runs slowly. It happens on Facebook, no matter what I do, be it games or on the FB homepage.

  • HP Officejet 6300

    Three installation disks using the Vista one when the first bought printer. Now the Vista went to the case of the computer and I would like to use the printer with laptop computer which is Windows 7 64 bit. Can I use the Windows 2000, XP disk, the di