Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-22-2012, 01:43 PM   #11
[afz]snickelfitz
Senior Member
 
[afz]snickelfitz's Avatar
 
Join Date: Dec 2011
Location: Tucson, AZ
Posts: 1,888
Default

My suggestions regarding object declarations and nested functions are a matter of best practices and code clarity. For example, declaring named movieclips provides a frame of reference and context for objects that appear in your code. Otherwise, these objects kind of just "magically" appear out of nowhere with no prior definition.
Nested functions will often work as expected, but this (questionable) coding technique really has very little useful context in most AS3 projects.

With regard to the curtain tweens, you can add the curtain to the displaylist and tween it within the same scope. ie: within the same function body {}
TweenMax has some very helpful methods for handling stuff like this economically, such as tweening from, to, fromTo, and the Array methods: allFrom, allTo, allFromTo, etc...
If fact, the tweening for your script could be handled very effectively and entirely within the constructor using TweenMax and/or TimelineMax.

TimelineMax is essentially what it sounds like: a configurable programmatic timeline composed of multiple TweenMax instances. It is extremely flexible, and has numerous options such as the fantastic updateTo() method which allows you to easily change the parameters for an actively running tween instance. For example, you can continuously update the x y destinations for a tween while it is running, which can lead to some fairly sophisticated effects with relatively little code.

The Greensock Animation Platform (TweenMax, TimlineMax, LoaderMax, BlitMask, and a host of other advanced classes) is probably the most productive aspect of AS3 development that I have learned in the past 5 years.
[afz]snickelfitz is offline   Reply With Quote
Old 08-24-2012, 11:32 PM   #12
jeteran
Registered User
 
Join Date: Aug 2012
Posts: 23
Wink

Quote:
Originally Posted by [afz]snickelfitz View Post
My suggestions regarding object declarations and nested functions are a matter of best practices and code clarity. For example, declaring named movieclips provides a frame of reference and context for objects that appear in your code. Otherwise, these objects kind of just "magically" appear out of nowhere with no prior definition.
Nested functions will often work as expected, but this (questionable) coding technique really has very little useful context in most AS3 projects.
Thanks so much snick for your suggestion. Thanks to you, I'm changing my code habits to make single-functions code, and actually is more effective that way. I already did it in the project I'm working right now.

About the TweenMax, I will dig in it in the next days, really looks very nice. I'm working right now on more important stuff :S !!

Any way, let's keep on touch; I will keep using this post for more questions about the curtain.

Thanks again !!
jeteran is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:43 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.