Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > Simple Stuff (Newbies)

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-28-2007, 06:01 AM   #1
wozrey
Registered User
 
Join Date: Jul 2007
Posts: 6
Default Im totally stuffed with this

Hi guys...
Im still totally lost with the keyboard "hold down" issue.
I am totally new to Action Script and have no idea what and where a listener does or is.
Can someone out there take the time to go step by step through what I need to do to get a movie to change frames on keyboard input....this is easy i know...but what I require is the frame to be held during the time the key on the keyboard is pressed, not just have the frame jump for a second then flash back. Naturally, I would like the original frame to jump back only after the keyboard key is released.
Here is the code i am currently working with...anything beyond this is a complete shambles to me....

onClipEvent (enterFrame) {
gotoAndStop(1);
}
on (keyPress "<Left>") {
gotoAndPlay(2);
}

If there is someone out there in digital land that could walk me through this, I would be eternally thankful. It is the only code I desire to use for what I need, and am desperate.
wozrey is offline   Reply With Quote
Old 07-28-2007, 06:57 AM   #2
panel
AS3
 
panel's Avatar
 
Join Date: Mar 2007
Location: Warsaw
Posts: 1,991
Send a message via Skype™ to panel
Default

Handle keyevents example 1

ActionScript Code:
var myListener:Object = new Object(); myListener.onKeyDown = function () {     trace ("You pressed a key. kedy code is: " + Key.getCode());         if(Key.getCode() == 37)     {         trace("left arrow pressed")     }     else if (Key.getCode() == 39)     {         trace("right arrow pressed")     } } Key.addListener(myListener);

Handle keyevents example 2
ActionScript Code:
var myListener:Object = new Object(); myListener.onKeyDown = function () {     trace ("You pressed a key. kedy code is: " + Key.getCode());         switch(Key.getCode())     {         case 37:             trace("left arrow pressed")             break;         case 39:             trace("right arrow pressed")             break;     } } Key.addListener(myListener);
panel is offline   Reply With Quote
Old 07-28-2007, 07:09 AM   #3
wozrey
Registered User
 
Join Date: Jul 2007
Posts: 6
Default

Thanks duder,
but where does this code go exactly????
is this code all that I will need or do i need to add it to the tail or head of the simple keypress code i already have???

Sorry...as I said, it is all gobbly gook to me.
It would be great if someone could actually ecxplain whats going on in this text jumble so that I can learn rather than just copy and paste...

sorry, but im still lost.
I know u all got heaps going on for yaselves, so thanx in advance for all ya help and time.
wozrey is offline   Reply With Quote
Old 07-28-2007, 09:29 AM   #4
panel
AS3
 
panel's Avatar
 
Join Date: Mar 2007
Location: Warsaw
Posts: 1,991
Send a message via Skype™ to panel
Default

just put it at pirst frame on mail timeline
panel is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
totally stuck!! oxygenSean ActionScript 2.0 3 10-30-2006 05:02 AM
going totally CSS for designing web sites Navarone General Chat 3 11-26-2005 01:01 PM
TOTALLY remove movieclip rippazinc ActionScript 2.0 5 06-05-2005 01:00 AM
Totally non-flash related maths question Laguana General Chat 0 05-20-2005 09:38 AM
Totally Cracking up mickt ActionScript 1.0 (and below) 28 01-06-2004 10:06 PM


All times are GMT. The time now is 07:08 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.