Results 1 to 4 of 4

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Random Image Script

  1. #1
    Default Random Image Script
    Are we allowed to discuss scripting here as it is a Web App forum?

    I've been designing a small Web App that rolls up to 5 dice. It all went well until I had two or more dice on the screen using 1 of 6 random images. Can you guess what they did? They both choose the same image every time - so it's always doubles...

    I've tried other scripts that use choose from gallery but none have worked so far. The only thing I can thing of now is to use frames, where each dice is its own frame without a border or scroll bar.

    Anyone have a working random image script that meets my needs?

  2. #2
    Post what you have for code, as can be done without frames.

  3. #3
    Sorry I don't have the code anymore. Deleted it after several failed attempts of editing it.

  4. #4
    If you had it working with 1 is was way you added 2-6.


    Without seeing your code and seeing issue, can only suggest this.

    Since dice i assume images named 1.gif 2.gif 3.gif 4.gif 5.gif 6.gif

    You are using a random # generator 1-6

    You are have 5 place holders by a 1 by 5 array

    now there are a # of ways todo this but simpliest way is to use a for loop


    For roll of dice 1 to 5
    do
    result=random code;
    placeholder[roll of dice] = [result].gif;

    end

    Its not coded for you, but you should be able to follow without being spoonfeed.
    Last edited by theguyz; 2008-04-12 at 07:33 AM.

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •