Note that there are some explanatory texts on larger screens.

plurals
  1. POAnimated presentation navigation by arrows - AS3
    primarykey
    data
    text
    <p>I'm new to AS3 and although I was looking for a solution to my problem truly long time, I was not successful. I have an animated presentation and I just want to make navigation through that by arrows. Everything is on the main timeline. In the first frame I made this code </p> <pre><code>var zpet: Number; if (currentFrame == 1) { zpet = 1; } stage.addEventListener(KeyboardEvent.KEY_DOWN, posun); function posun(event: KeyboardEvent): void { if (event.keyCode == 37) { addEventListener(Event.ENTER_FRAME, playReverse); function playReverse(event: Event): void { if (currentFrame == zpet) { stopPlayReverse(); } else { prevFrame(); } } function stopPlayReverse(): void { if (hasEventListener(Event.ENTER_FRAME)) { removeEventListener(Event.ENTER_FRAME, playReverse); } } } else if (event.keyCode == 39) { if (currentFrame &lt; totalFrames - 1) { play(); } else { stop(); } } } stop(); </code></pre> <p>Moving forward works perfect as I put <code>stop();</code> in every keyframe of the presentation. The problem is how to go back just to the previous keyframe (and I also want to go back in reverse playing). I thought it would be quite easy if I made a variable (called "zpet") and set it the specific number of frame where to go back in each keyframe. But it doesn't work, all the time it's going back to frame 1. For example I put in the frame 26 the code <code>zpet = 13;</code> that should say when playing back from the frame 26 stop at the frame 13. Any ideas how to solve this? I would be really grateful for that..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload