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

code re-construction

Status
Not open for further replies.

bobgg

Programmer
Jul 1, 2002
7
0
0
GB
does anyone knows how to get the following movie clip code working in a button:-

onClipEvent(enterFrame) {
if(nIntervalCount > 20) {
makeABall();
// make new item between every 11 and 15 frames
nIntervalCount = Math.randomBetween(5,9);
}
nIntervalCount ++;
}

thanks for your help...
bob.g
 
Actions attached to movieClips in buttons are ignored. Why is it inside a button anyway?
 
Hi rgstewart, the reason why this code is in a button is because of the way I designed my movie. Instead of having
the clip played automatically, the viewer has the option of starting it themself. Am I right in thinking there is no other way to get the above code executing within a button?

Thanks BOB.G
 
onClipEvent(load) {
begin = false;
stop();
}
onClipEvent(mouseUp) {
if(this.hitTest(_root._xmouse, _root._ymouse, true)){
begin = true;
}
}
onClipEvent(enterFrame) {
if(begin == true){
if(nIntervalCount > 20) {
makeABall();
// make new item between every 11 and 15 frames
nIntervalCount = Math.randomBetween(5,9);
}
nIntervalCount ++;
}
}

Why not try that - just put it on the movieClip. You don't need a button at all. When the user releases the mouse button on the movieClip, begin will become true, and the balls will start to replicate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top