all groups > flash actionscript > march 2005 >
You're in the

flash actionscript

group:

a way to control active links (buttons)?


a way to control active links (buttons)? purpleape
3/27/2005 10:00:15 PM
flash actionscript:
I have a movie that is divided into many swf.s they are all controlled from a
main movie that is basically just a navigation bar with links. Each button on
the nav bar calls a swf into an empty movie clip with load movie.

This is fine and works, but I want to be able to change the look of the button
when the movie it has loaded is playing. Is there any way to do this? I am
really a beginner with actionscript, I just need to be pointed in the right
direction and.

Thanks for any help! Happy Easter!
Heidi:heart;
Re: a way to control active links (buttons)? kglad
3/27/2005 10:40:15 PM
in your btn code you can use "this" to refer to your button. for example:

btn1.onRelease=function(){
this._xscale=110;
this._yscale=110;
Re: a way to control active links (buttons)? purpleape
3/28/2005 12:19:04 AM
thanks for the help. I am having trouble incorporating the code you gave me
into what I already have. Could you be more specific??

I already have as button code

on (release) {
_root.contents.loadMovie(intro.swf")
}

and this works to load the movie. Is it possible to write the code you gave me
in addition to this?
also - I apologize if this is a really dumb question. does x_scale=110 just
change the position of the button? Ideally I would like to swap it for a whole
new graphic.

Thanks!
Re: a way to control active links (buttons)? purpleape
4/5/2005 3:51:34 PM
KGlad,

How are you? I am still here, plugging away on this flash demo. I am taking
your advice and keeping the swf's as swf's rather than putting them into movie
clips. Now I just need to know how to use that button script you gave me.

Again, I have a frame that includes navigation buttons and I want to call in
an swf when a button is clicked with its name on it. What I want to do is have
the button that was clicked in order to load a corresponding movie, look
different while its movie is playing.

you gave me this script:

btn1.onRelease=function(){
this._xscale=110;
this._yscale=110;
}

I assume that this example would change the scale of the button while it was
'active'

how would I change the look of the button via swapping a button graphic file?

Remember I am new to actionscript and if this would require alot of code, I
think I would rather change my design to accomodate more simple code that I can
later edit if need be.

Thanks for all your help!
Heidi


Re: a way to control active links (buttons)? kglad
4/6/2005 1:30:14 AM
if you want the button (that loads your swf) to look different while that swf
is playing you'll need to a little more complex coding. we'll need to initiate
a loop that will check when your swf completes loading and begins playing and
then checks to see when it stops playing at which time, i assume, your button
will return to its previous appearence.

the code below will scale your button when it's released. it will remain that
way until some other code is executed the changes its scale.

a common effect would be to scale an active button and return any previously
scaled button back to its original dimensions. for example, if you have btn1,
btn2,...,btn10:

for(i=1;i<=10;i++){
this["btn"+i].onRelease=function()
for(j=1;j<=10;j++){
this["btn"+j]._xscale=100; // scales all buttons to normal
this["btn"+j]._yscale=100; // at most one of which is enlarged.
}
this._xscale=110; // enlarges the currently released button.
this._yscale=110;
}
}






AddThis Social Bookmark Button