Why do some images disappear in AS3?

There are 17 symbols has my project. Each symbol contains an image. It's displaying required 9 random images and mix. symbols are named: p1, p2, p3 and so on... The project works properly, but only one or two images disappears from the 9 random images!

I can't find the reason? Would you help me, please? Thanks in advance,

This short images has 3 (CTRL + Enter) my project.

tests.jpg

Here is my code:

Stop();

var i: int; i = 0;

var PIC: Array = [9];

var c: int;

do

{

PIC [i] = randomRange (1: 17);

for (c = 1; c < i; c ++) / / the 'loop' for prevents resuming designs

{

If ([i] peak is peak [i - c])

{

PIC [i] = randomRange (1: 17);

trace ("repeated pic:", c)

c-- ;

}

}

rearranging some picturs using nine conditions 'if ':

If (i == 0)

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' + photo [i]] .x = 100;

This ['p' plus photo [i]] there is 75;

trace (i);

}

If (I == 1)

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' photo [i]] .x plus 280;

This ['p' plus photo [i]] there is 75;

trace (i);

}

If (I == 2).

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' photo [i]] .x plus 460;

This ['p' plus photo [i]] there is 75;

trace (i);

}

If (I == 3) / / new line

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' + photo [i]] .x = 100;

This ['p' plus photo [i]] there is 255;

trace (i);

}

If (I == 4)

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' photo [i]] .x plus 280;

This ['p' plus photo [i]] there is 255;

trace (i);

}

If (I == 5)

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' photo [i]] .x plus 460;

This ['p' plus photo [i]] there is 255;

trace (i);

}

If (I == 6) / / new line

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' + photo [i]] .x = 100;

This ['p' plus photo [i]] there is 435;

trace (i);

}

If (I == 7)

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' photo [i]] .x plus 280;

This ['p' plus photo [i]] there is 435;

trace (i);

}

If (I == 8)

{

This ['p' photo [i]] .width plus 175;

This ['p' photo [i]] .height plus 175;

This ['p' photo [i]] .x plus 460;

This ['p' plus photo [i]] there is 435;

trace (i);

}

trace (ISB);

i ++ ;

}

While (I < 9)

function randomRange(minNum:Number,_maxNum:Number):Number / / this function generates a random number

{

return (Math.floor (Math.random () * (maxNum - minNum + 1)) + minNum);

}

Here is another way to organize the symbols:

var column:Number = 3;
var i:uint;
var list:Array = [];
var pic:Array = [];
stop();

for(var p:uint=1; p<=17; p++)
{
    list.push(this.getChildByName("p" + p))
}

shuffle(list);
pic = list.splice(0,9);

for(i = 0; i < pic.length; i++ ) // Arrange the symbols
{
    pic[i].width = 175;
    pic[i].height = 175;
    pic[i].x = 100 + Math.floor( i % column ) * 185; // the pic width + 10 as space
    pic[i].y = 100 + Math.floor( i / column  ) * 185;
}

function shuffle(a:Array) {
    var p:int;
    var t:*;
    var ivar:int;
    for (ivar = a.length-1; ivar>=0; ivar--) {
        p=Math.floor((ivar+1)*Math.random());
        t = a[ivar];
        a[ivar] = a[p];
        a[p] = t;
    }
}

Tags: Adobe Animate

Similar Questions

  • Why keep my images disappear?

    Acrobat 9.3, LiveCycle Designer 8.2, Win XP.

    When I create a form in LS and use the 'Image' (not the image field) object function, insert the image and save the form.  I have then open the document in Acrobat 9.3 and extend the functionality.  The image remains in the document and seems perfectly fine.

    However, when I reopen the document in LS (and get the standard message of deactivation of extended features), all of a sudden the picture is gone; Instead, I see is a gray "broken object" sign in its place.  If I save the document while in this State, the image no longer appears in the document, and I have to re - insert the image again if I want to see it.  I'm inserting standard JPEG files.

    Is there some sort of setting that I need to change, or format of different image that I use, so that the image stays with the document?  It is very annoying.

    You choose the option to incorporate image data?

    Paul

  • Why/where the images disappear when I click P to mark?

    Hi guys,.

    Don't know what was going on.

    Thank you

    Raphael

    It is possible that you have a filter attribute application that shows only photos that are not reported?

    With this central indicator switched on you will see photos 'unmarked '. The result: press [P] and they disappear.

    Click [no] to cancel all filters.

  • Why my image disappears when I place

    I have no idea whats going on, but when I import an image and then put, she disappears. Help, please.

    I found the problem. For some unknown reason, some images disappear, but what I understand is that if you try to force quit photoshop, it will ask to place your picture, place and then everything just cancel and not close the program completely. Its importation through the directory file does not much...

  • Why do some of my edits in LR disappear?

    I suspect that they may be always there one of the oldest catalogs.  But passing by them would be very tedious.  Does anyone have another solution?

    Also, I'm afraid of what might happen to my newest catalog when I do this kind of research.  When I click on LR to open next time, it will automatically return to the new catalog?

    What is the location of the default catalog that appears when I click on LR on my computer?

    I heard that the removal of old catalogues is something I should do, but I tried once and I lost some images!  Suggestions on this would be appreciated.  Right now I have a long column of catalog backups!

    Thanks for any help you can give.

    Hi nothinglikeit,

    Greetings.

    • The subject of the questions is "why do some of my edits in LR disappear?

      • could you please let us know what changes are you making?
    • While pressing alt (windows) / option (mac) key open LR
    • A small window will appear in which you can click on "always load the catalog on startup".
    • You can get rid of most of the old catalogues, but before do you that they do not have something that you might need in the future.
    • You can remove most of the backup catalogs and just keep a couple of them, the most recent.

    Default location for a catalog is the images folder.

    • "Photo - Lightroom.

    Concerning

    Rohit

  • some images (JPEG format) do not show in Design view, but show in live mode, any ideas why? Thank you

    some images (JPEG format) do not show in Design view, but show in live mode, any ideas why? Thank you

    Work within a site defined in DW?

    All images cropped and size?

    Are all the images for the Web as optimized JPG?

    All images are saved in your folder of Site Local DW?

    Nancy O.

  • Why a grouped image does not disappear when I dissociate it?

    Why a grouped image does not disappear when I dissociate it?

    There is a bug in the new parameter to separate layers remembers and it gives objects ungrouped on original.

  • In Premiere Pro CC 2014, the image disappears when I apply a mask of an effect. Why?

    In Premiere Pro CC 2014, the image disappears when I apply a mask of an effect. Why?

    Too bad...

    Fixed:

    adjustment of projects > switch Renderer.

    Thank you

  • Why do my images cropped in Windows Live Photo Gallery disappear?

    When I try to edit a scan using Windows Live Photo Gallery and cultures, when I finished and the exit, the image disappears from my file.

    I saw that many reports edition-turn can translate into
    photos becoming hidden. There is a possibility that the
    problem may be related to an update from McAfee.

    * Update *... see next thread... specifically the post
    Of... Sebastian D.

    photos disappear after turning, what can I do to stop this
    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-pictures/photos-disapear-after-rotating-what-can-i-do-to/a2358d63-0c95-4d93-81E0-eb0a003fc532

    Might be interesting to try to change the following setting and
    Perhaps the photos will be re - appear.

    Windows Vista - Show hidden files
    http://Windows.Microsoft.com/en-us/Windows-Vista/Show-hidden-files

    Windows 7 - show hidden files
    http://Windows.Microsoft.com/en-us/Windows7/show-hidden-files

    If the photo thumbs reappear... they can look washed out...
    to clear this up... right click on a picture or a selected group
    and choose... Properties, uncheck the 'hidden ' /.
    Apply / OK.

  • Photshop Elements 9 - why image disappears when I harvest?

    I use Photoshop Elements 9 and a bug has started to happen - when I try to crop an image, and then click 'accept', the image disappears. I can not stop what's happening, so am more able to use the crop tool. Should I reinstall the product?

    You probably have a few values entered into the fields of width, height and resolution.

    Choose no Restriction in the picture Format menu to clear values:

    MTSTUNER

  • Why text &amp; amp; images change/disappear?

    When I upload my project, my changes of text of the Arial font for the font Times New Roman. In addition, my flight path images disappear after moving the mouse on them. I have a CSS file, put in place to control the police, and have onMouseOver and onMouseOut attributes for my images.

    Any ideas what goes wrong?

    Thank you.

    One thing I see, it's the location of your images seems to be messed up somehow. For example - I can find "... / Images/images/events.jpg"but could not find"... / pictures/events_over.jpg. I even tried "... / Images/images/events_over.jpg", but the image is not there. Maybe if you ensure that all your images are in the right place that would work? Again - I'm not an expert, so if the problem is not the location of the image I'm probably over my head!

    GH

  • Image disappears while zooming

    When you zoom in some images in Photoshop CC, parts of the image black or disappear. How can I fix?

    Hirongpanda

    Please see the Article for this problem black or white squares appear on the image when you zoom in inside or outside

    Let us know if this helps

    ~ Assani

  • Why my Illustrator images become thicker strokes when I take the bounding box and make it smaller?

    Why my Illustrator images become thicker strokes when I take the bounding box and make it smaller? It never happened to me. I'm not an expert in Illustrator, but I do know some basic principles.

    In the preferences, is the scale strokes and effects verified?

  • model background image disappears when I make a new page of the model

    I have a background image in my container in my model.  When I make a new file based on this model, the background image disappears.  No idea why?

    Open your child page in code view.

    Correct the path to your background image manually as described in my previous post.  Record.  Preview in the browser.

    This aid?

    Nancy O.

  • CS6 crop tool and the image disappears?

    I am new to CS6. Sometimes when I use the the crop tool, the picture I want to crop disappears from the display. Can not see where to place the crop so I end up with a blank screen/window. When I click on another tool, a window pop up asking me if I want to harvest? To which I click on the button 'not fit' and my image reappears. As soon as I click on the crop tool once again, the image disappears again.

    Why? What I am doing wrong? It happens not every time.

    Which sounds like you have a problem with video card driver (like a lot of similar positions in the general forum of Photoshop).

    Try to update your driver from the website of the manufacturer of the GPU video card.

