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

Frame Random

Explorer ,
Apr 30, 2013 Apr 30, 2013

Copy link to clipboard

Copied

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

Views

2.6K

Translate

Translate

Report

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;

}

Votes

Translate

Translate
Explorer ,
May 14, 2013 May 14, 2013

Copy link to clipboard

Copied

Finally solved!!!

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

ThAnks

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

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