Just a push in the right direction please?!

Okay, I’m not looking for the code (I want to try and figure it out), just a point in the right direction.

Here’s what I need to do.

On my navigation, I have 3 options. On first click on any of these, I need to place an animation only once and never again.

Obviously, I need to establish some script stating if it the first click then perform ‘this’ but not if the second click.

However, it has to work a little differently. It shouldn’t be first click on each button, but first click on any button.

What is will do is load the content (some fancy animation), but obviously I don’t want to load it each time as it’s all in the same MC so is unnecessary.

I’m guessing I maybe need to set up ‘if/else’ statements or perhaps 'array’s or ‘both’?

Hints anyone? Remember, no giving it away or I’ll never learn.

I’m not sure I totally understand what you’re trying to do…

So, you want an animation to play only once when you click a button. However, no matter which of the three buttons you click, you want it to play they play no more?

Just making sure before I point you in a "point"less direction! (hyuk…hyuk… sorry).

And sometimes you can learn from getting all the code at once, as long as it’s explained to you :slight_smile:

Well, let me know.

  • wobbly

Let me explain better.

On inital load of my site, no content will be present. So, when the user selects one of the nav options, I want to play a ‘little’ animation that will eventually reveal the content. But, this only needs to play once, not every time the user selects a nav option.

So, I need to tell my movie, that if this is the first time a nav component as been selected, play this animation. However, if they have already selected a nav option, and then pick another, I don’t want the animation to play. Does that make sense?

You’re right, getting the code can be just as useful, feel free to give it to me if you have it. :slight_smile:

I’m getting in the shower right now (like you needed to know that), but real quick before I go:

Try making all the nav buttons an instance of the same symbol. The symbol has the AS to make the movie play only once, while each instance can contain the AS to do their navigation duties.

Just a shot, I am pretty new to AS :slight_smile:

Well anyways, let me know how things go. I’ll help more later if need be.

  • wobbly

Wobbly, not sure what you mean. Right now, all the nav is contained and controlled from an MC. Can I still do it that way?

What is I have 2 instances of the Nav, and on first click switch other version. Oh, I think I have an idea now! ;0)

York, If I understand you correctly, what you need is an action that performs only once then disables itself. David helped me with a similar problem awhile back in another thread. Here’s the link to that thread, it might come in handy. =)

http://www.kirupaforum.com/showthread.php?s=&threadid=8881

This kind of helps. I think I need to adjust the script a little to say:

If this MC(loadcontent) has played, then do this, if not go to MC and play.

I have labels set up in the target MC for loadconent and contentloaded.

So, to make it clearer, I guess I need to say:

if ‘loadcontent’ is at ‘contentloaded’ go and do this
if ‘loadcotent’ isn’t, then go to and play ‘load content’.

I just need to figure that part out! :smirk:

Yah, I wrote my first if/else statement all by myself! :beam:

So, I’m almost there with this. Here’s the code:

cranium.onPress = function() {
with (_root.loadcontent) {
if (_currentframe == 40) {
loadMovie(“content.swf”, _root.contentarea);
_root.targetx = -280;
_root.slide.gotoAndPlay(“move”);
} else {
with (_root.loadcontent) {
gotoAndPlay(“loadcontent”);
}
}
}
};

I just now need to tell it to load content at the end of loadcontent …

Thanks guys, lovingly yours, the if/else statement queen!

Okay, so now I am stuck a little on the next part.

How do I tell the whatever to go here dependant on which button is pressed? mmm … ponder ponder …

Hope someone can help, in the meantime I’ll just hope the light bulb turns on!

Hold that thought, the bulb turned on sooner than I thought. I’ll get back if my idea is just wind!

It wasn’t! Yah, no more help needed.

Here’s the script I had to write (yeah, I wrote all by myself :beam: ) to get the ‘loadcontent’ movie to detect which button had been pressed:

if (_root.navigation.cranium.onPress) {
loadMovie(“content.swf”, _root.contentarea);
_root.targetx = -280;
_root.slide.gotoAndPlay(“move”);
}

Works like a charm!

I envy you York, I can’t read or write actionscripts. When it comes to actionscripting, I feel like a blind asian guy trying to read Hebrew. :-\

*Originally posted by electrongeek *
**I envy you York, I can’t read or write actionscripts. When it comes to actionscripting, I feel like a blind asian guy trying to read Hebrew. :-\ **

Hey, I was the same! Time and patience my friend! :slight_smile:

Actually, I have a wee clitch!

First off here’s the AS on the actions layer of my nav:

cranium.onPress = function() {
with (_root.loadcontent) {
if (_currentframe == loadcontent) {
_root.targetx = -280;
_root.slide.gotoAndPlay(“move”);
} else {
with (_root.loadcontent) {
gotoAndPlay(“firstload”);
}
}
}
};

Here’s the clitch.

Now, everytime I press this particular button, it will play the animation (firstload) rather than just progressing and doing the part in the ‘if’ section. What did I do wrong?

Oh wait, I think I know what I have to do:

Instead of:

if (_currentframe == loadcontent) {
_root.targetx = -280;
_root.slide.gotoAndPlay(“move”);

I should instead do if ‘this swf’ is loaded, that do the _root thing.

Obvioulsy, if it’s not loaded, that it would have to play the animation.

Okay, now I need to learn how to detect is something is loaded in.

Hope I’m not confusing you all.

York you lost me a long time ago, I’m still trying to analyze your code, but I’m waiting patiently for the answer to your problem.

Yeah I know, I think I’m just having a conversation with myself in this thread! :crazy:

Okay, now i am stumped. Can anyone help? Let me know if I need to explain things … it got a little messy back there!