Re: [Flashcoders] Modifying movieclip property kills tween
You are allowed to change the properties of an object but if you want to change the properties of an object that is animated on the timeline you have to have a wrapper so that the effects applied to the wrapper are being passed down to its children. Now you can change the properties during playtime using code.. try something like this: square.addEventListener(Event.ENTER_FRAME, enterFrame); function enterFrame ( e : Event ) { square.x += 1; } square2.addEventListener ( MouseEvent.MOUSE_DOWN, mouseDown ); function mouseDown ( e : MouseEvent ) { square.y = 40; square.alpha = 0.4; } you will notice that the square will continue to move accross the screen and at the same time change its y property and alpha. On Wed, Jul 30, 2008 at 11:28 PM, Boon Chew [EMAIL PROTECTED] wrote: Hmm, this doesn't make sense. The property of an object should be allowed to change since it's not changed during an actual tween. Also, the property involved is not what's being tweened, so why would it nullify a tween done on it at a different time? - boon --- On Wed, 7/30/08, Helmut Granda [EMAIL PROTECTED] wrote: From: Helmut Granda [EMAIL PROTECTED] Subject: Re: [Flashcoders] Modifying movieclip property kills tween To: Flash Coders List flashcoders@chattyfig.figleaf.com Date: Wednesday, July 30, 2008, 1:49 PM This is the proper behavior since you are overriding the properties of the object itself. Such as if you were overriding the x, y, scale properties. You can wrap the object into a container and edit the properties of the container that then will be reflected into its child, in this case the box. On Wed, Jul 30, 2008 at 2:13 PM, Boon Chew [EMAIL PROTECTED] wrote: Hi all, I ran into something strange whereby if I modify a movieclip's property (say alpha), it would kill the tween that will take place later that involves the movieclip. Wonder if anyone has run into this? 1) In a test FLA, create a movieclip called test. Inside test, create two frames, start on frame 2 and end on whatever (say frame 30). 2) Put a movieclip called box on timeline and tween it from start to end. 3) In the main timeline, add this: stage.addEventListener(MouseEvent.MOUSE_DOWN, click); function click(event:MouseEvent):void { test.box.alpha = 1; // -- changing alpha value causes the tween to stop working, comment this out and tween works test.gotoAndPlay(start); // tween test.box by moving it across the stage } - boon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- ...helmut ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- ...helmut ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Modifying movieclip property kills tween
Whether it makes sense or not, Helmut is right and this is how it works. Changing the value of a property dynamically via code /detaches/ it from any tweening applied by the timeline. The ideal solution is have a container inside of it. Or, really, don't use the timeline tweening at all. Zeh Boon Chew wrote: Hmm, this doesn't make sense. The property of an object should be allowed to change since it's not changed during an actual tween. Also, the property involved is not what's being tweened, so why would it nullify a tween done on it at a different time? - boon --- On Wed, 7/30/08, Helmut Granda [EMAIL PROTECTED] wrote: From: Helmut Granda [EMAIL PROTECTED] Subject: Re: [Flashcoders] Modifying movieclip property kills tween To: Flash Coders List flashcoders@chattyfig.figleaf.com Date: Wednesday, July 30, 2008, 1:49 PM This is the proper behavior since you are overriding the properties of the object itself. Such as if you were overriding the x, y, scale properties. You can wrap the object into a container and edit the properties of the container that then will be reflected into its child, in this case the box. On Wed, Jul 30, 2008 at 2:13 PM, Boon Chew [EMAIL PROTECTED] wrote: Hi all, I ran into something strange whereby if I modify a movieclip's property (say alpha), it would kill the tween that will take place later that involves the movieclip. Wonder if anyone has run into this? 1) In a test FLA, create a movieclip called test. Inside test, create two frames, start on frame 2 and end on whatever (say frame 30). 2) Put a movieclip called box on timeline and tween it from start to end. 3) In the main timeline, add this: stage.addEventListener(MouseEvent.MOUSE_DOWN, click); function click(event:MouseEvent):void { test.box.alpha = 1; // -- changing alpha value causes the tween to stop working, comment this out and tween works test.gotoAndPlay(start); // tween test.box by moving it across the stage } - boon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Modifying movieclip property kills tween
Thanks Zeh Helmut for enlightening me on this. - boon --- On Thu, 7/31/08, Zeh Fernando [EMAIL PROTECTED] wrote: From: Zeh Fernando [EMAIL PROTECTED] Subject: Re: [Flashcoders] Modifying movieclip property kills tween To: Flash Coders List flashcoders@chattyfig.figleaf.com Date: Thursday, July 31, 2008, 7:15 AM Whether it makes sense or not, Helmut is right and this is how it works. Changing the value of a property dynamically via code /detaches/ it from any tweening applied by the timeline. The ideal solution is have a container inside of it. Or, really, don't use the timeline tweening at all. Zeh Boon Chew wrote: Hmm, this doesn't make sense. The property of an object should be allowed to change since it's not changed during an actual tween. Also, the property involved is not what's being tweened, so why would it nullify a tween done on it at a different time? - boon --- On Wed, 7/30/08, Helmut Granda [EMAIL PROTECTED] wrote: From: Helmut Granda [EMAIL PROTECTED] Subject: Re: [Flashcoders] Modifying movieclip property kills tween To: Flash Coders List flashcoders@chattyfig.figleaf.com Date: Wednesday, July 30, 2008, 1:49 PM This is the proper behavior since you are overriding the properties of the object itself. Such as if you were overriding the x, y, scale properties. You can wrap the object into a container and edit the properties of the container that then will be reflected into its child, in this case the box. On Wed, Jul 30, 2008 at 2:13 PM, Boon Chew [EMAIL PROTECTED] wrote: Hi all, I ran into something strange whereby if I modify a movieclip's property (say alpha), it would kill the tween that will take place later that involves the movieclip. Wonder if anyone has run into this? 1) In a test FLA, create a movieclip called test. Inside test, create two frames, start on frame 2 and end on whatever (say frame 30). 2) Put a movieclip called box on timeline and tween it from start to end. 3) In the main timeline, add this: stage.addEventListener(MouseEvent.MOUSE_DOWN, click); function click(event:MouseEvent):void { test.box.alpha = 1; // -- changing alpha value causes the tween to stop working, comment this out and tween works test.gotoAndPlay(start); // tween test.box by moving it across the stage } - boon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Modifying movieclip property kills tween
Hi all, I ran into something strange whereby if I modify a movieclip's property (say alpha), it would kill the tween that will take place later that involves the movieclip. Wonder if anyone has run into this? 1) In a test FLA, create a movieclip called test. Inside test, create two frames, start on frame 2 and end on whatever (say frame 30). 2) Put a movieclip called box on timeline and tween it from start to end. 3) In the main timeline, add this: stage.addEventListener(MouseEvent.MOUSE_DOWN, click); function click(event:MouseEvent):void { test.box.alpha = 1; // -- changing alpha value causes the tween to stop working, comment this out and tween works test.gotoAndPlay(start); // tween test.box by moving it across the stage } - boon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Modifying movieclip property kills tween
This is the proper behavior since you are overriding the properties of the object itself. Such as if you were overriding the x, y, scale properties. You can wrap the object into a container and edit the properties of the container that then will be reflected into its child, in this case the box. On Wed, Jul 30, 2008 at 2:13 PM, Boon Chew [EMAIL PROTECTED] wrote: Hi all, I ran into something strange whereby if I modify a movieclip's property (say alpha), it would kill the tween that will take place later that involves the movieclip. Wonder if anyone has run into this? 1) In a test FLA, create a movieclip called test. Inside test, create two frames, start on frame 2 and end on whatever (say frame 30). 2) Put a movieclip called box on timeline and tween it from start to end. 3) In the main timeline, add this: stage.addEventListener(MouseEvent.MOUSE_DOWN, click); function click(event:MouseEvent):void { test.box.alpha = 1; // -- changing alpha value causes the tween to stop working, comment this out and tween works test.gotoAndPlay(start); // tween test.box by moving it across the stage } - boon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- ...helmut ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Modifying movieclip property kills tween
Hmm, this doesn't make sense. The property of an object should be allowed to change since it's not changed during an actual tween. Also, the property involved is not what's being tweened, so why would it nullify a tween done on it at a different time? - boon --- On Wed, 7/30/08, Helmut Granda [EMAIL PROTECTED] wrote: From: Helmut Granda [EMAIL PROTECTED] Subject: Re: [Flashcoders] Modifying movieclip property kills tween To: Flash Coders List flashcoders@chattyfig.figleaf.com Date: Wednesday, July 30, 2008, 1:49 PM This is the proper behavior since you are overriding the properties of the object itself. Such as if you were overriding the x, y, scale properties. You can wrap the object into a container and edit the properties of the container that then will be reflected into its child, in this case the box. On Wed, Jul 30, 2008 at 2:13 PM, Boon Chew [EMAIL PROTECTED] wrote: Hi all, I ran into something strange whereby if I modify a movieclip's property (say alpha), it would kill the tween that will take place later that involves the movieclip. Wonder if anyone has run into this? 1) In a test FLA, create a movieclip called test. Inside test, create two frames, start on frame 2 and end on whatever (say frame 30). 2) Put a movieclip called box on timeline and tween it from start to end. 3) In the main timeline, add this: stage.addEventListener(MouseEvent.MOUSE_DOWN, click); function click(event:MouseEvent):void { test.box.alpha = 1; // -- changing alpha value causes the tween to stop working, comment this out and tween works test.gotoAndPlay(start); // tween test.box by moving it across the stage } - boon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- ...helmut ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders