Groups | Blog | Home
all groups > flash (macromedia) > october 2003 >

flash (macromedia) : Dynamic Navigational Buttons - Help?


frank e
10/21/2003 10:39:56 PM
I am trying to create some navigational buttons (to control loading external SWFs into a blank MediaClip). I know how to create buttons and I know how to use MediaClips as buttons, but I can't seem to figure out this issue:
My situation is - I want the button to remain "highlighted" (in a "down state") after I click it. For example, I have a menubar of buttons where the text is red and in the rollover state the text is yellow. I want a button to remain yellow after it has been clicked (so the user knows what menu/page is displaying). Also, that button should then become "un-clickable" (or disabled). I figured out how to do this by simply loading a whole new menubar each time, but it is not very seamless (kind of jumpy). Can anyone point me in the right direction? Maybe a tutorial exists out there, somewhere?

Thank you,
Frank E

Sson
10/21/2003 11:41:29 PM
Hi,

try this
//have 4 frames in a button MC
//frame 1 : normal
//frame 2 : over
//frame 3 : press
//frame 4 : selected

//MC Script
onClipEvent(load){

this.onRollOver = function(){
if(!this.isSelect) {this.gotoAndStop(2)}
}
this.onRollOut = function(){
if(!this.isSelect) {this.gotoAndStop(1)}
}
this.onPress = function(){
if(!this.isSelect) {this.gotoAndStop(3)}
}
this.onRelease = function(){
//this will reset the previous selected item
if(this._parent.my_nev_selected != undefined){
this._parent.my_nev_selected.gotoAndStop(1)
this._parent.my_nev_selected.isSelect = false
}
this.isSelect = true
this._parent.my_nev_selected = this
this.gotoAndStop(4)
//add your load external swf code here
}
this.onReleaseOutside = function(){
if(!this.isSelect) {this.gotoAndStop(1)}
}

}


//this was a somple code, you may change to other, like class or some other way
//have a nice day


Ash Sammy
10/21/2003 11:47:39 PM
This is so funny.
Sorry I know it's a mistake but the word "somple" sounds so funny.


Sson
10/21/2003 11:57:42 PM
sorry that
but i was want to type a SIMPLE not SAMPLE
:)

frank e
10/22/2003 12:34:45 AM
Thank you Sson, that actionscript was very helpful!

Forgive me though, I am an actionscript beginner. I think I understood all the code and I tried it out, assuming I was supposed to substitute my button MC instance name where you have "my_nev_selected". Is that correct? Am I also supposed to be substituting something where you have "this"?

Thanks again! :-)


Sson
10/22/2003 2:48:36 AM
Forgive me though, I am an actionscript beginner. I think I understood all the code and I tried it out, assuming I was supposed to substitute my button MC instance name where you have "my_nev_selected". Is that correct? Am I also supposed to be substituting something where you have "this"?

Thanks again! :-)

Hi,

this is references an object or movie clip instance that script current execute
my_nev_selected is a holder that hold which item user select before, so that
we can reactivate it after other item is choiced

i have make an example for you that create menu with external xml
but not a really completed and well coding...
hope you can understand that example well

http://webforums.macromedia.com/attachments/menu11111111.zip

AddThis Social Bookmark Button