Maybe you are looking for

  • Import files from iPod to new iTunes

    I want to synchronize the music that is on my iPod in my iTunes library on my new macbook. the only option I can see will delete all my music on my iPod. The only thing I could do is to sync the purchased music, but not the rest.

  • Photosmart 6510 "Printer Error" and all lights flash

    I have a 1.5 years, Photosmart 6510 B211a who works well. Now, all lights are flashing and or my USB connected PC (Win 7 Ultimate 64-bit), or my iPad or iPhone (OS 7) connected wireless will be printed. When the printer is turned on it goes as usual,

  • BlackBerry smartphones, I am really frustrated: restarts my "BOLD" all of a sudden!

    Dear all I use my blackberry "BOLD" (with a valid plan) for more than 3 weeks. But recently, when I'm in the middle of its use, it suddenly reboots without any reason! She really push me crazy when I REALLY need to use my phone and no reason or notic

  • $v is not defined

    HelloApex 4.2, I always used $v to get the value of any page.For example: var myName = $v ('P1_X_NAME');Recently, I've migrated my app in Apex 5 universal theme and now when I get error $v is not defined for all of the code that works very well in 4.

  • Replication of VR with a configured thin server

    HelloI have configured replication for a file server 1.5 TB which is finely supply and uses only 70 GB currently.  It takes an extremely long time.  As a comparison, I have configured replication for one 700 zero lazy thick GB Exchange Server configu