3D animation plays in reverse ?
I am trying to prepare a simple video of a book opening. You can see the file here:
https://docs.google.com/file/d/0B-cQQhdwl3C-b3JPYlM0SGZERnM/edit
If I scrub the timeline, the book opens as you would expect. However, when I test publish it, ir plays in reverse. Does anyone know why ? Incidentally, I put a stop action at the end to stop it looping. Any help would be greatly appreciated.
Regards,
TL.
You can/should keep all your actionscript in one place whenever possible, and in your case I see no reason why you cannot have it all in the same frame/layer.
If you use the "cover" in that code, it is still trying to turn the cover. You can probably reuse that same function for all page turnings as well. Just change that function to be a little more generic and define the page that is to be turned....
var page:MovieClip;
function turnPage(evt:Event):void {
page.rotationY += 2; // adjust value for speed or change frame rate
if(page.rotationY == 180) stage.removeEventListener(Event.ENTER_FRAME, turnPage);
Then you can have a new function that you call that assigns page to be the new object and sets up the ...
function startTurning(pg:MovieClip): void {
page = pg;
stage.addEventListener(Event.ENTER_FRAME, turnPage); // this starts the turning
And when you want to turn a page you call that function with the object's name as an argument.
startTurning(cover);
start turning(leaf1);
startTurning(leaf2);
Similar Messages
-
Making movie clips play in reverse in AS 3.0
Hey all. I'm changing all my files to AS 3.0 because of some
new elements I'd like to use in flash CS4.
Here:
http://www.iaw-atlanta.com/IvyLeague1-13-09.html
I have the menu navigation at the bottom with 4 buttons. When the
buttons are moused over they ascend and when they are moused out
the movie plays in reverse so that they descend. Basically in the
movie clip, I have it stopped as well as gotoAndPlay the next frame
when the button is moused over and then have a script telling it to
reverse when moused out. I know how to do this in AS 2.0 but how
can I translate the script to 3.0?DjPhantasy5,
> Ok thanks, I'll see what he also has to say as well.
Actually, NedWebs pretty much nailed it. :) The approach
you've taken
is an interesting one, because it scales all the way back to
Flash Player 5,
which didn't yet support the MovieClip.onEnterFrame event.
Without that
event, you need something like your "controller" symbol -- a
separate
looping timeline -- to perform code that depends on frame
loops.
Available as of Flash Player 6, that event would allow you
to
consolidate your code a bit by putting it all in a single
frame and avoiding
the extra movie clip symbol. That doesn't mean your approach
is wrong, by
any stretch. In fact, it's good to know your options, because
if you ever
need to publish to Flash Player 5, you'll probably do best to
use the setup
you've taken.
I'll demonstrate onEnterFrame in just a bit, in case you
want to take a
look at that.
>> there's no _root reference in AS3, but you can use a
>> MovieClip(this.parent) (which replaces what _parent
>> used to do) to locate something outside of the
immediate
>> movieclip.
The term "parent," in this context, is technically a
property of the
MovieClip class, which means all movie clips in AS3 have
access to the
"parent" feature, which points to the timeline that contains
the movie clip
in question. Buttons also feature a "parent" property. In
AS2, this
property acted exactly the same, only it was preceeded by an
underscore.
In fact, NedWebs' suggested code works the same in your
existin file.
Instead of this:
// Your existing code ...
if (_root.animation._currentframe>1) {
_root.animation.prevFrame();
this.gotoAndPlay(2)
if (_root.animation._currentframe<=1) {
this.gotoAndStop(1);
... you could be using this:
// Alternative code ...
if (_parent.animation._currentframe>1) {
_parent.animation.prevFrame();
gotoAndPlay(2)
if (_parent.animation._currentframe<=1) {
gotoAndStop(1);
... because from this scope -- that is, from this point of
view -- the
MovieClip._parent property points to the same timeline that
_root does.
That changes, of course, based on how deeply nested the
current scope is.
The term "this" in the above code is optional, because Flash
understands
what scope you're in. From the point of view of this code,
_parent is
understood to refer to the current scope's parent timeline,
just like
gotoAndPlay() is understood to refer to the current scope's
own timeline.
You could precede either of those by "this" or not.
Many people will argue that _root is probably best avoided,
only because
it's a slippery slope. It doesn't always refer to the main
timeline you
think it does, depending on whether or not your SWF is loaded
into another
SWF at runtime. Meanwhile, _parent *always* refers to the
immediately
parent timeline.
So when you look at it that way, this perfectly valid AS2:
if (_parent.animation._currentframe>1) {
... isn't much different at all from its AS3 counterpart:
if (MovieClip(parent).animation.currentFrame>1) {
It would be nicer if you didn't need to cast the parent
reference as a
movie clip here, but if you don't, AS3 doesn't realize that
the scope in
question is a movie clip.
>> You can string them along as...
>> MovieClip(this.parent.parent)
Exactly.
>> Your _currentframe in the the controller becomes
>> currentFrame. That's about it. The rest of what I
>> saw will fly as is.
Not quite. AS3 doesn't support the on() or onClipEvent()
functions, so
you won't be able to attach your code direction to the
button. Instead,
you'll have to put it in a keyframe -- which you can also do
with AS2. It's
a good idea, in any case, because it allows you to put all
your code in one
place, making it easier to find.
Here's a quick note on direct attachment:
http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent
To convert your existing FLA structure to AS3, you might,
for example,
do this:
animation.buttonMode = true;
animation.addEventListener(MouseEvent.ROLL_OUT, outHandler);
animation.addEventListener(MouseEvent.ROLL_OVER,
overHandler);
function outHandler(evt:MouseEvent):void {
controller.gotoAndPlay(2);
function overHandler(evt:MouseEvent):void {
controller.gotoAndPlay(4);
That takes care of the on(rollout) and on(rollover) code in
your current
version. The first line (buttonMode) is only necessary
because I got rid of
the button symbol and, instead, associated the event handlers
directly with
your animation clip. (Movie clips handle button-style events,
too, so you
don't need the button.) In AS3, event handling is very
straightforward:
you reference the object (here, animation), invoke its
inherited
addEventListener() method, then pass in two parameters: a)
the event to
listen for, and b) the function to perform when that event
occurs.
You can see that spelled out above. In AS2, there are quite
a few ways
to handle events, including on()/onClipEvent(), so it's
harder to know when
to use what approach. For buttons and movie clips, the
princple works the
same as I just showed, but the syntax is different.
Let's take a quick look at reducing all this code by using
the
onEnterFrame event. First, check out this AS2 version:
animation.onRollOut = outHandler;
animation.onRollOver = overHandler;
function outHandler():Void {
this.onEnterFrame = reversePlay;
function overHandler():Void {
this.onEnterFrame = null;
this.play();
function reversePlay():Void {
this.prevFrame();
All of that code would appear in frame 1. You don't need the
controller
movie clip. The animation clip no longer contains an orb
button, because
we're using animation itself as the "button". (You can always
see what
functionality any object has by looking up its class. If
you're dealing
with a movie clip, look up the MovieClip class. See the
Properties heading
to find out what characteristics the object has, see Methods
to find out
what the object can do, and see Events to find out what the
object can react
to.)
In the above code, it's all laid out pretty easily. This is
AS2,
remember. We have two events we're listening for:
MovieClip.onRollOut and
MovieClip.onRollOver. Those events are established for the
animation movie
clip by way of its instance name, and associated with
corresponding custom
functions. The outHandler() function associates yet another
function to the
MovieClip.onEnterFrame event of the animation clip. Very
simply, it
instructs animation to perform the custom reversePlay()
function every time
it encounters an onEnterFrame event. The overHandler()
function kills that
association by nulling it out, and telling animation to play,
via the
MovieClip.play() method. Finally, the reversePlay() function
simply invokes
MovieClip.prevFrame() on the animation clip.
Here's the AS3 version:
animation.buttonMode = true;
animation.addEventListener(MouseEvent.ROLL_OUT, outHandler);
animation.addEventListener(MouseEvent.ROLL_OVER,
overHandler);
function outHandler(evt:MouseEvent):void {
animation.addEventListener(Event.ENTER_FRAME, reversePlay);
function overHandler(evt:MouseEvent):void {
animation.removeEventListener(Event.ENTER_FRAME,
reversePlay);
animation.play();
function reversePlay(evt:Event):void {
evt.target.prevFrame();
It looks wordier, but if you look carefully, you'll see that
it's
essentially the same thing. The main difference is the way
scope works in
AS3. In AS2, there are numerous references to "this", because
the event
handler functions operate in the same scope as the object to
which the
association is made. In AS3, the references aren't to "this",
but rather to
the same animation clip by its *intance name*, because in
AS3, the scope
operates in the same timeline in which the code appears
(namely, in this
case, the main timeline).
In the reversePlay() function, in order to emulate a "this"
sort of
setup, I'm referring to the parameter that gets passed to all
event handler
functions in AS3. I happened to name it "evt" (for event),
but you can call
it what you like. In the case of reversePlay(), the evt
parameter refers to
an instance of the Event class, which has a target property.
The target
property refers to the object that dispatched the event --
happens to be
animation, in this case. So evt.target, in this context,
refers to
animation, which is what I invoke the MovieClip.prevFrame()
method on.
I've uploaded a handful of FLA files to my server. I won't
keep them
there forever ... maybe a couple weeks, as of this post:
http://www.quip.net/RewindTestAS3.fla
http://www.quip.net/RewindTestAS3_new.fla
http://www.quip.net/RewindTestAS2_new.fla
David Stiller
Co-author, ActionScript 3.0 Quick Reference Guide
http://tinyurl.com/2s28a5
"Luck is the residue of good design." -
PLEASE LOOK AT MY NEWEST POST!!
Hello, I was wondering if someone could guide me a little
with playing a movie clip in reverse. The major problem I'm having,
though, is that I have a frame-by frame animation withing a movie
clip called 'card' of a card flipping over. Now 'card' itself is
also tweened to move to the left and change in size as it flips
over, and also has an independent drop shadow for effect. So I need
to have everything go in reverse; the frame-by frame within 'card',
as well as the right to left tween and drop shadow on the main
timeline.
My ultimate goal is to have the user click on the card, it
will flip over in one direction, click on it again, and it will
reverse and flip back to it's original position.
Thanks in advance for any help on this.
PWell, I've decided to take a completely new approach.
I have reversed the frames in my movie clips, and I am far
closer to what I want to achieve. However, I still need to find a
way to remember if the card has flipped already, and when to flip
from frame 1.
Here are my files, please do have a look:
Fla
swf
I would still prefer to play in reverse, but I cannot figure
this out...
Cheers for any insight!
P -
Inserted swf animation plays slowly 50% of the time.
Hi, I am currentlyhaving a problem where i am trying to add a swf file animation to a captivate 6 project.
the swf is made in flash 4 and is at most 2mb big.
there is lots of moving things in the swf file.
Basically, when i add the swf to any project (heavily tested) or even a blank project:
the cpu jumps to 45%ish
the animation plays slowly at points or constantly, if i move forward a page, then move back it pretty much always is smooth like it should be but if i go to next page then back again, this time it could be slow. there seems to be no tangible pattern to whether or not the animation will run choppy or smooth.
My animation originally was in layers, i systematically broke it all down so that everything moving is on the first layer now.
There's a lot of masks in my animation.
Both captivate and flash are/were set to 30 fps.
I have been trying to fix this for weeks now but to no avail, i have exhausted every bit of advice i can find.
Remember, the problem still persists even on a blank project.
If anyone can help me, that would be greatly apppreciated. I will be around for the next hour then on again tomorow (and the day after, and the day after)
thanksok, i got into contact with adobe. Afer about 30 mins it seems the problem is only when i preview, when i actually publish the project, it is fine.
So for other people experiencing this problem, publish your project (even publish a dummy copy) and test that if your previews are playing back slowly and unpredictably. I get the feeling this is a problem thats been happening with a lot of people because nobody wants to publish something that doesnt seem to be working. -
Hi. Please can anyone show me how to install a flash document / movie into a powerpoint presentation so that the animation plays within the powerpoint? Thanks
wouldn't it make more sense that a flashtard is someone who
just generally sucks at flash and asks idiotic questions?
anyway, so i pretty much got the banner done - but i'm stuck
on one problem. I made a motion clip of a heart, and i want the
heart to fall from top to bottom, following a squiggly motion
guide, and to rotate 1/4 turn on the way. I got it as far as
following the motion guide, but when i try to select the instance
in the first frame and rotate it, shouldn't the motion tween make
it appear to slowly rotate, rather than stay put then rotate 1/4
turn at the last frame? When I select the clip and play around with
alpha and stuff, that works fine. What the heck? -
Making the main stage timeline play in reverse.
Hey all thanks for looking. I figured out how to do this with movie clips but I can't seem to get it right with the main stage. Can anyone tell me a simple methood of telling the stage to continue playing in reverse, after a button is clicked, until it reaches a keyframe that will tell it to stop? I'm trying to make it so buttons will tell the stage to play a transition from beginning to end and then have it play in reverse when the "back" button is pressed. I'm currently searching online to find an answer but I haven't had any luck yet. Thanks for the help!
KgIad -- tried to use this code but I am getting
TypeError: Error #2007: Parameter listener must be non-null.
Which appears to be caused by the changeTimelineF not being recognized. If I create it as
private function changeTimelineF(e:Event) {
if(startFrame<endFrame){
e.currentTarget.mc.nextFrame();
} else {
e.currentTarget.mc.prevFrame();
if(e.currentTarget.mc.currentFrame==e.currentTarget.endFrame){
e.currentTarget.removeEventListener(Event.ENTER_FRAME,changeTimelineF);
Then it is recognized--but the variables (e.g. startFrame and endFrame) are no longer valid.
What am I missing?
Thanks
Mike -
Animation - plays in larger size than specified
Has anyone experienced this issue, or can please advise me on
what I can do?
I have inserted several swf animations into a course, and the
animation has been specified in constraints as 300 x 300. The
constraints are also "locked" at 300 x 300.
When I run the course, the animation plays at a larger size,
"spilling" outwards in all 4 directions, so that I can see the all
the rough edges of the animation. I guess that what I see is what a
Flash programmer would see when editing the animation in Flash.
Any ideas would be great thanks!I have to wonder what you mean by "rough edges of the
animation," and constraints locked at 300 x 300.
If you want the finished project to display at 300 x 300
pixels, then you must define that 300 x 300 area at the very
beginning. Then, only images 300 x 300 or smaller can be brought
into the project.
When you publish the project as an SWF, then it will only
display 300 x 300 pixels. The HTML file Captivate publishes along
with the SWF (assuming you allowed that) embeds the movie with the
300 x 300 dimensions within the browser. If you choose not to
publish the HTML file, then opening the SWF directly will generally
cause it to fill the browser window, as you seemed to describe.
The "rough edges" thing really has me perplexed. It's almost
as if you expect to be able to mask off a portion of the screen and
see only that masked area -- not the full dimensions of the movie.
That's definitely not possible in Captivate.
If I misunderstand what your problem is, you might try
again. -
Getting a movie clip to play in reverse
I have this script to play a movie clip.
What do I write to get it play in reverse?
function fadeUp(event:MouseEvent):void {
buttonFadeOver_mc.play()You need to use an enterframe event listener to continuously call prevFrame() until you see that you have reached the starting frame (by checking the currentFrame property). Once you detect you are at the start you remove the event listener.
-
How do i have clips play in reverse
I need help! How do u make the clips in your movie play in reverse and the music play forward HELP!!!!!!!!!!!!!!!!!!!!!
'Search' is your friend..
read reply on same topic here..
http://discussions.apple.com/click.jspa?searchID=10830738&messageID=7320531
.. and please avoid double posts.. http://discussions.apple.com/thread.jspa?threadID=1550375&tstart=0 -
Hi there
I have an adobe DPS document with several pages, and edge animations on each page. I want each animation to play from the start when each page is opened, however, the playback seems to be very inconsistent. Some animations play from the start, others half way through, and some playback incorrectly. I want to also be able to return to each page and have the animations reload, instead of just displaying the final frame of the animation.
I have played around with the delay time which doesnt seem to fix it.
Any advice would be greatly appreciated.
DanHi, Im DPS projects medias like video, audio, animation html5 dosen´t reload inside the same article, just between the articles. Better produce articles just one page and change pages with horizontal swipe Regards
-
Hi All
I decided to make a Star Wars srolling title for my cousins birthday. Unfortunatley, it's playing in reverse. Any suggestions on how to flip it and how to add audio?
Thanks in advance
DeanWith the video in keynote:
Rewind movie (by frame if paused) J (hold down)
Pause or play movie K
Fast-forward movie (by frame if paused) L (hold down)
Jump to beginning of movie I
Jump to end of movie O
Look under the help menu/keyboard shortcuts in keynote for more shortcuts...
Also in keynote if you hold the cursor over the video...the video controls will appear (set this in keynote's preferences). -
Make a clip play in reverse?
I can't find it on the website...I have this SUPER funny fall of this person...why we all laugh at that?....WELL I want to have the person fall, and then all of a sudden he is played in reverse, and then fall again, etc, back and forth....
I know how to pause it, and slow motion it, mirror it, etc, but I want that reverse and back down again....I'm sure it is possible and easy???
Any insight would be GREATLY appreciated...and will post the youtube link as soon as I finish it!
Thanks,
Danwhen you have the clip selected in the sequence, take the razor blade tool and cut the clip at where you want the reverse to begin. then, delete the rest of the clip after it, and insert a copy of the clip that you want reversed. select the copy, then click Modify>Speed. when the window comes up, just check the "reverse" box, and click ok.
Hoped that helped. -
Stopping Edge animation play after page visit.
I have an Edge animation as a banner on my homepage. I was wondering how, if for example someone landed on my homepage the animation plays out, then navigates to my portfolio page, then back to the homepage, the animation would not play again. I think I'm trying to go the more is less route, also I think it will increase overall page loading speed, than trying to replay the animation everytime you return to my homepage. I hope this made sense. Thanks.
Hi there, the first thing that comes to mind is to use session storage. Set a variable "isFirstTime", and check it on Stage.compositionReady in Edge. You can then jump to the end of your timeline, effectively skipping the animation. Alternately, you could set and check session storage outside of Edge, and swap out the div's contents to either contain Edge content, or a static image, etc.
Here is a good example:
http://www.w3schools.com/html/html5_webstorage.asp
Session storage stores data until the user closes the browser, so they would see the animation again if they closed the browser and visited your site they next day, but they wouldn't see it again on the same visit. -
Red screen appears when Flash animation plays inside Captivate
Has anyone experienced this problem? A Flash animation inserted into Captivate displays a red screen briefly when the animation plays. I've never had this happen before.
Ideas?Hi there
Someone else recently reported the same behavior in the thread linked below:
Click here to view the thread
Cheers... Rick
Helpful and Handy Links
Captivate Wish Form/Bug Reporting Form
Adobe Certified Captivate Training
SorcerStone Blog
Captivate eBooks -
Is there a way to keep an animation playing for a mouseout event when you start a new one?
I have some buttons that on mouseover they animate scaling up and on mouseout they scale back down. This is working great except the scenario when a user mouse's over one button then immediately mouse's out to the next button the animation on the first button abruptly stops and the animation starts on the current button. Is there a way to keep the animation playing for the first button AND have the animation play work for the second button?
I have uploaded a quick demo to illustrate what I mean. Also I've uploaded the project file if anyone can find a solution. Thanks!
Dropbox - edgeAnimateButtonSample.zipYou need to create two symbols for these two buttons, so that both can play simultaneously.
I have created a sample for you @ https://www.dropbox.com/s/e59agt7mr8r785l/newedgeAnimateButtonSample.rar?dl=0
hth,
Vivekuma
Maybe you are looking for
-
Can't set Transition times. iMove does it's own thing random times.
When I try to enter a transition time between clips it may actually change but not to what I had entered. If it changes at all, it tends to be to a random number. I have the preferances set at 3:00 but even this does nothing, the default remains at
-
The Data Modeler is a great Tool within SQL Developer. Will there be a possibility to work with it, without installing Subversion extension in the next Version of SQL Developer?
-
VPDs - Am I missing something?
I'm trying to set up VPD in an existing 8.1.7 system. I've read the Openworld paper by Scherer, the Oracle magazine article by Davidson and chapter 12 of the 8.1.5 version of the ADG. I've seen nothing to indicate that an INSERT policy should behave
-
Infotype header - best practice
Hi group Today our ifnotype headers are created in a way that makes us have to break a lot of infotypes just to refresh the header. There are 2 reasons in my opinion: - We have chosen to read header on infotype begda - We have eg. position informatio
-
El Volumen macintosh esta dañado y debe repararse
Tengo problemas con el disco duro, en utilidad de discos al verificar me sale que le volumen Macintosh esta dañado y debe repararse Error: Este disco debe repararse mediante.. o desde OS X, selecione utilidad de discos. He entrado en la ayuda, y he r