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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically load button

Status
Not open for further replies.
Aug 2, 2002
28
GB
Hello,

I was wondering whether there was a way to load a button depending on what image was loaded.

I have a function that randomly selects an image. I would like to load a button dependent on what image was showing.


pic_arr = [

"Images/01006a",
"Images/01224a",
"Images/01446a"

];

buton_arr = [

"button1",
"button2",
"button3"

];


holder_mc.onEnterFrame = function() {

ranNum = Math.floor(Math.random()*pic_arr.length);

//CHECK TO SEE IF LAST IMAGE LOADED THE SAME

while (ranNumold == ranNum)
{
ranNum = Math.floor(Math.random()*pic_arr.length);
}

holder_mc.loadMovie(pic_arr[ranNum]+".jpg");

***I WOULD LIKE TO LOAD BUTTON***

ranNumold = ranNum;


};

Any suggestions would be most appreciated.

Thank you.








 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top