Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display random movie clip...? 1

Status
Not open for further replies.

funkymonk

Technical User
Dec 18, 2000
588
GB
More screensaver stuff…..

If you check out the link here to see what I mean:


When the marble image rolls across the screen then comes back again, I want to display a quote from a client. Each time it (the marbles image) rolls to the right then back to the left I want a different quote to display where the company name currently is. Then say, every 5 times the company name and strap line return. I'm sure I will use mc's to do this but how do I get them to randomly display like I want....?


funkymonk B-)

rod@sameplanet.co.uk
[un-finished - still]

********************
 
if you used a single dynamic text box, then you could do the following.

1-set up an array in your first frame:

Code:
quotes = new Array();
quotes[0] = "this is quote 1";
quotes[2] = "this is quote 2";
quotes[3] = "this is quote 3";
quotes[4] = "this is quote 4";
quotes[5] = "this is quote 5";
quotes[6] = "this is quote 6";
quotes[7] = "this is quote 7";
quotes[8] = "this is quote 8";
quotes[9] = "this is quote 9";
quotes[10] = "this is quote 10";
quotes[11] = "this is quote 11";

2-In your marble tween, in the frame where it rolls back to the start, insert the following:

Code:
count++;
oldran = ran;
ran = random(11);
if (count==5) {
    count = 0;
    _root.dyntext = ""
    // script to display the company logo goes here
} else if (count!=5&&oldran!=ran) {
    _root.dyntext = _root.quotes[ran];
} else if (count!=5&&oldran==ran) {
    _root.dyntext = _root.quotes[ran+1];
}

3-Insert a dynamic text box with variable name _root.dyntext.

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Just tested that script....if you want it to work it might be a good idea to put a an array value in for
Code:
quotes[1]
....oops

You can also remove the count!=5 parts in the two elseif statements.

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
with the quotes[1], do I replace the quotes[0] or do I add in another one...? funkymonk B-)

rod@sameplanet.co.uk
[un-finished - still]

********************
 
correction > add another one into the array
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
cool, will do. Gonna have a look at using the movie clip version first, words like array scare me a bit.:-0 . heheheh...

funkymonk B-)

rod@sameplanet.co.uk
[un-finished - still]

********************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top