different buttons on the same scene


#1

does any1 know if it is possible to make animation for different buttons on different time levels on the same file?

for example if i want my button to rotate while the mouse is over so i write:

on (rollOver)
{
play();
}

but if i got other buttons or any animated objects they also move while i’m over this button.

so i wanted to ask if there is a way to work on several different buttons on the same file, or you just export each button to a different swf file and then work on them in an html editor?

tal


#2

you need to use different movieclips for each animation, give them each an instance name, then target those with your play statements, something like

_root.movieclipname.play();

this thread may be useful, the FLA i posted there may help you out some.

chris


#3

OK, your file helped me learn alot
so
thanx
:thumbsup:
but i still didn’t understand if it’s possible and how to name my movie clips other than _root or _this and what’s the difference between them.

also when i try to do this on my buttons (i mean “movie clips”) they don’t seem to move with these commands
but if i try it on a simple sphere or squar it works fine.

i guess there is something wrong with my buttons.

do you have any idea what could be a problem? (or, maybe i’ll just make 'em all over again and it will work fine this time, because they look horrible anyway)


#4

Buttons and Movieclips have different commands and syntax. Movie Clips need onClipEvent handlers. Buttons get different handlers (on (release, rollout, etc)).

_this is telling flash to target your current location in the movie. If I have Scene1>>MovieClip1>>SubMovieClip1>>SubSubmovieClip1 and MovieClip2 and MovieClip3 and Button 4 etc, and I am currently wanting located on MovieClip2, I can apply an action to it’s timeline using “_this”.

_root. goes directly to the heart of the movie in the main timeline, no matter where you are.

You know when you look at your folders in Windows? You have folders that all branch out from C: and they all have subfolders?..Well, that’s how Flash knows where to go.

_root.moviclip1.submovieclip1.subsubmovielip1 will drill you down through the clips to your subsubmovieclip.

Just remember to use instance names on your mc’s or it won’t work.

Good Luck
Dain


#5

Ok, i got all my buttons work fine now.

Dain said:

Movie Clips need onClipEvent handlers. Buttons get different handlers (on (release, rollout, etc)).

I Tried using the on(release) function on my movie clips and it worked fine.
“onclipevent” have different functions (mouse move, enter frame,etc. what the hell those means anyway?)

anyway tanx for the info.


#6

“EnterFrame” means just what the name implies. When the playhead reaches that movie clip and enters that frame, the action will be triggered. MouseMove waits for the user to move the mouse before the event is triggered. onLoad triggers an action when a movie is Loaded into your main movie (like using the LoadMovie() command. Unload actions will occur when the movie is unloaded. The keyDown and keyUp actions wait for the user to either press the key, or release the key (you determine which key) respectively.

Looking forward to seeing your site.

Dain


#7

since flash MX came out you have been able to use the

on (press/release/etc)
{

}

button functions on movie clips and they will behave as a button would, becase buttons and movieclips are now of the same prototype.

the difference between on (mouseEvent) and onClipEvent (event) is that the former will only be triggered when the mouse button is clicked AND is within the bounds of the movie/button. the latter will work globally (eg onClipEvent (mouseDown))


#8

lately ive been working totally within action scripting, you could just rotate the button using that. something like

_root.MovieClipName.onMouseDown = function () {
MovieClipName.onEnterFrame = function () {
this._rotation += 20;
}
}

and then to end the rotation say on mouse up

_root.MovieClipName.onMouseUp = function () {
MovieClipName.onEnterFrame = null ();
}

i dunno somethin like that, removes the need for tweens and stuff.hope this helps


#9

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.