Script not compatable with macs?

Subscribe to Script not compatable with macs? 5 posts, 3 voices

Sign in to reply


 
avatar for DrunkenOrc DrunkenOrc 105 posts
Flag Post

Hello.

I am in the process of making a game (As usual), and I sent a demo of it to my friend. However, he cannot seem to click on the continue button to get back the introduction of the story. Due to previous similar problems, I believe that the script I am using for the continue button may not be compatable with macs.

Here is the code:


class ButtonContinue extends MovieClip {
	var Timer
	function onLoad() {
		Timer = 0
                          // The timer is so that you can't accidently click the button
                          // twice in a row and skip the story.
	}
	function onEnterFrame() {
		Timer += 1
		if (Key.isDown(1)) {
			if (Timer >=10) {
			_root.nextFrame();
			_root.MessageFade.gotoAndPlay(1);
                                      // That above script will make the next frame fade in
                                      // instead of suddenly appearing.
			Timer = 0
			}
		}
	}
}

Can anyone comfirm my suspicions, and tell me what I can do to fix this? Or possibly give another explination?

(And yes, I do know that you can click anywhere and the button still registers. That is intentional.)

Thanks in advance, Orc.

 
avatar for Jabor Jabor 9707 posts
Flag Post

What do you have against using an onClick event?

 
avatar for DrunkenOrc DrunkenOrc 105 posts
Flag Post

Erm.

I dunno? How would I go about doing that?

 
avatar for jonathanasdf jonathanasdf 1592 posts
Flag Post

It might have to do with how Timer is a class… try using a different var?

and: _root.onClick = function() {

set _root.onClick = null after you’re done.

 
avatar for Jabor Jabor 9707 posts
Flag Post

It might have to do with how Timer is a class… try using a different var?

Actually, I believe the problem with the original code is that on macs, it wasn’t looping around back to the start, while it was on PC’s. I suspect that might be an implementation difference in nextFrame().

You could probably work around that with something like

if(_root._currentFrame = _root._totalFrames)
    _root.gotoAndStop(1);
else
    _root.nextFrame();

Sign in to reply


Click Here