View Full Version : One animation out for all
nate51
04-13-2009, 09:17 PM
I have seen this in passing looking through tutorials but I cannot remember where.
Right now the method I use is very size wasting and basic, I create 1 animation for a page to animate out, then copy and paste the timeline for as many pages as the site has, and each animation out has a different end keyframe that calls up a different page.
(e.g. If I click on contact, that button tells my content_mc.home.gotoAndPlay("contact"); then it animates out but the last keyframe will go to _root.content_mc.gotoAndStop("contact"); which then animated in the contact page.
I am looking for a mthod that instead of 5 animations out per page, the last keyframe will have an open variable and the button you press fills in that variable.
I hope this makes sense, it's hard for me to explain.
Medyman
04-14-2009, 01:56 AM
Is your animation content-specific or is it a tween?
nate51
04-14-2009, 03:14 AM
It's tweens.
I stumbled onto something that has the same idea, but it works off external mc's I need internal mc's
Code for button:
on(release) {
if (_root.currMovie == undefined) {
_root.currMovie = "mc01";
_parent.container.loadMovie("mc01.swf");
} else if (currMovie != "mc01") {
if (_parent.container._currentframe >= _parent.container.midframe) {
_root.currMovie = "mc01";
_parent.container.play();
}
}
}
Code in the swf file:
First frame
midframe=19
Mid frame is a stop command
Last frame:
_parent.container.loadMovie(_root.currMovie+".swf")
This last line I can see being a problem becuase of the ".swf" extension, can that just be removed? so it ends with currMovie?
I have not tried replacing loadMovie with a gotoAndPlay command and the swf file with an mc name from an internal mc. Do you see anything in here that might pose a problem if it was internal?
Medyman
04-14-2009, 01:07 PM
I made demos long ago for other people when they asked the same question in these forums. I'm kind of embarrassed at the inefficiency of some of the code, but it will work and probably closer to the syntactic style that you're using.
You can view them and download the source at the page:
http://www.designsbyvishal.com/dynamicdrive/completeRopost.html (Source (http://www.designsbyvishal.com/dynamicdrive/completeRopost.fla))
http://visualbinary.net/files/tutorials/slideshows/gotoAndStop/
http://visualbinary.net/files/tutorials/slideshows/loadMovie
http://visualbinary.net/files/tutorials/tweener/
nate51
04-14-2009, 01:29 PM
Hey Medyman,
Thanks for the tutorials, the only problem though is I work with timeline tweens not AS tweens.
nate51
04-15-2009, 09:20 PM
Basically what I am trying to do in a nut shell is have a button (home) have some kind of variable in it that says 'home'.
And the end of a timeline tween animation would have an AS frame that has an open variable that the 'home' would fall into so that when the animation is done it goes to that flag.
And abviously contact and projects etc. would do the same (e.g. contact button has 'contact' variable, end of timeline loads that and goes to 'contact' flag)
I hope that makes more sense than before.
I just feel this is the easiest way to go about it and I have seen things like this before I just don't know where.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.