Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Frame Random

Explorer ,
Apr 30, 2013 Apr 30, 2013

game.png

this is my game layout,

this is basicaly match order of names.

but every time when game reload all the display names are randomly placed.

i think frame random could be work but don't want to repeat the frame

anyone can help me !!!!

TOPICS
ActionScript
3.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 01, 2013 May 01, 2013

assign your names to an array, then randomizes the array:

var namesA:Array=["xxx","yyy",etc];

namesA=shuffle(namesA);

// namesA is now randomized.  you can loop through namesA and present the display names randomly.

// nothing needs to be changed below.

function shuffle(a:Array):Array {

    var len:Number = a.length-1;

    for (var ivar:Number = len; ivar>=0; ivar--) {

        var p:Number = Math.floor(Math.random()*(ivar+1));

        var t = a[ivar];

        a[ivar] = a

;

        a

= t;

    }

    return a;

}

Translate
Explorer ,
May 14, 2013 May 14, 2013

Finally solved!!!

just push one frame ahead in names movieclip and it's perfectly working.

ThAnks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 15, 2013 May 15, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines