[FMX] Really easy question, Don't know the answer!

I have a button which i tell to do a .play action. However, it continues to play the same clip if the user touches the button again, i don’t want this. How do i make AS that discontinues the script when this action is fulfilled? :smirk:

:sigh:

Use variables


on(press){
    if(nFlag == true){
        //do This....
        nFlag = false
    }
}

and somewhere in the main timeline put


nFlag = true

I want it to play an MC, after the MC has been played only once, i want the buttons AS on that MC to cancel? Can you explain please? Thanks for the quick response :bounce:

whatever you want to do it would be using basically the same idea at what i have. do you have a sample file that you could post that would help me help you?

Sorry, let me reword that :hangover: I meant… I have a button, i touch it, it plays an MC, the MC has a stop at the end of it. I no longer want this to happen again, how can i make it so that the AS line on that button which affects the MC will not occur? When the button is touched again, it plays the MC all over again C:-) sounds simple enough, (not for me)

Ok, I understand completely. So do what I told you to do in my first post. Where it says “//do This…”

replace with the play() script…

The AS looks pretty solid, thanks i am going to try it right now, one more Q, where on the timeline do i place the nFlag?

Usually first frame.

And the AS is solid… It is Jubba. Trust the Jubba.

That was quick! Thanks! =) lol

No problemo :wink:

Ran into something else, How do i disable the button when the keyframe has been activated. Goal: to touch a button and go to a keyframe, then use the same button to open swf’s. Thanks for all the help!

Huh?

Are you planning on running EVERYTHING off one button?

I don’t get it.

Main timeline: frame one(stop action) frame 2 (no stop action) frame 5 (stop action). there are 7 buttons… Whatever button the user touches first, i want the button to activate the next frame (since there is no stop on 2, it will go straight to 5) When the frame is at 5, i want it to no longer allow the user to hit the buttons and make the frame start all over again at 2 anymore, i just want those buttons to load swf’s, In other words, i want it to stay on frame 5, and those buttons to load swf’s sorry for the confusion :sigh:

Ok… modifying Jubbas code…

on(press){
    if(nFlag == true){
        //do This....
        nFlag = false
    } else {
       //do This
}

The //do this under the else is where you add your loadMovie code.

And it says that if nFlag is NOT true (which you set it to false the first time) then it should do that.

what is nFlag?:-\

Just a typical variable.

For all Flash cares you could call it doThisYouPieceOfCrap, just as long as you are checking that variable for it to work.

Here is what i have, it just doesn’t add up, maybe i am forgetting an instance name or something…

on (release) {
_root.play();
}
on (release) {
if (nFlag == true) {
gotoAndPlay(2);
nFlag = false;
} else {
loadMovie(“inout.swf”, “clip”);
}
}

You shouldn’t have two on(releases) you can do everything you need to in one.


on (release) {
if (nFlag == true) {
_root.play()
nFlag = false;
} else {
_root.clip.loadMovie("inout.swf")
}
}

Try that.

It did not work…:smirk: