# Randomized Flash Header

**URL:** <https://forum.kirupa.com/t/randomized-flash-header/275547>\
**Category:** flash\
**Created:** [November 15, 2008, 11:24am UTC](https://forum.kirupa.com/t/randomized-flash-header/275547 "2008-11-15T11:24:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shellfish](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@shellfish](https://forum.kirupa.com/u/shellfish)\
**Post date:** [November 15, 2008, 11:24am UTC](https://forum.kirupa.com/t/randomized-flash-header/275547/1 "2008-11-15T11:24:23Z")

</div>

Hey,

I’m having trouble thinking how to do the following with AS3 for creating a randomised Flash header on refresh. I’ve setup 5 frames in a movie clip with different artwork on each frame. I’ve then added a new layer where I want to add the code. With action script 2 my code would have been:

stop();  
logovariable = random(5);  
if (logovariable == 0) {  
gotoAndStop(1);  
}  
if (logovariable == 1) {  
gotoAndStop(2);  
}  
if (logovariable == 2) {  
gotoAndStop(3);  
}  
if (logovariable == 3) {  
gotoAndStop(4);  
}  
if (logovariable == 4) {  
gotoAndStop(5);  
}

How would I do the same thing in AS3.  
Thanks bigtime for any help  
Shell
