# Firefox XML issue after adding simple piece of script

**URL:** <https://forum.kirupa.com/t/firefox-xml-issue-after-adding-simple-piece-of-script/301700>\
**Category:** flash\
**Created:** [December 14, 2009, 1:15pm UTC](https://forum.kirupa.com/t/firefox-xml-issue-after-adding-simple-piece-of-script/301700 "2009-12-14T13:15:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kajakki](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kajakki](https://forum.kirupa.com/u/kajakki)\
**Post date:** [December 14, 2009, 1:15pm UTC](https://forum.kirupa.com/t/firefox-xml-issue-after-adding-simple-piece-of-script/301700/1 "2009-12-14T13:15:09Z")

</div>

I had a working .swf which I used for getting news items from an XML file. I wanted the news items to be randomized so I added the following code:

```auto

newsitem = random(3) +1;
// generates number 1, 2 or 3.

if(newsitem==1) 
gotoAndPlay(2);

else if(newsitem==2) 
gotoAndPlay(3);

else 
gotoAndPlay(4);

```

The purpose is to get a random number and then jump to a corresponding frame. After I added this code, Firefox refuses to show my first news item completely. Sometimes all the texts are missing, sometimes just some. It doesn’t appear to be an XML issue - I tried switching places with the news items and it’s always the first item of the XML file that has this problem.

Is there something wrong with the code I added? I’m running out of ideas…
