# Random movie Problem in your code

**URL:** <https://forum.kirupa.com/t/random-movie-problem-in-your-code/154040>\
**Category:** flash\
**Created:** [July 6, 2005, 4:07pm UTC](https://forum.kirupa.com/t/random-movie-problem-in-your-code/154040 "2005-07-06T16:07:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gardiol](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@Gardiol](https://forum.kirupa.com/u/Gardiol)\
**Post date:** [July 6, 2005, 4:07pm UTC](https://forum.kirupa.com/t/random-movie-problem-in-your-code/154040/1 "2005-07-06T16:07:10Z")

</div>

Hi

I have used your random movie loader as per instructions ([color=#003366] **Loading** Random Movies [/color][font=Verdana][color=#003366][[color=#394153]by kirupa - 25 January 2004[/color]](http://www.kirupa.com/me/kirupa.asp))[/color][/font]  
[color=#003366][/color]  
Everything works when you publish it in normal view from Flash (Cntrl Enter) but does not work HTML. But then again yours work on the page…? Any ideas…?

my code:  
filename = [“welcome1.swf”, “welcome2.swf”, “welcome3.swf”, “welcome4.swf”];  
path = “/”; _(it is in the same path as the original movie)_  
i = filename.length;  
k = Math.floor(Math.random()\*i);  
loadMovie(path+filename[k], movieTarget);
