Storing X/y Values During Mouse ISDOWN
I'm working on a painting app that lets you paint freehand on the stage. I need to store the drawn values (x1,y1,x2,y2...xn,yn) in an array and export them. Is there anybody that could help me come up with a function to accomplish this?
Thanks!
porp
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-05-2007, 02:32 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Storing X/y Values During Mouse ISDOWN
I'm working on a painting app that lets you paint freehand on the stage. I need to store the drawn values (x1,y1,x2,y2...xn,yn) in an array and export them. Is there anybody that could help me revamp my current function to accomplish this?
Here's the function that controls the freehand:
Code:
MovieClip.prototype.freeHand = function(){
if(isDown){
c.lineTo(this._xmouse, this._ymouse);
trace(this._xmouse);
}
}
Thanks!
Mouse Left Button IsDown: Key.isDown(1) Doesn't Work On Macs
Some of you may or may not be aware that the following code can detect that the mouse button is down. (Something that's oddly missing from the Flash API.)
Code:
if (Key.isDown(1)){
trace("left mouse button down");
}
if (Key.isDown(2)){
trace("right mouse button down");
}
However, this has been reported to not work on Mac computers!
I do not recommend using / relying on the above code.
The question is: Is anyone aware if there exists a Key Code for the Mac mouse button?
I do not own a Mac and do have close contacts to people with one, so I cannot test this for myself.
Mouse Left Button IsDown: Key.isDown(1) Doesn't Work On Macs
Some of you may or may not be aware that the following code can detect that the mouse button is down. (Something that's oddly missing from the Flash API.)
Code:
if (Key.isDown(1)){
trace("left mouse button down");
}
if (Key.isDown(2)){
trace("right mouse button down");
}
However, this has been reported to not work on Mac computers!
I do not recommend using / relying on the above code.
The question is: Is anyone aware if there exists a Key Code for the Mac mouse button?
I do not own a Mac and do have close contacts to people with one, so I cannot test this for myself.
ASCII Values For Key.isDown
Is there anyway to use the ASCII value of character to check when that key is pressed. ex:Key.isDown(191) for ¿
Storing Values In Variables?
Wondering how I can I store variable information so that when a movie is relaunched it can retrieve that data...
a thanks ahead for you help
Storing Values Using Loop
I have five buttons on stage and I simply want to trace "1" when I click the first button and trace "2" when I click the second button and so on.
Here is the code
Code:
var buttonsArray:Array = new Array('sil_btn', 'sfl_btn', 'srl_btn', 'srf_btn', 'shpl_btn')
for(var i:Number = 0; i< buttonsArray.length; i++)
{
i = pressed;
this[buttonsArray[i]].onRelease = function()
{
trace("buttonNumber"+i)
}
}
I am always getting the last number and cannot figure out, how to store the values.
Storing Values Using Loop
I have five buttons on stage and I simply want to trace "1" when I click the first button and trace "2" when I click the second button and so on.
Here is the code
Code:
var buttonsArray:Array = new Array('sil_btn', 'sfl_btn', 'srl_btn', 'srf_btn', 'shpl_btn')
for(var i:Number = 0; i< buttonsArray.length; i++)
{
i = pressed;
this[buttonsArray[i]].onRelease = function()
{
trace("buttonNumber"+i)
}
}
I am always getting the last number and cannot figure out, how to store the values.
Question About Variables - Not Storing Values?
I'm having a trouble with variables that really makes *no* sense to me whatsoever. It goes against everything I've learned in any coding language. Why is it that flash seems to arbitrarily decide when it will and won't store a value into a variable? I know that that's obviously not the case, but I've been tracing a variable to figure out why my if statement is never executing.
I have a movie clip that I've created with code using the attachmovie function. The object is named "sprite" afterwards.
I've created a sprite.onLoad = function(), and in that, several variables are declared, including the one I'm testing, canMove. Then, in the sprite.onEnterFrame = function() event, I have it tracing canMove. canMove is set to true in the onLoad function, but when I trace it, I get 'undefined'.
I tried to declare canMove in the onEnterFrame function, for testing purposes. I declared it the line ABOVE the trace, and I still continuosly got 'undefined'.
I changed the code from
code: var canMove:Boolean = true;
to
code: var canMove:Number = 1;
and I continued to get undefine. Finally, I just said,
code: this.canMove = 1
and I got a result.
So, I moved the code back to the onLoad event, and again started getting undefined.
What is the difference between all these declarations? Why does this.canMove = 1 and not var canMove:Number = 1 work? This is really frusturating me, as this is supposed to be a really simple line of code, yet it's stopping me cold in my tracks.
Storing Unique Values - PROBLEM
hi there,
I have a problem with storing unique values in collection array. One value is constructed with "h" + changable value from a - l + number from 1 - 8.
I made dynamic script that user can construct value for example ha1 or hd5 or hb8 etc and stores them in collection array. collection array should store only unique values. But unique values can be only differentiated by changable value from a - l. So if collection has ha1 it can't have ha2 as a happens twice and its not unique. So if user choose ha2 and there is already ha1 in collection array then ha1 is going to be replaced with ha2. Is this clear?
Anyway, I have done the script I attach below and i will appriciate anyone how is going to help me as I get slowly mad. At the moment after selecting any a value the message is traced saying the "a" is detected.
It is bit complex script but I know it can be done quite easy way, but I am still learning ActionScript.
Here is coding:
PHP Code:
var credits:Object = new Object();
var hourValue:Object = new Object();
var hourName:Array = new Array();
var collection:Array = new Array();
var collectedValues:Array = new Array("a", "a");
for (var p:Number = 97; p<109; p++) {
hourValue = "h"+chr(p);
hourName.push(hourValue);
//trace(p);
}
for (var i:Number = 0; i<109; i++) {
credits = _root["tab"+chr(i)];
credits.letter.text = chr(i);
creditCharacter = chr(i);
credits.onPress = function() {
creditLetterSelection = this._name.substr(3, 1);
for (var k:Number = 0; k<hourName.length; k++) {
_root[hourName[k]].onRelease = function() {
this.hours.text = creditLetterSelection;
twoLetters = this._name.substr(0, 2);
oneLetter = this._name.substr(1, 1);
if (collection.length<12) {
temp = "h"+oneLetter+creditLetterSelection;
collection.push(temp);
for (var l = 0; l<48; l++) {
switch (collection.join("").charAt(l)) {
case "a" :
case "b" :
trace("detected:"+collection.join("").charAt(l));
break;
}
}
trace(collection.join(""));
} else {
stop();
}
};
}
};
}
thanks a lot for any help
Storing Several Values Externally And Updating Them
I think I need a bit of help here.
I am working on a piece in which I want to keep track of what all users -- whenever they might view the piece -- do within the piece. There are really only two options for users [A or B] and I want to keep track of what each viewer does and then the total number of viewers.
I have no problem getting info from external txt files via loadVars; my question is whether I can then change the content of a txt file out of flash.
Alternately is there a way I can trigger a JAVA class to perform the necessary manipulations of the txt file.
I am hoping there is a way I am missing for ActionScript to rewrite a txt file that I am missing, or perhaps some other way to store an variable that can be accessed and updated each time a new user views the piece that isn't reset each time the swf is loaded.
I would greatly appreciate your suggestions.
Thanks.
Storing Values In Multiple Loops
for (var s = 0; s<mainSections.length; s++) {//grabbing the fabric types Handblocks,Screenprints,and Wovens
for (var i = 0; i<subSection.length; i++) { //grabbing each fabric design of the fabric type
for (var d = 0; d<matSection.length; d++) {//grabs each material type sub section of each fabric design
for (var t = 0; t<startThumbs.length; t++) {//finally processing the thumbs within the material type section.
I have these forloops going through an xml file. getting each section, sub section... eventually getting to the actuall fabric and thumbnail.
So in the last forloop is where I load the thumbs. When the person clicks a thumb I want to record the values of s i d... t I can store in a holder variable but the rest I dont know how to record.
Essentially I want to know what thumb the person clicked.
Storing And Loading Values With Flash Executable
Dear all,
I have written a flash application to do calculations on a evaporator.
http://home.hccnet.nl/m.dijk/pressur...lcs/calcs.html
Now the user is asking to store his calculations and reload them whenever the stand-alone *.EXE is started again. How can I do this?
Please tell me you advice, many thanks,
Carfi
Key.isDown For Mouse
Hi.
Is it possible to use the Key.isDown command to detect the left button of my mouse? Something like Key.isDown(mousedown);
Would there be any ascII value for the mouse button?
I know I could use an invisible button covering the whole movie and use the on(press) method but I was wondering if there was another way.
[F8] Key.isDown(8) And Key.isDown(Key.BACKSPACAE) Problem
Hey,
I need to know when the backspace key is pressed. I've added a key listener and everything seems to work. However, the backspace key ONLY works if I click inside an input text box and then press it - otherwise the keyListener.onKeyDown function isn't called.
I don't want to use an input text box - I want the function to call without it - so how do I fix this?
Thanks for any help!
EDIT: I've just noticed that the same is happening for the "." and "," keys. No other keys do this, as far as I can see.
Scripting Questions & Mouse Values
I have made a small slide show. It is controlled by a "filmstrip" that I have applied a small script to, to make it horizontally navigateable. I got the code from this tutorial:
http://www.flashkit.com/tutorials/In...-744/index.php
And I can get it to work, sort of. Attached is the sample .fla. When I publish, My mouse is activating the scroller, but not only when it is actually over the scroller. Here is the script:
onClipEvent (mouseMove) {
xmousepos1 = _xmouse;
ymousepos1 = _ymouse;
if (xmousepos1>xmousepos2 && ymousepos1>-98 && ymousepos1<-33) {
_root.scrollclip.nextFrame();
}
if (xmousepos1<xmousepos2 && ymousepos1>-98 && ymousepos1<-33) {
_root.scrollclip.prevFrame();
}
if (ymousepos1<-98 || ymousepos1>-33) {
play();
}
xmousepos2 = _xmouse;
ymousepos2 = _ymouse;
}
Now, the tutorial told me, that I would have to alter the values-98, and -33, to fit my own movie. Problem is, I don't know what these relate to, or what to change them too...Any ideas? I have been trying to bust this out for two days, and just can;t get it right...Please assist!
Q
Getting Two Coordinates On Key.isDown(1) And On Key.isDown(1)
Hi Ive tried like hell to do the following little script but invane.
I want to hold down the mouse button - Key.isDown(1)
- record the coordinates where the mouse button is clicked
Move the mouse cursor arround while holding down the mouse button.
When the mousebutton is released - !Key.isDown(1)
- record the coordinate where the button is released.
I can make a textbox and display the coordinates of the mouse at all times - but only recording the FIRST coordinate (when mouse i held) and the LAST (when mouse is released) seems to be very hard?
Anyone know how this could be done?
Is there an alternative to isDown? isPressed or something like that which I've missed?
Cheers,
Mads
Generating Random Values For A Variable While Excluding The Already Generated Values
Hey Flashers:
Here's my question this time around. I want to generate random values between 1and 50 for a variable but I want every time I generate the new value to exclude the already generated values from the pool of options. Something like playing the lottery where no two drawn numbers can be the same. Any hints or references to open code will be greatly appreciated.
As always, thanks a lot!
Function Populated By Node Values Returning Undefined Values
I have been working on some code which extracts the information from an xml document, styles it with css and then loads the various node values into a text field and arrays. The user click on a link in the text field which calls myFunction using asfunction and that in turn should enter the array values relating to that link into text fields.
Everything in general seems to work OK except the value that is returned to the two text fields on pressing the link in the CCTextField "which in turn calls myFunction" returns undefined for those values of the arrays. I check the agency[2] value in the function that populates the arrays and the value is returned as it shoiuld be so it appears there must be something amiss with myFunction, or at least it would seem so.
Any takers as to what this problem might be?
I have supplied some shortened code below.
PHP Code:
CCTextField.styleSheet = myStyle;
// NOTE: CCTextField styleSheet has been created beforehand
my_xml = new XML();
// NOTE: my_xml has been created beforehand
my_xml.onLoad = function(sucess) {
if (sucess) {
processXML(my_xml);
}
};
// Load up the XML file into Flash
my_xml.load('TEST.xml');
// This is the function that will be called when
// the XML document is loaded succesfully
function processXML(xmlDoc_xml) {
var listText_comm = ""; // List text variable
var entryNum = 0; // Entry number variable
var agency = new Array(); // Agency array
var production = new Array(); // Production array
for (var n = 0; n<xmlDoc_xml.firstChild.firstChild.childNodes.length; n++) {
categoryNodeName = xmlDoc_xml.firstChild.firstChild.childNodes[n].nodeName;
if (categoryNodeName == "client") {
listText_comm += "<a href='asfunction:_root.myFunction," + entryNum + "'>" + xmlDoc_xml.firstChild.firstChild.childNodes[n];
trace("client " + xmlDoc_xml.firstChild.firstChild.childNodes[n]);
} else {
if (categoryNodeName == "title") {
listText_comm += " - " + xmlDoc_xml.firstChild.firstChild.childNodes[n] + "</a>";
trace("title " +xmlDoc_xml.firstChild.firstChild.childNodes[n]);
} else {
if (categoryNodeName == "agency") {
agency[entryNum] = xmlDoc_xml.firstChild.firstChild.childNodes[n].firstChild.nodeValue;
trace("agency " +xmlDoc_xml.firstChild.firstChild.childNodes[n].firstChild.nodeValue);
} else {
if (categoryNodeName == "production") {
agency[entryNum] = xmlDoc_xml.firstChild.firstChild.childNodes[n].firstChild.nodeValue;
trace("production " +xmlDoc_xml.firstChild.firstChild.childNodes[n].firstChild.nodeValue);
entryNum++; // click over the entry number by 1
}
}
}
}
}
trace("AGENCY 2 = " + agency[2]); // this returns agency number 2 OK
_root.CCTextField.text = listText_comm; // CCTextField shows this text OK
}
function myFunction(listItem) {
clientF = agency[listItem]; // THIS RETURNS undefined ON PRESSING THE LINKS IN CCTextField
productionF = production[listItem]; // THIS ALSO RETURNS undefined ON PRESSING THE LINKS IN CCTextField
trace(listItem); // this trace = the list item passed by asfunction OK
}
[MX] Weirdness With Values Used By Array Populated Clip Values.
Hi,
I have used invisible buttons on top of some text, as part of a volume control interface.
The text buttons are set out as 0 – 25 – 50- 75 -100 referring to the % that a music tracks volume will change to once a button is pressed – so far so good.
Now to give values to the text buttons in order for them to make the text clip that they are on top of go to & stop & the right frame I have used arrays to give a reference the location of the text clip:
numbs_array = [_root.volHold_mc.vol0, _root.volHold_mc.vol25, _root.volHold_mc.vol50, _root.volHold_mc.vol75, _root.volHold_mc.vol100];
I then reference that in a home made “release” function as “this.monica.gotoAndStop(2);” “monica” being the reference to the address of the clip.
It all works fine except the code seems to make the movie play clips in an order that they have not been designated in the array – Like a button on top of the “25”% value will play the animation for the “75”% clip?
The whole problem is probably much better seen through the movie – the problem section of which i have attached below.
Passing Values From ASP To Change Alpha Values Etc
Is this possible? I currently have a log in system, logging each page a user visits, these visits amount to a value and have this value passed to flash to control alpha values, tints etc to reflect look and feel. is this possible?
Database Values To Array Values
Hi all,
I've created a movie which uses a number of arrays to construct the elements of a flash-based gallery.
What I need is a practical method of getting values from a database into an array via an ASP page.
The plan was to load the variables into these arrays using the an asp page and a loadvars object to create a string (basically the array values in quotes separated by commas) which was then to be inserted into the parameters for the creation of the array. Needless to say this hasn't worked- the create array object seems to interpret the whole string as the first value in the array, i can't find a way of populating the array from just a single asp page.
I've given up with this method and really need a few pointers.
Thanks
If(Key.isDown....
i know how to use this function, but is it possible to use
for example: A & D instead of LEFT and RIGHT?
How do i use Letters in this function?
Key.isdown, Key.whatever
when you want something to happen, you can write
if(key.isDown(key.UP))
but if you want something to happen, or stop, when you lift up on a button, what do you write?
Key.isDown
How do I use the Key.isDown method with an ASCII key? I can do it with Space, etc, but hw do I do it with a regular letter key?
If (Key.isDown(Key.RIGHT And Key.DOWN))?
is there a way to make the key down recognize when you press two arrow keys to make something move diagonally? I want to make it show a diagonal walk sequence when i press two of the arrow keys but ... can't figure it out i'm sure it's easy. I know how to make the walking sequece show up ... just not how to make it recognize the two keys pressed.
Key.isDown
I am trying to control something using ascii characters for keys
Key.isDown(99)
99 is the 'c' key but I think syntax is wrong above
Key.isDown(Key.DOWN)
this is ok!
Regards
DL
How To Use Key.isDown
Hello!
This will be simple. I would like to know, if it is possible to use Key.isDown(Key.SOMEKEY)... without assigning it to an object. I have seen this example in flash help:
code:
onClipEvent (enterFrame) {
if(Key.isDown(Key.RIGHT)) {
this._x=_x+10;
} else if (Key.isDown(Key.DOWN)) {
this._y=_y+10;
}
}
Is it possible to stop _root by it without putting the code on a MC?
Thanks!
Key.isDown
I am using FLah MX 2005.
code:
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_root.speed += 1;
}
}
when i hold the left arrow down it keeps adding 1 i want it to only add 1 for every press or when i release
The Key.isDown
I know to make a user hold down a key in a MC you do the code:
Code:
if (Key.isDown(Key.SPACE)) {
// do stuff
}
But how do I make it to when you hold down a key like H or M and it does something?
Key.isDown HELP
I have the following code as a pause button as my game is run threw a timer...
Code:
onClipEvent (enterFrame) {
_root.frame = _root.timer._currentframe;
if ((Key.isDown(Key.SPACE)) and (_root.pauser._currentframe == 1)) {
_root.timer.gotoAndStop(_root.frame);
_root.pauser.gotoAndStop(2);
} else if ((Key.isDown(Key.SPACE)) and (_root.pauser._currentframe == 2)) {
_root.timer.gotoAndPlay(_root.frame);
_root.pauser.gotoAndStop(1);
}
}
When i press space the pause MC appears and then disperes. I know why this happens but i cant figure out a way around it...
Key.isDown(13)
I seem to be having a silly problem, I just learned how to use listeners to avoid having to use loops for certain situations, and for somereason the code below doesnt work when I see if enter (13) has been pressed, but works for anyother key, whats going on ?
Code:
input_text = new String();
text_enter = new Object();
text_enter.onKeyDown = function() {
if (Key.isDown(13)) {
trace("ENTER WAS PRESSED");
}
};
Key.addListener(text_enter);
[F8] Key.isDown
How do you make it so if you press alphabetical letters (a, b, c, d, etc...) it does an action?
[CS3] No Key.isDown
how can i check if NO key is pressed?
is
Code:
if (!Key.isDown())
possible?
[AS2] [CS3] If Key.isDown
Its annoying me now I basically want to make it so if the user presses the keys
shift + l then my mc instance = my instance is toggled on and off
Code:
if (eatpane._visible = false && Key.isDown(Key.SHIFT && Key.isDown(108))) {
eatpane._visible = true;
information = rtext[9];
}else if (eatpane._visible = true && Key.isDown(Key.SHIFT && Key.isDown(108))) {
eatpane._visible = false;
information = rtext[10];
}
If anyone can fix it I would be very grateful
Key.isDown() Help
Key.isDown(Key.LEFT)
this code above basically means when i press LEFT key, the character moves left...
now what i want to do is when i press "A", the character moves left... but i have no idea how to code that using Key.isDown() method...
can anyone here provide help please?
thnx a lot...
Key.isDown?
Hello everyone, I'd like to know how to fix up this bit of code:
ActionScript Code:
if (Key.isDown(Key.SPACE)) {
Balloon._y -= 150;
Balloon1._y -= 150;
Balloon2._y -= 150;
Balloon3._y -= 150;
Balloon4._y -= 150;
Balloon5._y -= 150;
Balloon6._y -= 150;
}
You see.. I need it so everytime the person just presses the spacebar once, the balloons move up. But whenever you hold the spacebar it goes up, I need to get rid of that function.. I just need the press once one.
Thanks.
Key.isDown(Key.A) ?
I was wondering... what kind of code is required to make a
ActionScript Code:
If(Key.isDown(Key.A)){
line.
What I want is something to happen when the Key "A" (or any other key for that matter, not the DOWN, LEFT, UP, DOWN, SHIFT, ENTER etc) is pressed.
Anyone got a clue?
Key.isdown
in the key.isdownfunction... i know for the south key its DOWN... but what do u use for the letter keys. eg. A, W...
If ( Key.isDown() )
When I use the if ( Key.isDown(Key.LEFT) ) statement (or any other Key.isDown() ) It only checkes I time?
How can I let it check all the time?
Key.isDown
I have a simple driving game of which the Key class is used to navigate the vehicle token. Where _root.number = # is the left, right, up, and down border limits.
It works flawlessly on a Windows environment using IE or Firefox. However NeoWare Thin Client envrionment running Linux w/ Firefox the arrow keys do not respond.
Would Linux recognize the ASCII code better? If so, can someone point me to a library with the codes. Or perhaps other suggestions.
Also, I thought about trying a different set of keys to navigate such as: I, J, K, and M respectively thinking that perhaps the arrow keys on these particular clients are mapped in such away to prevent additional interaction.
Here's the code:
function captureKeys() {
if (Key.isDown(Key.RIGHT)) {
_root.number = 3;
keyPressed = true;
} else if (Key.isDown(Key.LEFT)) {
_root.number = 4;
keyPressed = true;
}
if (Key.isDown(Key.DOWN)) {
_root.number = 2;
//keyPressed = true;
} else if (Key.isDown(Key.UP)) {
_root.number = 1;
keyPressed = true;
}
_root.onEnterFrame = function() {
captureKeys();
};
Thanks for any help
Key.isDown
Hello everyone.
I have a simple code which allows you to skip ahead in the timeline by pressing Enter, which works great. However, when I have klicked on it and are on the frames that do not contain this script, it's still clickable.
Does anyone know why?
Attach Code
onEnterFrame=function()
{
if (Key.isDown(Key.ENTER)) {
gotoAndPlay(210);
}
}
(key.isDown())
i have a mc, with 3 frames, it has a stop(); on the first frame,
when the 'n' key is pressed, i want it to gotoAndStop(2);
this is what i have:
ActionScript Code:
onClipEvent(enterFrame) { if (key.isDown(78)); { this.gotoAndStop(2); } }
but it just goes straight to the second frame, with out the 'n' key being pressed, anyone know why?
Key.isDown... [FMX]
Hi all,
I am trying to use th following code to animte an object across the screen:
if (Key.isDown(Key.LEFT)) {
speed++;
clip._x -= speed/5;
trace(speed);
}
speed is a variable with a set number.
the effect is a sort of acceleration.
The problem I have is: How do I reset the speed after when the Key is not down?
Key.isDown
hey.
i have a word game. there are some words that are randomly selected. and players just see one word and try to produce new words from that. you know classic word game.
i want players to use keyboard. for example if the word is MONDAY and a player write DAY, he / she would able to write DAY with keyboard.
Letters = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "R", "S", "T", "U", "V", "Y", "Z");
Codes = new Array(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 84, 85, 86, 89, 90);
this is the array. but how can i use this. i cant do that.
thanks in idvance.
Key.isDown?
this time I got a little problem with teh key.isdown stuff...
Basically I want to make a key that goes to another frame.. for example, when I press space...
Thers my code...
if (Key.isDown(32)) {
gotoAndStop(2);
}
Im not that sure where I should put it so I putted it on a MC in my first frame. The problem is that it does not work.. and I would like to know why and how to fix it.. ^^;
[edit] nvm, alredy figured it out.. -.-..
ps: where can I delete this post?
Key.isDown(Key.?)
I am making a kind of multiplayer game for fun but I'm having trouble with the controls.
For one of the characters it works fine since I'm using
Key.isDown(Key.LEFT)
and so forth with UP, RIGHT and DOWN
The trouble comes when I try to specify the keys for player 2. I found out that all buttons have ASCII codes and I found the codes for the buttons i need but when it comes to putting them in the script I'm all noob.
Doesn't work when I just put the numbers in like this
Key.isDown(Key.71)
If you know how to put in the codes properly please enlighten me
(key.isDown())
i have a mc, with 3 frames, it has a stop(); on the first frame,
when the 'n' key is pressed, i want it to gotoAndStop(2);
this is what i have:
ActionScript Code:
onClipEvent(enterFrame) { if (key.isDown(78)); { this.gotoAndStop(2); } }
but it just goes straight to the second frame, with out the 'n' key being pressed, anyone know why?
|