Solved

Hitting the enter key

Posted on 2002-04-01
3
203 Views
Last Modified: 2010-04-03
Here is a tricky one for you.

In a movie clip I need to have the user hit the 'Enter' key to move to frame 20.

a regular keyPress does not work within a movie clip, only on the main timeline as far as I can see and test.

on (keyPress "<Enter>") {
gotoAndPlay(20);
}


Any code ideas?

Thanks...........Rob

0
Comment
Question by:jsttriit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
mousefist earned 200 total points
ID: 6911022

hmm, well this *should* work as far as i can see.  if you are certain that you don't have another button anywhere else that's catching the enter key, then there are still a bunch of other ways to do this ... or try!

first, you could try to catch the keyDown with the movieclip itself: get the actions for the instance of the movie clip on the stage and put in:

onClipEvent(keyDown) {
  if (Key.getCode() == Key.ENTER) {
    this.gotoAndPlay(20);
  }
}

you may hafta fudge that a bit ... the scope is a little weird for those ... it might be this.movieclip.gotoAndPlay(20) ... sorry i don't quite remember!  ;-)

if that doesn't do anything, there's at least one other way i can think of.  if you are using mx, or if you at least are using the newest player, you could add an event listener.  if the first way doesn't do you any good, then lemme know and i'll walk you through using the listener.

m!
0
 

Author Comment

by:jsttriit
ID: 6911043
You got the points for thinking of it the same way I did.  As soon as I wrote similiar code, I saw your post.

Bascially I put another clip in my clip and made it do the checking.  Then when it saw an Enter keystroke I just made it talk to the parent.

Thanks....Rob
0
 
LVL 2

Expert Comment

by:mousefist
ID: 6911112
nice one!  thanks!

m!
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Flash doesn't load in Iphone and Ipad 22 503
Begin mp4 video on first frame 6 196
Google Chrome pepflashplayer.dll 8 236
Adobe Flash Player ActionScript error 6 74
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question