Jump to content


Photo
* * * * * 1 votes

TIP:MC_Tween2 for SM2


  • Please log in to reply
26 replies to this topic

#1 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 17 October 2008 - 07:46 AM

Ok, this is pretty cool stuff, and something new for us to play with.

Still uses the penner equations, but has been brought together into a very cool library of prototypes.
Works with a couple of the flash8 filters, sound control as well as your basic penner tweens.

Most of the tween engines I've come accross are written in full as2 or higher, with classes, packages and all that, so it was great to find one that works with SWiSHMax2.

I've taken the most impressive flash examples, and made SM2 versions of each, including the original as file and created an external file for sm2(mc_tween2.sm2) and put them into the zipfile posted below.

I think this could be built upon, and really expand on the work already done.
The author has moved on to a as3 version, so I don't think any more updates will be made to this version...unless we do it ourselves.

I haven't done a lot of reading in the docs for this.
I pretty much did what I always do...jump right into the middle of it, and start playing a bit and get the general idea...yadda, yadda, yadda :)



Just what the hell is MC Tween?

MC Tween is a free library of prototypes that can be used on Flash MX and above (with both AS1 and AS2) to create property tweenings dinamically using several different easing equations - in practical words, creating easing animations via simple and small coding. Also called a tweening extension, MC Tween is just a bunch of actionscript code you can add to your Flash movies via a #include command. You will then have several "new" MovieClip, TextField and Sound methods and functions at your hand.
...more...


http://hosted.zeh.com.br/mctween/

===============================================================================
= MOVIECLIP/TEXTFIELD/SOUND TWEENING PROTOTYPE(s)
-------------------------------------------------------------------------------
=
= MC_TWEEN
= Created to be a helpful tweening extension for mortal users
= Find documentation and examples at the site:
= http://hosted.zeh.com.br/mctween/
=
= By Zeh Fernando
= z [AT] zeh.com.br
= 2003-2006
= Sao Paulo, Brazil
= http://www.zeh.com.br
=
-------------------------------------------------------------------------------
=
= This tweens given movieclip properties from their current values to new values,
= during an specified time. It's inspired by Jonas Galvez's simpleTween method
= and created to be *easy* to non-experienced coders (designers).
=
-------------------------------------------------------------------------------
===============================================================================
Other disclaimers
-------------------------------------------------------------------------------
All easing equations used here (and a few other auxiliary functions) are
based on Robert Penner's work. To find more information:

http://www.robertpenner.com/easing/

What follows is the equation use's license:
-------------------------------------------------------------------------------
TERMS OF USE - EASING EQUATIONS

Open source under the BSD License.

Copyright � 2001 Robert Penner
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------


Home | Using MC Tween | Documentation | Animation Types | Downloads | Examples | Extensions | Author & Disclaimer | Links

I've taken the most impressive flash examples, and made SM2 versions of each and put them into this zipfile.
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#2 Bendeguz

Bendeguz

    Advanced Member

  • Members
  • PipPipPip
  • 292 posts
  • Gender:Male
  • Location:Canada

Posted 17 October 2008 - 07:56 AM

This is neat stuff. awesome job.

#3 Wolf Gross

Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 24269 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 17 October 2008 - 10:00 AM

Larry...can you please adjust your footer to the forums requirements.

BTW...please note that there also limits on the size of your footer/signature here -
Maximum footer/Signature Size
300 pixels wide x 40 pixels high x 15 kb maximum file size is what we allow, or 4 lines of text.

davidp


Thank you

wolf
footer.gif

#4 Wolf Gross

Wolf Gross

    Advanced Member

  • Moderator
  • PipPipPip
  • 24269 posts
  • Gender:Male
  • Location:Perth/Australia

Posted 17 October 2008 - 10:52 AM

