Results 1 to 6 of 6

Thread: One animation out for all

  1. #1
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default One animation out for all

    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.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Is your animation content-specific or is it a tween?

  3. #3
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    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:
    Code:
    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
    Code:
    midframe=19
    Mid frame is a stop command

    Last frame:
    Code:
    _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?

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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/dynam...eteRopost.html (Source)
    http://visualbinary.net/files/tutori...s/gotoAndStop/
    http://visualbinary.net/files/tutori...hows/loadMovie
    http://visualbinary.net/files/tutorials/tweener/

  5. #5
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Hey Medyman,

    Thanks for the tutorials, the only problem though is I work with timeline tweens not AS tweens.

  6. #6
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •