How to exclude the framework when randomization

Hi, I create a 'make your own' style game that contains a button to randomize. I have this code attached to the first keyframe of the clip for the moment:

MovieClip (parent).random_mc.buttonMode = true;

MovieClip (parent).random_mc.addEventListener (MouseEvent.CLICK, randomMouths);

function randomMouths(event:MouseEvent):void {}

Visible = true;

var pic_number: number = 16;

var randomFrame: number = Math.ceil (Math.random () * pic_number);

gotoAndStop (randomFrame);

}

However, I would like to exclude the first image that it is just the empty image by default. Is this possible? Thanks in advance.

Thanks for the help, unfortunately now is ONLY to show the empty frame with no other frames being randomized!

EDIT: PEEM! Just realized the obvious solution - exchanged around the end of statements that you gave and it worked! Thank you very much.

In case anyone is interested, here is the final code - I had to put in a parenthesis at the end.

MovieClip (parent).random_mc.buttonMode = true;

MovieClip (parent).random_mc.addEventListener (MouseEvent.CLICK, randomMouths);

function randomMouths(event:MouseEvent):void {}

Visible = true;

var pic_number: number = 16;

var randomFrame: number = randomF(2,pic_number);

gotoAndStop (randomFrame);

}

function randomF(n1:int,n2:int):int {}

If (n1<>

Returns - 1;

} else {}

Return n1 + Math.floor ((n2-n1+1) * Math.random ());

}

}

Post edited by: iPixelen

Tags: Adobe Animate

Similar Questions

  • How to exclude the missing files or library locations that are on a network backup and restore of Windows 7 Professional drive

    How to exclude the missing files or library locations that are on a network backup and restore of Windows 7 Professional drive. To give you more information, I have photos stored on a network drive to the following address: Wirelessspace\LaCie\MyPhotoGallery\Family. This folder is a location of library under the images. Because this folder is on a network drive backup backup not file Wizard.

    In addition, the following file locations is not found because they no longer exist. So why the backup wizard continues to look for and how to remove the backup set? I guess the error code following each line means simply that records cannot be found. Is this correct?

    Backup has encountered a problem during backup of the C:\Windows\System32\config\systemprofile\Searches\Google file. Error: (the system cannot find the specified file. (0 x 80070002))
    Backup has encountered a problem during backup of the C:\Windows\System32\config\systemprofile\SyncUP file. Error: (the system cannot find the specified file. (0 x 80070002))
    Backup has encountered a problem during backup of the C:\Windows\System32\config\systemprofile\Podcasts file. Error: (the system cannot find the specified file. (0 x 80070002))

    Hello

    I suggest you to follow the steps in the article below and check if it helps.

    Error code 0 x 80070002 when you back up files in Windows 7: http://support.microsoft.com/kb/979281

    Hope this information is useful.

  • My Dungeon AT100 flashing (gel) / how to enlarge the fonts when browsing

    I tried to disable my Tablet (AT100), but he keep re-reading as 'opening line of light sparkles' and then a 'flash '. He continues by doing this.

    I tried to turn if off, but I can't.

    I tried to recharge the battery, but there is nothing to change.

    I had to wait for these to be repeated until all batteries are brains.

    Why would this happen? What's wrong?

    What can I do, when this happen? Reboot? but I can't find those restart button (as these mini button that allows you to push a pencil point)

    ~*~*~*~*~*~*~*~*~*~*~*~
    How to enlarge the fonts when I'm surfing the internet?

    Thank you.

    Post edited by: ec

    Hello

    I think the sparks of light line is a background image possibly the Android system crashed I think you should start in safe mode.
    How?

    1. press the power button and quickly press and hold the Volume button down.
    2. continue to press the Volume button down until you enter secure Mode

    Now you can perform factory reset data as below:
    Tap applications > settings > privacy > data reset > Reset tablet > clear all.
    Factory data collection will be

  • How to set the title when using InvokeManager (MediaPlayer)

    Hi Im using InvokeManager to play the video file (Media Player)

    How to change the title when media player to play the video (above)-> it by default uses the name of the file being played

    but I want to change this

    How to do this?

    Thank you

    Try this

    InvokeManager * invokeManager = new InvokeManager();
    InvokeRequest cardRequest;
    cardRequest.setTarget ("sys.mediaplayer.previewer");
    cardRequest.setAction ("bb.action.OPEN");
    cardRequest.setUri ("* video url *");
                QVariantMap map;
    Map.Insert ("contentTitle", "My title");
    QByteArray requestData = bb:psObject::encode (map, NULL);
    cardRequest.setData (requestData);
    Response InvokeTargetReply * = invokeManager-> invoke (cardRequest);

    Note: Mark your post as solved, if this solves your problem

  • does anyone know how to number the photos when they are exported so someone can choose the peak of number

    Anyone know how to number the photos when they are exported from LR, so someone can choose the photo they like with a number

    Sorry took with the last answer.

    More simple form used something like-Sequence_Filename number suffix

    If an image as _ABC0987.nef will become 0001_0987.nef and 0002_0988.nef, etc.

    Ask your customer to give you the full file name. The suffix indicates the original file.

    (I hope that you only need to search in a folder and do not have a bunch of images named the same that would cause problems!)

  • How to display the ToolTip when the input text is disable

    How to display the ToolTip when the input text is disable?

    Just checked in FF and IE11, works fine for me (jdev 12.1.3)

    
          
    
    

    Dario

  • How to generate the alert when pageitem move on the page? and what class boss be use to move pageitem

    How to generate the alert when pageitem move on the page? and what class boss be use to move pageitem

    Hi Philippe,.

    You can see the kDocBoss for the ClassID with the PMIID IID_ITRANSFORM_DOCUMENT kLocationChangedMessage.

    Markus

  • Anyone know how to solve the problem, when he says scratch disk is full?

    Anyone know how to solve the problem, when he says scratch disk is full? don't do anything :/

    Go to Edition > purge > all

    This will clear all of your history and Clipboard, thus freeing the scratch disk space.

  • How to exclude the field of persistent object

    Hello

    Is it possible to substitute the PersistanceStore method to persist objects?

    I have a complex data structure I need to store. One of the internal classes contain no persistent field. When I'm storing the data I don't no need to store this field, but the compiler triggers error.

    ... Widget: error! : class... Persistable marked widget by interface:... Persistable is not persistent: _field field: class... Field does not implement net.rim.vm.Persistable

    Is the way to override the implementation of this class persitant and exclude the problematic areas?

    Thanks for the reply.

    I did something similar, I created a class of data for persistence and a class of execution with additional fields.

    It's not very practical, these classes are deep into a tree of complex data, but I guess that's how it should work with BlackBerry.

  • Error!  Totals included in the genre.  How to exclude the totals?

    Hello.

    I have a synthesis report including totals in the sort.  How can I exclude the total of the sort?

    Here is my code:

    < code >

    Select nvl (to_char (vendor),'Totals:')

    the name of the seller,

    po_number,

    contract_number,

    po_amount,

    inv_total,

    Cast (round (case when po_amount = 0 then 0 nvl(inv_total/po_amount,0) to another end, 2) * 100 as varchar (10)). « % »

    Of

    (

    Select

    the name of the seller,

    po_number,

    contract_number,

    Sum (NVL(po_amount,0)) po_amount,

    Sum (NVL(inv_total,0)) inv_total

    Of

    (

    Select b.vendor,

    b.po_number,

    b.WBS,

    b.contract_number,

    b.po_amount,

    a.inv_total

    de)

    Select

    po_number,

    WBS,

    sum (inv_total) inv_total

    Of

    invoice, invoice_details, project

    where invoice.inv_id = invoice_details.inv_id

    and substr (invoice_details.wbs, 1, 6) = project.wbs_sequence

    and project.project_number = nvl(:F101_FPC_NUMBER,project.project_number)

    Po_number, wbs) a.

    (

    Select provider, wbs, contract_number, po_number, po_amount sum (po_amount)

    po, po_details, project

    where po.po_id = po_details.po_id

    and substr (po_details.wbs, 1, 6) = project.wbs_sequence

    and project.project_number = nvl(:F101_FPC_NUMBER,project.project_number)

    b group of seller, po_number, contract_number, wbs)

    where = b.po_number a.po_number (+)

    and a.wbs (+) = b.wbs)

    Group of grouping sets (())

    the name of the seller,

    po_number,

    WBS,

    contract_number)))

    order by (round (case when po_amount = 0 then 0 nvl(inv_total/po_amount,0) to another end, 2)) * 100 / / desc

    < code >

    As you can see, the SQL is quite complicated.  I need to find a way to keep the 'TOTAL' of the kind.

    Any ideas?

    Thank you in advance!

    Just a crazy hunch... change your first line to this:

    Select provider nvl (to_char (vendor),'Totals:');

    To do this:

    Select nvl (to_char (vendor),'Totals:') vendor_t,.

    See what it does

  • How to choose the poster when exporting to video frame?

    CS6 PP

    I can't find how to select the image that I want to appear as the image poster in the exported video.

    I can choose what I can change one by right clicking a video imported OK, but not the sequence!

    I went through all the menus I can find and even training Lynda.com!

    I'm sure there must be a way, but I am blown away, if I can find it!

    There are two common meanings for the term "poster frame":

    1. A stand-alone image on disk (JPG, etc.) that is displayed by a player before the video is loaded - commonly used by applications of video sites (YouTube, etc), InDesign and PDF, etc files then the video resource must not be opened so that viewers see what they are about to watch - even if the image is normally enjoy the video should not be.
    2. An image resource built into the XMP/ID3 data of a video or audio file that can sometimes be shown in the player, but is normally set as he appears as the thumbnail image when you view the files in the Finder or Windows Explorer. There is no part of the content stream, it is in the header of the file. In the MP3 files, it is used to store album art.

    You can create stand-alone PP JPEG images using the icon of camera under the monitor and can semi-automate presets to export a still image alongside your video using Adobe Media Encoder, but there no option in PP (or via Adobe Media Encoder) to specify the image displays embedded in a multimedia rendered file. Several third-party applications can do, either during rendering (compressor / Squeeze) or after the fact (Quicktime Pro), but support for these embedded resources depends on the wrapper for the video file.

    The ability to define a "poster frame" in the PP clip bins, it is only there to help you organize your resources to project visually - for example if the imported film begins black, or if you want to choose a framework where the slate is visible-, but your choice has no effect on sequences to export and is not written back to the original film.

  • How to exclude the songs, didn't like in a smart playlist

    How exclude the songs didn't like in a smart playlist.

    Note the songs that you don't like as 1 Star then add side is not 1 star smart selection criteria.

  • On Apple Watch, how to change the time when traveling to a different country, like London or Singapore?

    For Apple Watch, can someone please show me how to change the time on my watch when I travel to another country, like London or Singapore? Thank you.

    Hello

    When traveling to a different time zone, it is not necessary to manually change the time on Apple Watch.

    After turning off the flight on each of your iPhone and Apple Watch, the time on your watch can be updated automatically to reflect the local time.

    If it is not the case, try restarting your watch:

    -To switch off your watch: press and hold the button side until you see the cursor off the power; slide it to turn off.

    -To reactivate: press and hold the side button until you see the Apple logo.

  • M2000 microcassette Transcriber - how to erase the tape when I'm done with the dictation?

    How clear the tape when I'm done with the dictation?

    Hi Carol! Unfortunately, this is the only way to erase the recordings on the Recorder's tape Micro M2000.

    If my post answered your question, please mark it as "accept as a Solution.

    http://bit.LY/win-4k

  • How to get the event when we change our simcard in BB device

    Hi all

    Please, someone tell how to get the event or any listener method that can automatically called when we change our SIM card device.

    Thanks in advance,

    TEJ

    Hi Tej,

    I came across some post, which may be useful for you

    http://supportforums.BlackBerry.com/T5/Java-development/is-there-a-way-to-get-the-mobile-or-phone-nu...

    http://supportforums.BlackBerry.com/T5/Java-development/is-SIM-ID-really-exist/m-p/54407#M5954

Maybe you are looking for