http://www.kirupa.com/developer/mx2004/ani_smartclipnav2.htm
OK, at the end of this tutorial it talks about adding links to the buttons created. I did what it said to do but the two buttons keep canceling themselves out if I place them on top of eachother. Could some one please shed some light on how to place them.
thanks
CLoak
http://www.kirupa.com/developer/mx2…artclipnav2.htm
OK, at the end of this tutorial it talks about adding links to the buttons created. I did what it said to do but the two buttons keep canceling themselves out if I place them on top of eachother. Could some one please shed some light on how to place them.
thanks
CLoak
Now you’re obviously going to want these buttons to lead somewhere … My best advice, and the practice I always use, is to add a new layer above your movie, and insert a new instance of your invisible button per link, and add the Actionscript for each one
I think I understand your problem… correct me if i’m off base here:
You’re being misled by the whole “new layer above your movie” thing. You can have all of your buttons on one layer… in fact that’s probably the easier and more organized way of doing things.
once you’ve created a smartclip you can drag the instance of it from the library and onto the stage. Make a new layer and call it “buttons” or “nav” or whatever and drop as many instances of your smart clip as you’ll need buttons onto the stage. then use the align panel and pixel nudging to align them all purty like.
then click on the individual button (in this case smartclip instances) and add different actionscript for each one (your “links”). You can direct other movie clips to specific frames, load a .swf, get an URL or whatever…
does that help?
Hey Cloakendagger, let me be the first to warn you about posting mulitple threads with the exact same question, aka cross-posting.
The Mods. do not like it when people do this, just thought I’d let you know.
Sorry about the cross posting, I have people paying me to get this done so when the dead line is 3 days out I kinda panic when I get in to jams. Next time I’ll huddle in the closet and mumble to myself.
OK, So I did what you said and all but I still didnt get the results. So what your saying to do is on the stage creat a layer for all my buttons.(which i already have done.) Then on each instance of the buttons on the stage add an action. Which Im doing. But it just does what the stage instance action script requests. It doesnt even bother to run the actions within the instance. Ya know what I mean. In the instance on the invisible button i have this action
on (rollOver) {
gotoAndPlay(“Start”);
}
on (rollOut) {
gotoAndPlay(“Stop”);
}
And then on the stage on the smartclip instance i have this
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = “home”;
container.loadMovie(“home.swf”);
} else if (_root.currMovie != “home”) {
if (container._currentframe>=container.midframe) {
_root.currMovie = “home”;
container.play();
}
}
}
Does this conflict?
yeah, that is incorrect…
you can’t have on release, rollover, etc. actions on a movie clip… only on the button…
that invisible button inside your movie clip is where you want to define any
actions based on mouse events.
So would I place this on the button inside my instance.
Could you check my code and see if its ok because its not running right. Im not getting any errors but its not activating the release command.
on (rollOver) {
gotoAndPlay(“Start”);
}
on (rollOut) {
gotoAndPlay(“Stop”);
}
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = “home”;
container.loadMovie(“home.swf”);
} else if (_root.currMovie != “home”) {
if (container._currentframe>=container.midframe) {
_root.currMovie = “home”;
container.play();
}
}
}
yes, you place the button code on the button inside your movie clip (smartclip).
*
on (rollOver) {
gotoAndPlay("Start");
}
that is fine
on (rollOut) {
gotoAndPlay("Stop");
}
that is good
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "home";
container.loadMovie("home.swf");
} else if (_root.currMovie != "home") {
if (container._currentframe>=container.midframe) {
_root.currMovie = "home";
container.play();
}
}
}
i see some potential problems with your on release code.
first of all when checking to see if a variable is equal to something the “==” should not have a space in the middle. Maybe it just appears that way in my browser… check that out. Also I’m not sure that undefined is a built in variable attribute in flash. Meaning your movie is looking for a variable that doesn’t exist. If you are defining _root.currMovie=“undefined”;
at some point, then you need to have quotation marks (denoting a string) in this line of code just as you do when you are initially declaring it.
also, the current movie is either home or it’s not. I would use something like this:
on (release) {
if (_root.currMovie != "home") {
_root.currMovie = "home";
container.loadMovie("home.swf");
} else if (_root.currMovie == "home") {stop;}
}
}
this code should load home.swf unless you already have it loaded.
what are you trying to accomplish with the movie clip “container?” I assume it’s a movie clip because you try to reference it’s frames…?
the code I’m using is from this tutorial
http://www.kirupa.com/developer/mx2004/transitions2.htm
I have transitions between button clicks.
So thats where the midframe junk and what not comes from.
This is my original templet but i didnt like how the buttons didnt flow smoothly. So i changed them into smartclips. You can see how my transitions are between buttons clicks if you click on projects and home. its far from done, but you will get the idea.
http://trinitymicrodesign.com/BCSI.swf
OK, this might make it easyer on you to understand. I want to merger these two tutorials into one.
http://www.kirupa.com/developer/mx2004/ani_smartclipnav2.htm
http://www.kirupa.com/developer/mx2004/transitions2.htm
have you defined midframe ?
Im not sure what you mean. Midframe is the point on the home.swf at which the code stops and waits to be initiated…
I think or thats what the tutorial says… I think.
Midframe is the point/frame between transitions.
Intro - Midframe - Outro
:chinaman:
I heard ya the first time thanks
My mistake.
Probably did, but I just like to be annoying (j/k)
I think Im going to give up on this one. I just cant seem to merge the two tutorials. I know a little about action script but not enough to solve this problem. Thanks for all your help you guys.
Cloak