...thanks Larry! (btw ...don't shoot the messenger :) )

wolf
footer.gif

#5 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 22 October 2008 - 05:28 AM

I wasn't very happy with the fact that this mc_tween didn't have the dropshadow added, nor the fact that some settings in each of the flash
filters were not able to be set in the trigger script, so I desided to see
what I could do about that.

Attached is my updated mc_tween2 sm2 file and the filter test swi

I've shown 2 different ways to trigger each of the animations.
I am a bit happier with this, as all the filter setting are now in place.

(2008) Oct 19-
FlawlessDog.com updates
Added drop shadow. needs some work yet at this point.

(2008) Oct 20-
Changed the filter setup to bring back full control of all settings
This means each filter will have all settings adjustments
Also means each setting will be longer then the original author had it

(2008) Oct 21-
Fixed color transform for droppshadowFilter
Seems there was a syntax error I missed in the attribute names for
dropshadow filter color and alpha settings.
Also, we should note that color transformations do not like easing
equations that bounce in any way, such as the elastic or back equations.

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#6 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 22 October 2008 - 06:52 AM

Here is the update with all examples included

enjoy!

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#7 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 22 October 2008 - 08:06 AM

For those Macromedia Flash8 people interested in the prototype approach,
here is the Macromedia Flash8 as file and updated filtertest.fla

enjoy, and many thanks to Zeh
for posting my work on his site.
MC Tween's website (on the yellow banner at the top of all pages).
http://hosted.zeh.com.br/mctween/

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#8 Maarten26

Maarten26

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts
  • Gender:Male
  • Location:Utrecht, Netherlands

Posted 23 October 2008 - 03:05 AM

Here is the update with all examples included

enjoy!


Hi,

I was experimenting with your first tweener version and therefore I thank you. However when trying your new version and even trying an example (of yours) I get errors when playing in the internal player, externally it works as it is supposed to.

Something in the likes of:

This movie has script that is too long or complex in 'Scene_1.but_4.onSelfEvent (load)' in statement:
Scene_1.but_4::onSelfEvent (load)
{
// Sets the first, default _alpha value
this._alpha = 50;

// Stor...

Is there something wrong with your updated script?

Greetz

#9 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 23 October 2008 - 03:08 AM

Hi,

That is a weakness with the internal SWiSHMax2 player.
If you use Ctrl + T to test the movie, it will work just fine.
I had the same error all thru out the development of the Carmex Lip Balm web site.

Actually, I got that error with the first version as well as the updated version of mc tween.
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#10 Maarten26

Maarten26

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts
  • Gender:Male
  • Location:Utrecht, Netherlands

Posted 23 October 2008 - 03:40 AM

Thanks for the amazing quick response!

But maybe you can help me with the following error in using the first version?

I've attached the file, don't know what the error is about?

ERROR: Cannot find 'backwardCallbackTweening'
mc_tween2.sm2, line 558: if (_global.backwardCallbackTweening)

(see the file)

I didn't have the problems you described with the first version though, only this error. But with the second version it's going to make debugging quite difficult!

Thanks again and great work by the way!

(Edit) I tried to include your tweenfile (mc_tween2) for convenience (for others: This file need to be in the same directory of the .swi for the tweening script to be included) but I'm not entitled to the luxury of including this filetype as an attachment. See top of post for download.

Greetz

Attached Files



#11 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 23 October 2008 - 06:19 AM

I would simply not use that version.
Use the newest version as that will be the one that works best.
http://forums.swishz...=...st&id=35748 <-- click
I only left the old one there for comparison sake.

...maybe I should delete that first one...
done...

Updated file:
http://forums.swishz...rt=#entry265860


For an external app to debug, try gsb's debuger
http://www.gypsytrad...bTraceHELP.html
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#12 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 23 October 2008 - 07:10 AM

...I've attached the file, don't know what the error is about?

ERROR: Cannot find 'backwardCallbackTweening'
mc_tween2.sm2, line 558: if (_global.backwardCallbackTweening)


This has to do with the script:
if (_global.backwardCallbackTweening) {
		// Old style, for compatibility.
		// IF YOU'RE USING AN OLD VERSION AND WANT BACKWARD COMPATIBILITY, use this line:
		// _global.backwardCallbackTweening = true;
		// ON YOUR MOVIES AFTER (or before) THE #INCLUDE STATEMENT.
		var childMC = objProp._targ.createEmptyMovieClip("__child__", 122344);
		objProp._callback.apply(childMC, null);
		childMC.removeMovieClip();
	} else {
		// New method for 2.12.9: use the mc scope
		// So simpler. I should have done this from the start...
		// ...instead of trying the impossible (using the scope from which the tween was called)
		objProp._callback.apply(objProp._targ, null);
	}

Add the line to your movie according to the instructions.
_global.backwardCallbackTweening = true;

I'm not sure what it's there for, but that will get rid of the error.

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#13 Maarten26

Maarten26

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts
  • Gender:Male
  • Location:Utrecht, Netherlands

Posted 23 October 2008 - 07:33 AM

Sweet job Eggs,

You figured it out fast as you did with the solution. I will try the new version with the external debugger, though it's too bad its necessary.

Nice job by the way on the Carmex Lip Balm website, I think it's a solid website and fits with the product, effective but not too fancy.

Greetz

PS: I think you did an excellent job adoping this script into swishmax2 and if 'my plan comes together' I'll try and make a contribution of my own.

#14 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 23 October 2008 - 07:43 AM

Thanks.
We'll have to post a something about the internal player weekness in the wishlist forum, or something.
I may go do that now, infact.
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#15 pedromau

pedromau

    Advanced Member

  • Members
  • PipPipPip
  • 411 posts

Posted 03 December 2008 - 03:16 AM

Maybe here's the right place to do it...
Since I've downloaded lasted SM2 build 2008.11.21, this method is giving me errors...
Even using your attached file (post #7), when opening the files and exporting, it don't gives errors, but the files don't work anymore!

Now I'm in stand by mode because this issue!

What happened?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users