Avoid Math.Random () of closure of twice the same number?

I'm playing a random image gallary by stops to image different every few seconds, and the stock is completely random.

The problem is, since it has only 5 different images (5 images), I display, there is a high probability that remains to the same frame, how to avoid that? As to avoid staying in the same page twice, if it's not run the new service...?

//////////////////////////////////////////////////////

setInterval (createItems, throwItems);

var RandomImg:randomImg = new randomImg();

RandomImg.y = 100;

RandomImg.x = 180;

RandomImg.gotoAndStop (Math.floor (Math.random () *(1+5-1)) + 1); generate random value between 1 and 5

addChild (RandomImg);

//////////////////////////////////////////////////////

Thank you

You compare the random value with the current value in your if.  Keep your selection of random frame as a separate function that you can call when you need a new random value... as in...

var preValue: uint;
var randomFrame:uint;

function setRandomValue (): void {}
randomFrame = Math.floor (Math.random () * 5) + 1;
}

function createItems (): void
{

while(preValue == randomFrame)
{
setRandomValue();
}

preValue = randomFrame;

var RandomImg:randomImg = new randomImg();

RandomImg.y = 100;

RandomImg.x = 180;
RandomImg.gotoAndStop (randomFrame);
addChild (RandomImg);
}

Tags: Adobe Animate

Similar Questions

  • How to export data to excel that has 2 tables with the same number of columns and the column names?

    Hi everyone, yet once landed upward with a problem.

    After trying many things to myself, finally decided to post here...

    I created a form in form builder 6i in which clicking on a button, the data gets exported to the excel sheet.

    It works very well with a single table. The problem now is that I cannot do the same with 2 tables.

    Because the tables have the same number of columns and the columns names.

    Here are the 2 tables with column names:

    Table-1 (MONTHLY_PART_1) Table-2 (MONTHLY_PART_2)
    SL_NOSL_NO
    MODELMODEL
    END_DATEEND_DATE
    U-1U-1
    U-2U-2
    U-4U-4
    ..................
    ..................
    U-20U-20
    U-25U-25

    Given that the tables have the same column names, I get the following error :

    402 error at line 103, column 4

    required aliases in the SELECT list of the slider to avoid duplicate column names.

    So how to export data to excel that has 2 tables with the same number of columns and the column names?

    Should I paste the code? Should I publish this query in 'SQL and PL/SQL ' Forum?

    Help me with this please.

    Thank you.

    Wait a second... is this a kind of House of partitioning? Shouldn't it is a union of two tables instead a join?

    see you soon

  • I forgot my password for apple and have permission to stage the 2 and broken my old phone and do not have the same number of what I can do my account is already waiting to be reset, but it takes apple long to to deal with the what else is there to do?

    I forgot my password for apple and have permission to stage the 2 and broken my old phone and do not have the same number of what I can do my account is already waiting to be reset, but it takes apple long to to deal with the what else is there to do?

    You know the e-mail password what do you use? I lost over $ 30 on my old Apple ID because I couldn't get into the email and apple would not transfer my money to my new account.

  • Why on SIM Manager is showing the same number of SIM 1 and SIM 2?

    I recently purchased Intex FX Cloud and inserted two different operator SIM cards. But the phone showing the same number (SIM 2) for both SIMS (SIM 1 and SIM 2). I have already reset the device, but that did not help. I would like to know how to fix this?

    Figured it out. It was show stored number as has number of SIM (first entry). Some device costs < 3.

  • Copy from HDD to disc results external hard of different sizes but the same number of records

    Backup hard drive to external drive, 800 GB in total. When finished copying the file on the external drive size is smaller than 40 GB, but there is the same number of records.

    Different disks often present of thisdue fragmentation on each disk and the differences in the block sizes used on each disc. As long as all your data are present then there is no need to worry.

  • When you use Excel or my Peachtree Accounting program, entered digital as "$152(32 in the accounting package or the same number with a square symbol as the decimal point in Excel.)". No idea what I should check first?

    When you use Excel or my Peachtree Accounting program, entered digital as "$152(32 in the accounting package or the same number with a square symbol as the decimal point in Excel.)".  No idea what I should check first?

    Thank you for visiting the website of Microsoft Windows Vista Community. The question you have posted is related to Office Excel and would be better suited to the office community. Please visit the link below to find a community that will support what ask you

    http://www.Microsoft.com/Office/Community/en-us/default.mspx?d=1

    Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • BlackBerry smartphone how to separate the same number of son tex

    My daughter is using my BB to the text of his father. I also have text him and instead she would not see the discussions.

    How can we have 2 separate conversations going at the same number?

    There is unfortunately no way to do it.  When you use text messaging, it combines messages from phone numbers, no name, so as long as the messages are the same phone number, there is nothing that can be done.

    If your husband has a BlackBerry, consider using BBM talk about yourself and let the texts for your daughter, or if there is a smartphone from another brand (Android or iPhone), consider using a separate messaging service as WhatsApp, PingChat.  Like this, you will have two separate ways to communicate with your husband.

  • My old laptop is dying. When I tried to install Photoshop elements 7 on my new laptop, he told me that the serial number is not valid. It's the same number that I used before. What gives?

    My old laptop is dying. When I tried to install Photoshop elements 7 on my new laptop, he told me that the serial number is not valid. It's the same number that I used before. What gives

    I think that this program is covered in the link below

    CS2 (or earlier version) activation server has disappeared, then read below

    You MUST use the special version and the serial number on the page, not your original drive or serial number

    l http://helpx.adobe.com/x-productkb/Policy-Pricing/Creative-Suite-2-activation-end-Life.htm

    NOTE that CS2 will not install on a Mac "modern", and when you install the special version of the PPro2 on a Win7 or Win8 or Win10 computer, you may need to right click on the program icon and select Windows XP compatibility in the popup of option

  • I had a problem with my Mac, and I have to reinstall Adobe Photoshop CS4, I have on a CD. I put the serial number I have on the cover, it takes it. another window opens and ask for the serial number. again, I put the same number and he said to me: not val

    I had a problem with my Mac, and I have to reinstall Adobe Photoshop CS4, I have on a CD. I put the serial number I have on the cover, it takes it. another window opens and ask for the serial number. again, I put the same number and it says: invalid.

    where will be the second serial number?

    Help me please.

    Thanks, Abe

    Hi,

    Please see error "serial number is not valid for this product". Creative Suite and serial number incorrect error

    Kind regards

    Sheena

  • Windows live mails in double - one of my accounts that I use on Windows Live Mail will receive twice the same email

    When I opened my laptop (always on), windows live mail will automatically connect and checks for new messages. I have 3 email accounts, but one of them receives the same e-mail twice. I contacted my ISP provider and was informed that the messages I get are only on the server once and that Windows Live Mail is the cause. I looked at the settings and therefore has a technician from my ISP and do not see why this is happening. Can anyone offer assistance.

    @Maksteel

    For beginners... Disable the following in the "Général" tab of Windows Live Mail (WLM) options

    1. to access the general tab--> WLM 2011/2012(Alt F O M) or WLM 2009 (Alt T O)

    -Send and receive messages at startup

    -Search for new messages every minute (s) ' x'

    2. make sure that the account receive duplicate emails is not configured to leave a message on the server (default of WLM is to "leave a message on the server)

    3. continue to use WLM by send and receive in manual mode, if no duplicates re-enable each item one time and repeat the test for the cause.

    If reconfiguration is not working... Post your question in the forum of answers from Microsoft Mail and make sure that you include the type of e-mail account (Pop3, IMAP, Http) with the double problem.  Note: If IMAP double-check your configuration in your web account interface. FYI... recommended are the WLM versions for each operating system: XP (2009), Vista (2011), Windows 7/Windows 8 (2012)

    .. .Winston
    MSFT MVP consumer Apps

  • Two different iPhones to receive calls from the same number at the same time

    Hello.

    Latelly I receive missed calls from my own number when I call my wife. She also when she calls me. Today, my father called me and at the same time my wife's iPhone rang too! We use different carriers! How is it possible? We use the same Apple ID to iCloud and applications.

    Today, I received a third sim iPhone and pitch. The problem is the same. What should I do?

    You must stop using the same appleID what you're feeling is normal if you have a mac or iPad, they would be too ring

    you're the appleID if you and your wife will also get the same iMessages and you will not be able to facetime mutually

    You can always share applications and tastes using family sharing read more implemented the family share - Apple Support

  • 'Photos' and 'pictures' do not contain the same number of photos.  What is going on?

    My library 'photos' unless photos my album 'pictures' in it (11 308) (11 863).  -What happened?  I thought they were supposed to be 2 ways to display a single library.  I try, in vain, to organize the photos in a way that makes sense for my family (I frequently experience problems with apple products are not designed with multiple users in the same family spirit), and need to start with the entire collection of photos.  Clearly, "all photos" contains more photos, but according to the hierarchy, "all photos" should not be the top category.  I thought 'photos' and 'pictures' saw the same library in two ways (photo taken compared to what photo added to the library).  Thank you for your help.

    Several possibilities

    hidden photos show in pictures but no pictures - you have pictures in your hidden folder?

    a damaged library can cause this - you can repair the library (save the library and then press and hold the option and command launching photos - what causes a comparison of the library to rebuild to iCloud library is you use it)

    LN

  • My Dungeon freecell offering the same number consistantly

    When I start a game, the same cards appear

    Try:

    1. click on Start (lower-left) and then on Control Panel.

    2. click on programs and features.

    3. on the left side of the screen, click on 'Windows turn features on or off".

    4 look for the entry called games & uncheck the box in the box next to it.

    5. click on OK.

    6 reset.

    7. click on Start (lower-left) and then on Control Panel.

    8. click on programs and features.

    9. on the left side of the screen, click on 'Windows turn features on or off".

    10 find the entry called games & tick in the box next to it.

    11. click on OK.

    12 reset.

    In addition, the problem persists if you run FreeCell from another user account.

  • HELP - a clip has been replaced by another of the same number

    Hello

    A project is opened and I was searching for clips via the media browser. I clicked open an item in the source window and somehow, it replaced the element in the project. I do not know what information I should post so that you work out what I mean.

    The original project item was Clip0009.MXF and I merge with audio separated. I created the sequence in the timeline panel and made a massive change.

    Then I went to research, via the media browser for a cut on clip I've done another day. I opened it in the source window to have a quick glance (as my recordings of the camera. MXF files so I can't view them outside of the Prime Minister as you can the .mp4 clips) the clip I opened turns the same incised number Clip0009.MXF (recorded on another day) as the main element in project management. Unfortunately this camera starts from 000 each time I format the SD card.

    Some how the cutaway clip replaced the original clip in the timeline panel and I can't seem to be able to reverse the trend. Now, my project is slowed down after working hours. Norbert here, someone has any ideas bright.

    Any ideas would be greatly appreciated!     There is no available Premier Pro consultants for help. THEY ARE CLOSED not happy Grrrrr thereon.

    Thank you!

    The screen shot below shows where the original clip was replaced by the ring in the clip of Cup. The second shot I imported the original Clip0009 with the ute Tough Dog inside to show you the original with different screen for the cutting of ute white.

    Screen Shot 2016-09-24 at 8.26.16 PM.png

    Screen Shot 2016-09-24 at 8.28.26 PM.png

    Name change does nothing for the clip. So a rename/copy-to-here right do anything else than the copy in a directory and rename the files as shown in your preset.

    Transcoding pourrait ... but then, for ease of Assembly and all some of us are sometimes transcode to a "digital intermediate" quality codec (di). Which can actually be used for anything these days.

    Like Cineform YUV which is a 10-bit codec (your media is probably only 8, so that part is a bit exaggerated side) and is quite low on compression. The files are a bit a bit bigger than the camera stand normally, the quality is excellent. And as Jim Simon, another user here, says "this codec changes like butter through the CPU".

    Or say, DNxHD/R. choose a "flavor" which is the same-size/rate your media in a form of HQ and you will have everything your heart could desire in quality. In addition, he rereads and Cineform. You can now use the MXF wrapper for them in PrPro.

    Neil

  • Cloud does not display the same number of applications on different computers

    I have two computers. A Windows 7 64 bit desktop and laptop Windows XP 32-bit. After scoring in Adobe Creative on my desktop and laptop, I see different numbers of apps. On my desk, I have access to a wide range of applications (screenshot: http://i.imgur.com/IoFsVY7.png ). On my laptop, I have access to a fewer number of apps (screenshot: http://i.imgur.com/5CAegdD.png ). The application I am trying to install on my laptop is Creative Connection of cloud. While this application is available on my desktop, it does not appear on my laptop. I use the same account of creative cloud on both computers. Can someone help me with this?

    Changing the configuration required for the various applications in the Cloud and applications available for download depend on your hardware and the operating system.

    Well spec'd 64-bit (Windows and Mac) systems will run all the apps. Other configurations vary by app.

    Some applications of Cloud (Premiere Pro, After Effects, still and SpeedGrade) are 64-bit only. They will not install or run on 32-bit computers, so they will not appear on a 32-bit system as available for download.

    http://www.Adobe.com/products/creativecloud/tech-specs.html#requirements

    Other applications such as Lightroom and Cloud connection not install or run on Windows XP, so they will not appear as available for download.

    http://helpx.Adobe.com/creative-cloud/KB/creative-cloud-connection-FAQ.html#id_34776

Maybe you are looking for

  • you have a problem with the Access screen reader

    I went to the creation, there was a developer option after clicking on the place where there is another switch called accessibility screen reader. as soon as I clicked my touchscreen phone got locked.I do not understand how to open it.Help, please

  • using the usb key in veristand

    Hello Use Embedded data logger custom peripheral in veristand we could record data to the tdms file format located in the "c:\logs" on RT PXI. If I want to access this file, I am the pxi start in windows and then I could only access the file for anal

  • Profile of Vision Builder AI 2011 online

    Hello I try to get the line profile to grayscale (0-255) for a circle of light. But I could not find a fuction can do on VBAI, closeset function I can get is to "Measure the intensity" measure the intensity of a region that is useless to me. And then

  • I can't open my Big Fish Games due to the drmactivator error Manager does not, how can I fix?

    The drmactivator responds not window opens and says that they have no solution but will notify me if they do. Tried to reactivate after I googled drmactivator does not and follow-up instructions, but still does not.

  • WiFi adapter intel centrino n1030

    Hello my laptop is HP PAVILION DV6 - 6B11EV.when, I'm upgrading to win 7 to win 10 adapter wirelless not working.and of the Intel Download Center has drivers only for win 7,8,8.1 what to do? waiting for response from HP? I m waiting for an answer.tha