Stopping the same random image

Hi,
I am loading 8 images into 8 movie clips using a random
number generator. it is working but it loads in the same images in
places. I need the 8 images to be different. They are being loaded
from a mySQL database using php. Does anyone have any tips?
I'm using this actionscript code.
var mcLoader2:MovieClipLoader = new MovieClipLoader();
//set up a Listener
var mclistener2:Object = new Object();
//associate the Listener with the MCL
mcLoader2.addListener(mclistener2);
_parent.rand = random(_parent.randtotal)
//set up Event functions
mclistener2.onLoadStart = function(target_mc:MovieClip):Void
//do stuff when load starts
_parent.rand = random(_parent.randtotal)
loadingtext.text = "initialising"
//browseSender.sendAndLoad("browserand.php",browseReceiver,"POST");
mclistener2.onLoadProgress = function(target_mc:MovieClip,
bytesLoaded:Number, bytesTotal:Number):Void {
//do stuff when load is in progress, like update a progress
bar
loadingtext.text = "loading";
mclistener2.onLoadInit = function(target_mc:MovieClip):Void {
//randSender.sendAndLoad("rand.php",randReceiver,"POST");
//do stuff when load is complete
//test.text = "hi";
browse2._xscale = 40;
browse2._yscale = 40;
//load the first image
//imgHolder_mc is a MovieClip on the Stage
mcLoader.loadClip(this["image" + _parent.rand], browse1);
thanks
Gavin

Here is my entry for this problem.

Similar Messages

  • Help in generating the same random numbers each time of the program executi

    dear friends
    i am facing a problem that the random numbers generated at time of each exectuion of the program are not the same, i want to generate the same random numbers every time time i run the program. i need your help. i am giving the code in c++ if anybody can help in providing the solution so that i get the same random numbers at every run of the program. waiting for your help
    wit regards
    jaya shankar
    #include<iostream.h>
    #include<stdio.h>
    #include<stdlib.h>
    #include<time.h>
    #include<math.h>
    class density
    int s[150][150],parent[150][150],i,j,l,n,loop;
    public:
    void bd(void);
    void css(void);
    void density :: bd(void)
    cout<<"ENTER THE POPULATION SIZE = ";
    cin>>n;
    cout<<"\nENTER THE NO.OF LOOPS = ";
    cin>>loop;
    for(i=0;i<n;i++)
    for(j=0;j<80;j++)
    s[i][j]=rand()%2;
    cout<<"s:"<<s[i][j];
    void density :: css(void)
    int a,b;
    float c;
    for(i=0;i<n;i=i+2)
         b=rand()%100;
         cout<<"random b="<<b;
    main()
    density d;
    d.bd();
    d.css();

    To generate the same random,it's impossible!
    why do you want to do that?

  • Help in generating the same random numbers at every time of executuion

    dear friends
    i am facing a problem that the random numbers generated at time of each exectuion of the program are not the same, i want to generate the same random numbers every time time i run the program. i need your help. i am giving the code in c++ if anybody can help in providing the solution so that i get the same random numbers at every run of the program. waiting for your help
    wit regards
    jaya shankar
    #include<iostream.h>
    #include<stdio.h>
    #include<stdlib.h>
    #include<time.h>
    #include<math.h>
    class density
    int s[150][150],parent[150][150],i,j,l,n,loop;
    public:
    void bd(void);
    void css(void);
    void density :: bd(void)
    cout<<"ENTER THE POPULATION SIZE = ";
    cin>>n;
    cout<<"\nENTER THE NO.OF LOOPS = ";
    cin>>loop;
    for(i=0;i<n;i++)
    for(j=0;j<80;j++)
    s[j]=rand()%2;
    cout<<"s:"<<s[j];
    void density :: css(void)
    int a,b;
    float c;
    for(i=0;i<n;i=i+2)
    b=rand()%100;
    cout<<"random b="<<b;
    main()
    density d;
    d.bd();
    d.css();

    You have to read the documentation for the java.util.Random class.
    "If two instances of Random are created with the same seed, and the same sequence of method calls is made for each, they will generate and return identical sequences of numbers. In order to guarantee this property, particular algorithms are specified for the class Random"
    Here is a peace of code that will do wat you need:
    Random rand = new Random(100);
    for(int i=0; i<10; i++)
         System.out.println("Random="+ rand.nextInt(10));

  • Redundant folders created in root of C drive of server and Client . I want to stop the same and want to automatically delete them from server and client .

    Redundant folders created in root of C drive of server and Client . I want to stop the same and want to automatically delete them from server and client .
    Please let me know the solution to delete them not manually . It should not create automatically .Is there a way we can change the path of creation.
    Is there a way that once the folfer is create should be automatically deleted once the task is done.
    Redundant folders are created in the root of my C drive all the time,
    folder names look like:
    09b0508d0bd2dbd70523
    56f51b81c1462bb378009ee4d5ed03
    02afe4378371907aca40ab

    This is a duplicate of
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/ae99c2d0-8dea-4c5e-8a79-17e08e9e5de4/sccm-2012-issue-folders-with-long-guid-are-created-in-c-drive?forum=winservergen#ae99c2d0-8dea-4c5e-8a79-17e08e9e5de4
    Jason | http://blog.configmgrftw.com

  • I keep getting the same preview image for multiple photos

    In my iPhoto Library and some of my folders the same preview image is showing for many of my images. When I enlarge or export those images or folders the correct image shows. Any ideas what is messing with the preview?
    Thanks.

    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
    Regards
    TD

  • Is there a script that Quickly get the Equidistant and The same size images.

    Is there a script that Quickly get the Equidistant and The same size images.
    General,I used the paste into the interior one by one, when it is a lot ,will waste a lot of time

    Is there a script that Quickly get the Equidistant and The same size images.
    General,I used the paste into the interior one by one, when it is a lot ,will waste a lot of time

  • When I open (launch) ps6, two old images always open.  always the same 2 images, and always when I launch the program. what is going on?

    when I open (launch) ps6, two old images always open.  always the same 2 images, and always when I launch the program. what is going on?

    Check your userid autorecovery folder after you close Photoshop. If there are psb files in it delete them

  • All tracks have the same preview image after import

    Hi,
    when importing some videos (h.264) into iMovie'08, all have the same preview image. I would expect them to hava an image from the clip.
    How to fix this?
    Arne

    The files are on disk in my pictures folder. I took them with my Sony camera as mpeg2 and converted them with MPEG Streamclip to mpeg4 (h.264).
    Just updated to iMovie 7.1, but did not change anything.
    The icons are all of the 1st clip. Moving the mouse over them always show the 1st clip and the audio of the first clip in the thumbnail, but in the preview I see the correct clip.

  • Can I stop the same Mail returning after deleting ?

    I acn't seem to stop the same mail returning time after time. There are about 10 items of various previous dates that cme back from 'MAIL DELIVERY SYSTEM' - Delivery Status Notification (failure)...
    I have tried, Bouncing, deleting and marking it JUNK but they reappear in my INBOX almost immediately.
    I have also noticed that recently I am having to Force Quit MAIL very much more often.
    Any one have any ideas, please ?

    Hi loons,
    Not certain, but this can fix myriad Mail problems...
    Safe Boot from the HD, (holding Shift key down at bootup), it will try to repair your Disk Directory while the spinning radian is happening, so let it go, run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move these folder & file to the Desktop.
    Move this Folder to the Desktop...
    /Users/YourUserName/Library/Caches/Mail/
    Move this file to the Desktop...
    /Users/YourUserName/Library/Mail/Envelope Index
    Reboot.

  • How do i stop the  same song repeating

    How do I stop the same song repeating. Answers I 've seen asy to tap the  artwork ,but what to do when there is no artwork to tap ?

    There is actually a setting for Repeat, so using the Shake to Shuffle feature is not the best way to "fix" the problem.   
    NOTE:  If your nano is a more recent model with a touch screen (not a click wheel), look on the Now Playing screen.  There is a symbol that looks like two arrows in a loop.  You may need to "swipe" the screen to show it.  That is the Repeat setting.  Tap it to change the setting between repeating ONE, ALL, and OFF.

  • How to restrict or stop the same data provided in selection screen parameters its should stop fetch the data on previously provided data?

    Hi Developer,
    i have issues that i need stop or restrict the same entries provided in the selection screen parameters it should no display that data but it should give an alert message by saying the data all ready viewed or displayed.
    example: organisation :getha pvt.td.
                  name :ramesh.
                  start date:10.2.2013.
    these are parameter which has been displayed by clicking execute ,if provide the same value to display again it should give waring message.
    Please guide me in solve the problem.
    thanks.
    ravi.

    Hi Somendra,
    Thanks for your response sir , i have provided the according to your provided information sir  but it was not  displaying the data first time also its giving message which i have provided ,my issues is if i provide data from time should display if i provide same data next time then only it should restrict the data and give a message.
    example:
    types:BEGIN OF str1,
       ROOMNO type zROOMNO,
       NAME TYPE zname3,
      BRANCH type zBRANCH,
       PHONENUMBER type zPHONENUMBER,
       END OF str1.
       data:it_str1 type TABLE OF str1,
            wa_str1 type str1.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME .
         skip.
    PARAMETERS:s_roomno type ZTABLE_2-roomno.
    skip.
    parameters:s_name type ztable_2-name.
    skip.
    PARAMETERS:s_branch type ztable_2-branch.
    skip.
    PARAMETERS:s_pho type ztable_2-phonenumber.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN.
    SELECT  roomno
             name
             branch
             phonenumber from ztable_2 into TABLE it_str1
             WHERE roomno eq s_roomno and name eq s_name and branch eq s_branch and phonenumber eq s_pho.
       READ TABLE it_str1 INTO wa_str1 with KEY roomno = s_roomno name = s_name branch = s_branch phonenumber = s_pho.
       if sy-subrc eq 0.
         MESSAGE 'THE DATA IS ALL READY VIEWED' TYPE   'E'.
         RETURN.
         ENDIF.
         START-OF-SELECTION.
       SELECT  roomno
             name
             branch
             phonenumber from ztable_2 into TABLE it_str1
             WHERE roomno eq s_roomno and name eq s_name and branch eq s_branch and phonenumber eq s_pho.
         loop at it_str1 into wa_str1.
         WRITE:/1 wa_str1-roomno,
                10 wa_str1-name,
                30 wa_str1-branch,
               60 wa_str1-phonenumber.
         ENDLOOP.
    please guide me in solving the issue sir.
    thanks,
    Ravi

  • Image position the same?  Image size the same?

    Hello
    I am inserting images into my website and want them to be in the same position (they are all the same size by the way).  When I insert them they are sometimes lower down than I need them.  I then have the annoying task of deleting lines to "move" the image up.  I know it something to do with CSS styles but is it easy to achieve?
    Furthermore, on my site I have a small image that when clicked leads onto a larger image.  In order to achieve this I am having to create 2 images (large and small) with an image resizer (it's tedious!).
    Is there a way to make the images on the website the same size to prevent having to resize them prior to importing them?
    Thank you

    osgood_ wrote:
    Herbert2001 wrote:
    I agree with Nancy and Jon - you can automate it easily in Photoshop and other tools. It takes a couple of extra minutes
    Only if you require no cropping of the images. I've never produced a website yet where the majority of images can be used directly without cropping areas, which makes them unique and cannot be batch processed all together.
    The only time I use a batch process is if I need to convert everything from 300dpi to 72dpi or I set a max image width or height.
    Photoshop is great if all the original images you need to batch process are the same dimensions and you need to use the same area, after that you need to start manually manipulating the process. Automation has it's limitations.
    Herbert2001 wrote:
    osgood_ wrote:
    Not many practice what they preach because it creates additional work, which mostly they are not paid for. In the 'real world' it aint happening, in your world which is tutoring I believe it happens because time is NOT money. How many create 3/4 different sized images targeted at specific devices, not many. Images are getting bigger and bigger not smaller and smaller as you would expect now we are supposed to cater for this that and the other device. Preaching your philosophy is admirable but sadly misguided.
    Many assumptions on your part, I dare say.
    No assumptions, go to any responsive website now and you'll come across large images set at max-width; 100%; to cater for all devices.
    Herbert2001 wrote:
    osgood_ wrote:
    Not many practice what they preach because it creates additional work, which mostly they are not paid for. In the 'real world' it aint happening, in your world which is tutoring I believe it happens because time is NOT money. How many create 3/4 different sized images targeted at specific devices, not many. Images are getting bigger and bigger not smaller and smaller as you would expect now we are supposed to cater for this that and the other device. Preaching your philosophy is admirable but sadly misguided.
    Nowadays I tend to work from an efficient mobile base initially (if and when the client/project requires it, of course) - which has become the norm for me in the last two years, at least. Perhaps not for you. If I can provide a quick and efficient mobile experience alongside a good desktop/large screen version, then I will. I am not going to brute-force unnecessary bandwidth costs upon mobile users either, which you seem to advocate in your first post - and those assertions were what I thought to be rather odd and lop-sided.
    Anyway, the extra work is trivial when done through simple back-end and front-end scripting and having it all done automatically for you, and then re-use for the next client. And most CMS's provide such built-in functionality as well, so it does not really take more time at all to provide a good mobile experience.
    Then will will have to agree to differ. I start from desktop first then move onto mobile. If you are finding the extra work is trivial then you are short changing your clients. Personally I've found producing responsive design to increase the workload considerably, given the extra css and testing you need to carry out I would have thought that was fairly obvious, unless you're using some kind of duplicated templated system for each client, which I prefer not to.
    Everything is rather odd and lop-sided isn't it? I mean the new html5 tags create <div> soup if they are used correctly - I find that rather odd and lop-sided considering for so long we were told that more marked up created greater download times and was overly complicating matters. Now its ok until in a few years time it's replaced by something else, and we'll be told that it was all a big mistake.
    Herbert2001 wrote:
    osgood_ wrote:
    I'm not asking you, because I live in the real world whereas as you live on planet fantasy.
    Good, because it was the OP that asked the question.
    Then you should direct your response to the OP and not me.

  • Multiple thumbnails of the same Shape image in Content Palette

    Hi everyone,
    I have PSE 9, operating on a Mac.
    Is it normal to see multiple copies (up to four) of the same shape thumbnail in the Contents Palette drop down menu?
    This only seems to happen with the Shapes, not the Backgrounds or Frames etc.
    It also doesn't happen when selecting from the Cookie Cutter or Custom Shape Tools.
    I have been removing the duplicates from the Content Palette by dragging to Trash but you can only do one at a time.
    Does anyone know why this is and if there is a quicker way to delete them?
    Thank you

    Hi everyone,
    I have PSE 9, operating on a Mac.
    Is it normal to see multiple copies (up to four) of the same shape thumbnail in the Contents Palette drop down menu?
    This only seems to happen with the Shapes, not the Backgrounds or Frames etc.
    It also doesn't happen when selecting from the Cookie Cutter or Custom Shape Tools.
    I have been removing the duplicates from the Content Palette by dragging to Trash but you can only do one at a time.
    Does anyone know why this is and if there is a quicker way to delete them?
    Thank you

  • Multiple versions of the same RAW image

    Hi All,
    It's posible to have multiple versions of the same RAW file. Let's say I work my RAW file and make some changes, can those changes become an independent file? I want to be able to go back to the original RAW file without loosing any other version already created.
    Best regards,
    Jose

    Hi Kim,
    May be you can try this and see if this works for you. I am not 100% sure if it will work for you, but worth a try I guess. Create a Test WebDynpro project and try the following steps on this project. If they work  out correctly and serve the purpose for you only then try them on your actual Web Dynpro project.
    1. Create a test Web Dynpro project  say "TestWDProject" with Component say "Comp1" and the default views and windows etc.
    Also create some working application our of this component and Windows using the Context.
    2. Right click the "Comp1" and select Copy.
    3. Right click 'Components" node in the project structure and select "Paste"
    4.This step will try to paste the copy of Comp1 as a new Component.
    5. You can change the Name and Package of the Component.
    6.Similarly you'll get the prompts for views,windows etc.
    7.Once you have copied everything, Just check if everything looks good.
    8.Now you can create a new Application using this new component and the Component Interface View and Deploy it.
    9.Test whether the Application created out of this copy works same as the original component.
    You can also try to create another Web Dynpro project and paste the Comp1 in the Components node of that new project and perform the same steps.
    Again, try with these Test Projects and see if this serves your purpose before applying the steps on actual projects.
    Regards,
    Ajay

  • Illustrator files size and instances of the same embedded image

    My question is, isn’t Illustrator supposed to use and save just one instance of an embedded image regardless of how many times it i used in an document?
    A senario: If I import and embed an image and I save the document I get a pretty small files size. But when I copy this image internally in the document, say that I copy the image 10 times, I get ten times the file size. Is it supposed to do that? Why doesn't it just save the image one time?

    Just did a test where I placed 5 images in Illustrator, one file with these images embedded, one with these images as Symbols, and one with these images as links. The winner for the smallest illustrator file is the file with images linked. But this is because you must supply the link with the Illustrator file if you want to actually use it for anything which would fall into the category of having one image used several times in Illustrator and not making the file have the weight of all 5 images.
    A better understanding of these usages in Illustrator can be attained with this link.
    http://help.adobe.com/en_US/illustrator/cs/using/WS714a382cdf7d304e7e07d0100196cbc5f-657aa .html

Maybe you are looking for