I have question about eventListeners been overwritten in a ENTER_FRAME event.I have an event that gets called on ENTER_FRAME which is creating a new twn every time but the tween is been saved in a temporary variable.The tween also adds a listener every time for the MOTION_CHANGE event.Does this MOTION_CHANGE event have to be removed every time so the events don't build up or are they garbage every time a new tween is created.Here is an example of a snippet of my code. Obviously there is many ways to do this but my code is setup this way for a larger reason.
I'm making a Flash website. I've got a TweenEvent, and after that, I want Flash to show me a different screen (keyframe, labeled "een"). What command should I give then?
I'm not sure about the bold line. Which command do I give instead of the WhatToEnterHere, or do I have to do something completely different?
I'm trying to get the clip on which the tweenevent was applied when TweenEvent.MOTION_FINISH is triggered. evt.target is always in the scope of the event/tween and never about the clip.
function X { switch 1) tween1 -> on tween finish launch onTweenFinish(); 2) tween2 -> on tween finish launch onTweenFinish();
[Code]....
results in: ReferenceError: Error #1069: Property name not found on fl.transitions.Tween and there is no default value.
What I want is to process all three tweens in a single function, but I need to know which tween it was. It is of course possible to make three separate functions, one for each tween, but that is just not proper.
I found this post on the Actionscript.org forums about TweenEvent dispatches not happening consistently.
I've come up against a similar problem in the past. The first thing to check is that the Tween instance does not go out of scope. For example (this is pseudo code).[cod]e...
How would I go about accessing the object I am moving with a tween through TweenEvent? or is this even possible? I think e.currentTarget will give me the tween object instead of the movieclip it is controlling, but I'm not sure.
Example: ActionScript Code: var tweens:Array = new Array();
I have an interesting problem here that I can't figure out. Here's the problem: This code works:
[Code]....
As you can see, I want the object to move in the x direction, then once it's done that I want it to move in the y direction instead of just doing both at once and going diagonal. One thing that is "interesting" is that the trace still spits out the word to the output window. But the object in the end has only moved to the x destination and never gets to the y.
I've got something like this: Tweener.addTween(captions.getChildByName("captionL ine_"+i),{x:0,time:5,transitio n:"linear,onComplete:ready}) function ready():void{ trace("Ready!") }
How do I have to alter this, so that I can trace the name of sprite on which the tween has been applied to? Some kind of event.target.name stuff, but how would the syntax need to look like?
How would I go about accessing the object I am moving with a tween through TweenEvent? or is this even possible? I think e.currentTarget will give me the tween object instead of the movieclip it is controlling, but I'm not sure.
Example: Code: var tweens:Array = new Array(); var aryObjects:Array = {mc1,mc2,mc3,mc4}; function someFunction():void { for(var i:int = 0; i < aryObjects.length; i++) { [Code] .....
Is it possible to access current mc the tween is moving through TweenEvent here? If not possible, how would I pass the current object in the loop to the function? I had one idea of creating a function within the addEventListener line and passing both the event and current object, but it is not working for some reason. Code: tweens[i].addEventListener(TweenEvent.MOTION_FINISH, function done(e:TweenEvent){tweenFinished(e,aryObjects[i]);}); I know that Tweener or TweenLite would work well but I want to do this without using them.
I have some simple script that has 2 "movie clips". What I want to do is to start moving the second movie clip at the same time when the 1st starts moving. (both start moving at the same time) I tried the following script but it never works: