Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-01-2003, 10:46 AM   #1
gonda
Registered User
 
gonda's Avatar
 
Join Date: Jun 2003
Location: Gent - belgium
Posts: 32
Default nav that remembers

Hi,

I think there's a simple answer to this, but I can't find it. How can I make actionscript remember something?

For example :
I have a navigation that works really simple, with labels along the timeline :

onRollOver = function () {
gotoAndPlay("over");
}

onRollOut = function () {
gotoAndPlay("out");
}

onRelease = function () {
gotoAndPlay("press");
}


Whenever I press my button(which is a MC), and I don't keep my mouse on it, the timeline jumps to "out" again. Fair enough I guess, cause that's what I say in the script, but how can I change that?
I just want my MC to stay on "press" when I clicked it.

I think when I know how to do that I can also make actionscript remember what MC was clicked and then remove it whenever I click another MC ... no?

If you only have the slightest idea ... reply me plz!
gonda is offline   Reply With Quote
Old 10-01-2003, 01:58 PM   #2
sandman9
Senior Member
 
Join Date: Oct 2002
Location: Canada
Posts: 448
Default

Are you targeting _root? ..... Are you saying gotoandStop instad of gotoandPlay?

How about if after the onRollOut fuction you added a If statement saying If mouse is not pressed then "gotoAndPlay("Out"); ..... I'm sure there is a command for it, maybe onesome can help us out with what that command is?

Unless it's as simple as "on roll out, if MouseUP, go to and play ....."

Don't know if this is write for I just made it up off the top of my head but you get the idea

onRollOut = function () {
if (MouseUp){
gotoAndPlay("out");
}
}

Sandman9

Last edited by sandman9; 10-01-2003 at 02:07 PM.
sandman9 is offline   Reply With Quote
Old 10-01-2003, 03:19 PM   #3
webguy
Senior Member
 
webguy's Avatar
 
Join Date: May 2003
Location: west palm beach
Posts: 1,652
Send a message via ICQ to webguy Send a message via AIM to webguy
Default

use a variable reference to the clip.

ActionScript Code:
// function to remove clip referenced by the variable clipToRemove function remove() { clipToRemove._visible = false; } this.onRelease = function () { // when this btn is clicked go to and Play Skippy gotoAndPlay("Skippy"); // then invoke our function to remove our  referenced clip remove(); // then assign this clip to the variable // clipToRemove so when the next clip is // clicked this clip will be removed, as long as // it has a remove() call in it _global.clipToRemove = this; }

webG
__________________
Reality is merely an illusion, albeit a very persistent one.
webguy is offline   Reply With Quote
Old 10-02-2003, 06:11 AM   #4
gonda
Registered User
 
gonda's Avatar
 
Join Date: Jun 2003
Location: Gent - belgium
Posts: 32
Default

Thx for ur help already, but I'm not quite there yet ...

I also think my second question was wrong formulated. What I mean is :

I have 2 buttons that are made up the exact same way (with the labels and the script that I copied in my first message) and are both MC's. On a MoveOver they change color and grow a little. onRelease they should stay in a darker color.

When I press one of them another swf opens next to it with some content.

Now my problem is that all of this works. But not as I want it to

I want my MC to stay on the label "press" when pressed and also when I move my mouse away (now the onMoveOut action makes that impossible)... untill!! I press my second button. Then the first button had to go to label "out" again.

This is just to help my viewers so that they know what section they are in when they pressed an MC in the navigation. (the pressed button has a darker color)

Is that clearer?? Or am I to confusing?
gonda is offline   Reply With Quote
Old 10-02-2003, 09:36 AM   #5
webguy
Senior Member
 
webguy's Avatar
 
Join Date: May 2003
Location: west palm beach
Posts: 1,652
Send a message via ICQ to webguy Send a message via AIM to webguy
Default

check out the file btntest.zip in this thread. Might help you out.

http://www.actionscript.org/forums/s...ghlight=button
web
__________________
Reality is merely an illusion, albeit a very persistent one.
webguy is offline   Reply With Quote
Old 10-02-2003, 10:08 AM   #6
JEBoothjr
Registered User
 
JEBoothjr's Avatar
 
Join Date: Dec 2002
Location: Ohio
Posts: 408
Send a message via AIM to JEBoothjr
Default

There is also something similar in this thread:

http://www.actionscript.org/forums/s...threadid=31734

with a zip file to look at.
JEBoothjr is offline   Reply With Quote
Old 10-02-2003, 11:17 AM   #7
gonda
Registered User
 
gonda's Avatar
 
Join Date: Jun 2003
Location: Gent - belgium
Posts: 32
Default

Thank you for the links!

One of the zips of webguy helped me out ... although again I'm stuck. I guess I'm almost there ... that's why I'll post my fla here so you understand what I mean.

If you click a button and then click another you'll understand what's still going wrong.
I hope ...
Attached Files
File Type: zip butn.zip (35.2 KB, 128 views)
gonda is offline   Reply With Quote
Old 10-02-2003, 11:20 AM   #8
webguy
Senior Member
 
webguy's Avatar
 
Join Date: May 2003
Location: west palm beach
Posts: 1,652
Send a message via ICQ to webguy Send a message via AIM to webguy
Default

ActionScript Code:
if(prevClip != this) {     prevClip.enabled = true;     prevClip.gotoAndPlay("out"); // just add this     prevClip("press");     _global.prevClip = this;     }

was that the problem?

web
__________________
Reality is merely an illusion, albeit a very persistent one.
webguy is offline   Reply With Quote
Old 10-02-2003, 11:27 AM   #9
gonda
Registered User
 
gonda's Avatar
 
Join Date: Jun 2003
Location: Gent - belgium
Posts: 32
Default

PERFECT

Thank you soooo much !!!
gonda is offline   Reply With Quote
Old 10-02-2003, 11:44 AM   #10
webguy
Senior Member
 
webguy's Avatar
 
Join Date: May 2003
Location: west palm beach
Posts: 1,652
Send a message via ICQ to webguy Send a message via AIM to webguy
Default

welcome
__________________
Reality is merely an illusion, albeit a very persistent one.
webguy is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:17 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.