Copy link to clipboard
Copied
Hi All,
I'm newer to Flash so don't take much for granted. I have big gaps in my understanding.
I've created a motion tween (by right clickingon a movieClip on the timeline and choosing 'create motion tween'). Now I want to reverse it (using the 'yoyo' term) when the sound file is done playing. I know how to do this with a tween (using tween class) that was created with actionscript in the first place. How can I cause it to reverse if the tween isn't already (named and included) my actionscript?
Thanks
If you tween is in a MovieClip you can effectively play the MovieClip backwards like this:
addEventListener(Event.ENTER_FRAME, enterFrame);
function enterFrame(e:Event):void {
prevFrame();
}
I do this all the time.
-Aaron
Copy link to clipboard
Copied
If you tween is in a MovieClip you can effectively play the MovieClip backwards like this:
addEventListener(Event.ENTER_FRAME, enterFrame);
function enterFrame(e:Event):void {
prevFrame();
}
I do this all the time.
-Aaron
Copy link to clipboard
Copied
Thanks for your reply, Aaron.
How do I use that? (IOW: Where do I put that script?, How do I indicate the name of the movie clip it's controlling?)
So, for example: I'm starting the tween in my movie clip by making it visible (its an image that fades up because it's alpha state is tweened) : "myMovieClip.visible = true"
When that image completely fades up, the image stays visible (100% of alpha state) for an indetermined amount of time then, I want a soundtrack cue to cause it to fade back down (tween back to 0% alpha).
This just happens once (not repeatedly).
Any help is appreciated.
Copy link to clipboard
Copied
Ok I realized that I put that in the frame script.
Thanks Aaron.
Copy link to clipboard
Copied
Now I just need to play that movie clip backwards when the sound file reaches a certain point. (I have already used a cuePoint in the sound file to make that movie clip to play forward).
IOW:
The script you sent:
addEventListener(Event.ENTER_FRAME, enterFrame);
function enterFrame(e:Event):void {
prevFrame();
}
..is in the frame script of the movie clip and it causes the movie to reverse as soon as it played forward to the end. How do I get it to only go in reverse upon cue?
Thanks
Copy link to clipboard
Copied
What I would probably do is put that play-backwards in a function, something like this:
function playBackwards():void {
addEventListener(Event.ENTER_FRAME, enterFrame);
}
Then you can give the MovieClip an instance name and call the playBackwards function from the parent:
myMovieClip.playBackwards();
- Aaron
Copy link to clipboard
Copied
Aaron,
You're probably assuming I know a lot more than I do. I'm getting this error: " TypeError: Error #1006: playBackwards is not a function. at reverseDissolve_fla::"
This is my action script in frame one of the main timeline:
// On Cue Point
function onCuePoint(event:CuePointEvent):void{
//This looks for only that cue point and takes action.
if (event.name == "dissolveUp")
{
faceOne_MC.visible = true;
faceOne_MC.play();// Makes the movie clip play (dissolves up using a tween).
}
if (event.name == "dissolveDown")
{
//now I need to dissolve down when she says "wanted" by playing the faceOne_MC in reverse
faceOne_MC.playBackwards();
}
}
function playBackwards():void
{
addEventListener(Event.ENTER_FRAME, enterFrame);
}
Copy link to clipboard
Copied
hold on. Ok I just realized that the
function playBackwards():void
{
addEventListener(Event.ENTER_FRAME, enterFrame);}
function enterFrame(e:Event):void {
prevFrame();
}
...goes in the frame script at the end of the dissolve in the movie clip.
Thanks much Aaron!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now