Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Flash (all versions)
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 20th, 2007, 03:00 PM
Friend of Wrox
Join Date: Jun 2003
Location: , , .
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default random movie loading


I've got this code to load a random flash movie but it doens't seem to work - here's the code:

    filename = ["panorama.swf", "panorama2.swf", "panorama3.swf"];
    path = "http://www.mysite.com/panorama/";
    i = filename.length;
    k = Math.floor(Math.random()*i);
    loadMovie(path+filename[k], movieTarget);

I have created a movie called rnd.swf that has this actionscript in the first keyframe.

Can anyone help or does anyone have any better ideas for loading a random movie?



Reply With Quote
  #2 (permalink)  
Old March 21st, 2007, 07:20 AM
Friend of Wrox
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts


Your code seems to work just fine. Do you have a movieclip on stage with the <Instance Name> called movieTarget?

If that doest help your path isn't correct to your swf files

__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.
Reply With Quote
  #3 (permalink)  
Old June 26th, 2007, 01:18 AM
Authorized User
Points: 56, Level: 1
Points: 56, Level: 1 Points: 56, Level: 1 Points: 56, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Feb 2007
Location: Vashi, Maharashtra, India.
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post

well i cant help you but i got help from your code. i will try it on my own

Amitav Roy
Email: amitavroy7@gmail.com
Web: http://www.pixelgroups.com

Blog: http://weandgraphic.blogspot.com
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
flash movie not loading smys123 Flash (all versions) 1 July 17th, 2007 06:39 PM
Flash movie not loading smys123 XSLT 2 June 13th, 2007 02:23 PM
Loading Movie Functionality helgaana1 Flash (all versions) 1 April 6th, 2005 04:19 AM
Random Numbers not so random... katsarosj ASP.NET 1.0 and 1.1 Basics 5 November 20th, 2003 12:55 AM
Loading Additional Movie in the Background mujj_ahid@hotmail.com Flash (all versions) 0 July 22nd, 2003 10:26 PM

All times are GMT -4. The time now is 10:08 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.