Re: [Flashcoders] sequential tweens ?
Hi peeps, i think my post from a while ago, is related to this post: http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/msg17995.html It completely falls under zeh's opinion of overcomplication :), but i think there is a time and a place to either overcomplicate things or keep it simple :)) (but keeping it simple is soo hard). It light of that, i would only overcomplicate things and apply a sequential animation calling design pattern, if it is necessary to for example, exchange the order of effects at runtime, or support effects that you haven't thought of and that are added by others. Soo I by no means wish to hijack this thread, but i have a 5 week vacation coming up, and was still thinking on starting on what i called in my previous post some kind of sequencer framework, so beside the point which is the best solution for a simple foto wipe, it might be nice if I knew if others like you might like to have the thing i described in my post. Im talking about 2d sequences, but they could be 1d sequences or whatever. greetz Hans On 7/24/06, jcarlos [EMAIL PROTECTED] wrote: I think that there is time and occasion for each line of thought If you only want a serie of movements in time the solution proposed by Zeh is great and I tested it and it works fine, better would it be if he upgrade them to AS 2.0 and AS 3.0 -) But that are projects where we want some decision logic tree and solutions like those from Marty and Gerry seems more appropriate, in fact now that I begin to see the the problem clearer What I´d like to have to some suggestions is not to use some package like animationpackage ( it is fine the suggestion from marcelo serpa and I´m using it too) but as a provocative study matter how to develop one simple framework in terms I´ve thought first ( please excuse me if I´m tin the non-sense field here) From the framework´s user point of view he would only push Animation objects in some tree structure. and I begin wondering about to use some TREE to represent it where the nodes at the same level would be the Animation objects to run at the same time and going to low level the animation following the sequence from that node At first sight ( just exploring ideas) the Animation Class would have as properties the Object to be animated the desired Actions (Tween/Transition etc) Array to be applied to the Object Null/Child Animation Objects Array The logic I´d like to implement would the root object starts its job and when finished fire all ( if any ) its children nodes asynchronously and each node would wait the effect end before going down into low leves Does it maky sense ? -) João Carlos - Original Message - From: Martin Wood [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 6:29 PM Subject: Re: [Flashcoders] sequential tweens ? Martin, do not take this personally, I don't mean to sound rude or anything, I'm sorry in advance if I do, and your code totally makes logical sense and it's 100% correct, but... WHY would someone need so much code just to produce sequential tweenings? A bunch of specialized functions just to make it work? And then suppose he has an slightly different animation he wants to do at the same time, will he need new functions, or add parameters to those functions, and so long and so forth? Why something so convoluted for something so simple? Simply because the tweening doesn't support delays? :( don't worry i don't take it personally its only programming :) To me it doesn't seem complicated, just a couple of functions, nothing special in either function. If it doesn't fit the requirements, so be it. Sorry for the rant, but really, there's a moment you have to use the best tool for the task - and I don't mean only the easiest. The tweening classes included on Flash are cool and all that, but they're too basic, too raw. Why you'd need dozens of lines just to do something that can be done with one single line in a pretty straightforward way is beyond me. Most of the times I have to build sites, there's so much having to be animated correctly that if I resorted to functions and complex callbacks any time I needed some kind of sequence or delay, my code would be a complete mess and the sequence would be unmaintainable. Now, with delays it's as easy as it gets. It's easier to read, debug, write, change, etc. Don't be sorry, if it upsets you then best to let it out, bottling things up isn't good for the soul :) Anyway, to consider if its easier to change then it really depends on how you want to change it. In some cases yes its undoubtedly easier, in other cases i think it could be harder but I don't know the API of your tweening classes so I cant say. What if i wanted to trigger something when each tween ends? What if i want to perform an action depending on which tween has ended? Each solution has its pro's and con's so its worth understanding
RE: [Flashcoders] sequential tweens ?
Soo I by no means wish to hijack this thread, but i have a 5 week vacation coming up, and was still thinking on starting on what i called in my previous post some kind of sequencer framework, Obviously the word 'vacation' means different things to you than to me ;) Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
;-), well first 2,5 weeks are a real vacation no laptop on penalty of death, after that there are some hobby projects such as the logger and this thing that have been lying on my desk for too long now :) but hey no pressure On 7/26/06, Danny Kodicek [EMAIL PROTECTED] wrote: Soo I by no means wish to hijack this thread, but i have a 5 week vacation coming up, and was still thinking on starting on what i called in my previous post some kind of sequencer framework, Obviously the word 'vacation' means different things to you than to me ;) Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
I think that there is time and occasion for each line of thought If you only want a serie of movements in time the solution proposed by Zeh is great and I tested it and it works fine, better would it be if he upgrade them to AS 2.0 and AS 3.0 -) But that are projects where we want some decision logic tree and solutions like those from Marty and Gerry seems more appropriate, in fact now that I begin to see the the problem clearer What I´d like to have to some suggestions is not to use some package like animationpackage ( it is fine the suggestion from marcelo serpa and I´m using it too) but as a provocative study matter how to develop one simple framework in terms I´ve thought first ( please excuse me if I´m tin the non-sense field here) From the framework´s user point of view he would only push Animation objects in some tree structure. and I begin wondering about to use some TREE to represent it where the nodes at the same level would be the Animation objects to run at the same time and going to low level the animation following the sequence from that node At first sight ( just exploring ideas) the Animation Class would have as properties the Object to be animated the desired Actions (Tween/Transition etc) Array to be applied to the Object Null/Child Animation Objects Array The logic I´d like to implement would the root object starts its job and when finished fire all ( if any ) its children nodes asynchronously and each node would wait the effect end before going down into low leves Does it maky sense ? -) João Carlos - Original Message - From: Martin Wood [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 6:29 PM Subject: Re: [Flashcoders] sequential tweens ? Martin, do not take this personally, I don't mean to sound rude or anything, I'm sorry in advance if I do, and your code totally makes logical sense and it's 100% correct, but... WHY would someone need so much code just to produce sequential tweenings? A bunch of specialized functions just to make it work? And then suppose he has an slightly different animation he wants to do at the same time, will he need new functions, or add parameters to those functions, and so long and so forth? Why something so convoluted for something so simple? Simply because the tweening doesn't support delays? :( don't worry i don't take it personally its only programming :) To me it doesn't seem complicated, just a couple of functions, nothing special in either function. If it doesn't fit the requirements, so be it. Sorry for the rant, but really, there's a moment you have to use the best tool for the task - and I don't mean only the easiest. The tweening classes included on Flash are cool and all that, but they're too basic, too raw. Why you'd need dozens of lines just to do something that can be done with one single line in a pretty straightforward way is beyond me. Most of the times I have to build sites, there's so much having to be animated correctly that if I resorted to functions and complex callbacks any time I needed some kind of sequence or delay, my code would be a complete mess and the sequence would be unmaintainable. Now, with delays it's as easy as it gets. It's easier to read, debug, write, change, etc. Don't be sorry, if it upsets you then best to let it out, bottling things up isn't good for the soul :) Anyway, to consider if its easier to change then it really depends on how you want to change it. In some cases yes its undoubtedly easier, in other cases i think it could be harder but I don't know the API of your tweening classes so I cant say. What if i wanted to trigger something when each tween ends? What if i want to perform an action depending on which tween has ended? Each solution has its pro's and con's so its worth understanding the options and the trade offs. Like i said i don't find functions or callbacks complicated, its the bread and butter of programming. The code i showed is an idiom that I've used on a number of occasions, not just for sequencing animations but for various things that need treating in a consequential manner and aren't all necessarily time based. My advice is to still use another solution. MC Tween, laco's, Fuse Kit, it doesn't matter. Any of them will do the trick. Mine too :) I don't know any of the other animation kits so I couldn't vouch for their ease of use, size when installed or performance, but I've heard good things about those you mention. anyway..shop around, its always the way to get the best deal and the solution that fits your needs. Martin. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com
[Flashcoders] sequential tweens ?
Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished João, Your best bet would be to use some better tweening engine that allows delays. That way you could fire all your tweens at once without having to worry about setting callbacks or other events when each tween is finished - you just give a increasingly bigger delkay for each photo. Not only this makes some clearer and more straightforward code, but you could even animate it in a way that the photos' tweening time intersect each other, without being dependent on chained events. For this task I'd recommend mc tween, laco's tween, or the fuse kit. Any of them will do what you want, and there's probably a few more that I'm forgetting about. You *could* do it with your onMotionFinished event. You'd need to setup a function that fires the animation, and each photo would have to fire the animation on the next one. It's simple, but it's awkward and counterproductive. And really, this kind of need is something that comes up so frequently when animating an interface that using a class or extension that supports delays instead is your best bet. - Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- John Van Horn [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
yes .. I think it´s going to work .. I will try - Original Message - From: John VanHorn [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 2:00 PM Subject: Re: [Flashcoders] sequential tweens ? i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- John Van Horn [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
Hi João! Have you taken a look at Fuse or animationpackage? It makes sequential tweens much easir and straitghforward... Cheers, - Marcelo. On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: yes .. I think it´s going to work .. I will try - Original Message - From: John VanHorn [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 2:00 PM Subject: Re: [Flashcoders] sequential tweens ? i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- John Van Horn [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
Well I made some through the onMotionFinished but your app is fully dependent on all tweens having their opening job done, the app logic gets hidden inside a series of onMotionFinished wich you have to navigate through one by one. For example I´m doing a CD where I have a lot of opening activity and only after it I set the menus and display containers when I did it at first time I had just one function call createCD() and as all actions were sequentially dependents, to understand what the app did it was necessary to go from one function after another till I got the last one I was wondering about some colection or queue scheme where some animators objects ( object to be tweened, tweening properties ) would implement some interface and the complete animation chain would be achived in a FOR IN loop through the collection, am I missing something here ? I´d rather to invest more in code clarity than in some special tricks, even working for some time with OO I still have preference to realize what the app is doing in some structured fashion, maybe I´m overstressing it -) thanks for your time João Carlos - Original Message - From: Zeh Fernando [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 1:52 PM Subject: Re: [Flashcoders] sequential tweens ? Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished João, Your best bet would be to use some better tweening engine that allows delays. That way you could fire all your tweens at once without having to worry about setting callbacks or other events when each tween is finished - you just give a increasingly bigger delkay for each photo. Not only this makes some clearer and more straightforward code, but you could even animate it in a way that the photos' tweening time intersect each other, without being dependent on chained events. For this task I'd recommend mc tween, laco's tween, or the fuse kit. Any of them will do what you want, and there's probably a few more that I'm forgetting about. You *could* do it with your onMotionFinished event. You'd need to setup a function that fires the animation, and each photo would have to fire the animation on the next one. It's simple, but it's awkward and counterproductive. And really, this kind of need is something that comes up so frequently when animating an interface that using a class or extension that supports delays instead is your best bet. - Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
Hi Marcelo you had suggested that to me another time -) I will take a look on them right now -) João Carlos - Original Message - From: Marcelo de Moraes Serpa [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 4:19 PM Subject: Re: [Flashcoders] sequential tweens ? Hi João! Have you taken a look at Fuse or animationpackage? It makes sequential tweens much easir and straitghforward... Cheers, - Marcelo. On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: yes .. I think it´s going to work .. I will try - Original Message - From: John VanHorn [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 2:00 PM Subject: Re: [Flashcoders] sequential tweens ? i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- John Van Horn [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
couldnt you just use 2 methods in your class to control the sequence of tweens? // Start a tween for a photo private function tweenPhoto() { var animPhotoX:Tween = new Tween (photoStrip[currentIndex], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[currentIndex], _yscale, Bounce.easeOut, 100, 120, 0.5, true); // Get the tween to call us back when its finished animPhotoY.onMotionFinished = Delegate.create(this,tweenFinished); } // Tween finished private function tweenFinished() { currentIndex++; if(currentIndex == numberOfPhotos) { // The sequence is complete // do something, dispatch an event, call a method etc.. :) } else { startTween(currentIndex); } } Then to start the whole show just make sure currentIndex and numberOfPhotos are setup correctly and call tweenPhoto(); e.g. private function createPhotos(photolist:Array) { // photo creation stuff here currentIndex = 0; numberOfPhotos = photolist.length; tweenPhoto(); } no need for intervals or anything fancy. hope thats what you mean. Martin jcarlos wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
I can't recommend Zeh's MC Tween enough...you can sequence the tweens and even have callbacks when the tween is finished to call a function. Check out the documentation and examples here: http:// hosted.zeh.com.br/mctween/index.html Gerry On Jul 23, 2006, at 3:40 PM, jcarlos wrote: Hi Marcelo you had suggested that to me another time -) I will take a look on them right now -) João Carlos - Original Message - From: Marcelo de Moraes Serpa [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 4:19 PM Subject: Re: [Flashcoders] sequential tweens ? Hi João! Have you taken a look at Fuse or animationpackage? It makes sequential tweens much easir and straitghforward... Cheers, - Marcelo. On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: yes .. I think it´s going to work .. I will try - Original Message - From: John VanHorn [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 2:00 PM Subject: Re: [Flashcoders] sequential tweens ? i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- John Van Horn [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you
Re: [Flashcoders] sequential tweens ?
// Tween finished private function tweenFinished() { ... else { startTween(currentIndex); oops, this is meant to say tweenPhoto(currentIndex) my email client doesnt have refactoring support yet ;) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
couldnt you just use 2 methods in your class to control the sequence of tweens? // Start a tween for a photo private function tweenPhoto() (...) You see, that's what I'm totally against when writing code: overcomplication. Going around and around and around to come back and do something quite small. Martin, do not take this personally, I don't mean to sound rude or anything, I'm sorry in advance if I do, and your code totally makes logical sense and it's 100% correct, but... WHY would someone need so much code just to produce sequential tweenings? A bunch of specialized functions just to make it work? And then suppose he has an slightly different animation he wants to do at the same time, will he need new functions, or add parameters to those functions, and so long and so forth? Why something so convoluted for something so simple? Simply because the tweening doesn't support delays? :( Going back to the original post: if I were to code that using MC Tween (I'll use my code as an example, because I'm not so acquainted with other extension's code). Anyways, I'd do it like this: var delay = 0; for (var prop in photoStrip) { if (prop != _childCounter) { photoStrip[prop].tween(_yscale, 120, 0.5, easeinout, delay); photoStrip[prop].tween(_xscale, 120, 0.5, easeinout, delay); delay += 0.5; } } or even: var delay = 0; for (var prop in photoStrip) { if (prop != _childCounter) { photoStrip[prop].scaleTo(120, 0.5, easeinout, delay); delay += 0.5; } } or to use some other as1-less syntax, once again my own's zeh.easing.Tweener, a static as2 class which provide a one-shot method for animation triggering: import zeh.easing.Tweener; var delay = 0; for (var prop in photoStrip) { if (prop != _childCounter) { Tweener.addTween(photoStrip[prop], {_xscale:120, _yscale:120, time:0.5, transition:easeinout, delay:delay}); delay += 0.5; } } or just in one line (or maybe two with the 'import' statement): import zeh.easing.Tweener; for (var i:Number = 0; i photoStrip.length; i++) Tweener.addTween(photoStrip[prop], {_xscale:120, _yscale:120, time:0.5, transition:easeinout, delay:0.5 * i}); Really. WHY does it have to be more complicated than that? ..Functions? ..setIntervals? ..Delegates? What's next, a sequential animation calling design pattern with 10 different methods? Just for a one-shot sequential animation? And still making it more difficult and less practical -- less easy to change? It's just sequential animations, no secret, no big deal. Why not fit the solution to it, using any of the existing solutions that support delays, instead of going 1000 extra miles? Do programmers bill by number of functions they've written? Sorry for the rant, but really, there's a moment you have to use the best tool for the task - and I don't mean only the easiest. The tweening classes included on Flash are cool and all that, but they're too basic, too raw. Why you'd need dozens of lines just to do something that can be done with one single line in a pretty straightforward way is beyond me. Most of the times I have to build sites, there's so much having to be animated correctly that if I resorted to functions and complex callbacks any time I needed some kind of sequence or delay, my code would be a complete mess and the sequence would be unmaintainable. Now, with delays it's as easy as it gets. It's easier to read, debug, write, change, etc. My advice is to still use another solution. MC Tween, laco's, Fuse Kit, it doesn't matter. Any of them will do the trick. And probably next version of Flash's tweening functions, considering Robert Penner is working for them now. - Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] sequential tweens ?
Martin, do not take this personally, I don't mean to sound rude or anything, I'm sorry in advance if I do, and your code totally makes logical sense and it's 100% correct, but... WHY would someone need so much code just to produce sequential tweenings? A bunch of specialized functions just to make it work? And then suppose he has an slightly different animation he wants to do at the same time, will he need new functions, or add parameters to those functions, and so long and so forth? Why something so convoluted for something so simple? Simply because the tweening doesn't support delays? :( don't worry i don't take it personally its only programming :) To me it doesn't seem complicated, just a couple of functions, nothing special in either function. If it doesn't fit the requirements, so be it. Sorry for the rant, but really, there's a moment you have to use the best tool for the task - and I don't mean only the easiest. The tweening classes included on Flash are cool and all that, but they're too basic, too raw. Why you'd need dozens of lines just to do something that can be done with one single line in a pretty straightforward way is beyond me. Most of the times I have to build sites, there's so much having to be animated correctly that if I resorted to functions and complex callbacks any time I needed some kind of sequence or delay, my code would be a complete mess and the sequence would be unmaintainable. Now, with delays it's as easy as it gets. It's easier to read, debug, write, change, etc. Don't be sorry, if it upsets you then best to let it out, bottling things up isn't good for the soul :) Anyway, to consider if its easier to change then it really depends on how you want to change it. In some cases yes its undoubtedly easier, in other cases i think it could be harder but I don't know the API of your tweening classes so I cant say. What if i wanted to trigger something when each tween ends? What if i want to perform an action depending on which tween has ended? Each solution has its pro's and con's so its worth understanding the options and the trade offs. Like i said i don't find functions or callbacks complicated, its the bread and butter of programming. The code i showed is an idiom that I've used on a number of occasions, not just for sequencing animations but for various things that need treating in a consequential manner and aren't all necessarily time based. My advice is to still use another solution. MC Tween, laco's, Fuse Kit, it doesn't matter. Any of them will do the trick. Mine too :) I don't know any of the other animation kits so I couldn't vouch for their ease of use, size when installed or performance, but I've heard good things about those you mention. anyway..shop around, its always the way to get the best deal and the solution that fits your needs. Martin. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com