ActionScript 3.0 :: Wasd Not Working?
Feb 15, 2011
I'm trying to let my ship move with WASD.I've got it to work with the arrow keys, no problem.It seems to be the problem that my event isn't triggered when i press W, A, S or D. Because,when i place a trace(event.keyCode), it doesn't trace anything.I'm using this within a class.Here's my (part of the) code:
Code:
public function ship() {
stage.addEventListener(KeyboardEvent.KEY_DOWN, keysDown);
stage.addEventListener(KeyboardEvent.KEY_UP, keysUp);[code]..
In the code above, the W key doesn't work. But the left, right and down arrow keys work fine.If i change those to the corresponding key values of a, s and d.It doesn't work anymore.
View 4 Replies
Similar Posts:
Jun 17, 2010
I have a challenge in a flash movie with TabIndex that involves some pretty comprehensive keyboard functionality and have solved the problem but the client is not madly happy with the solution. Problem is I don't know whether there is another way of solving it.
I've built a app the allows the user to upload a picture and manipulate it using marker placement. You can either drag the markers with the mouse or using tabIndex can tab through them then, once highlighted, you can move each marker up, down, left and right using the WASD keys.
I thought this was a nice solution since gamers are familiar with WASD to move directionally, however the client wants to use the arrow keys for this function. The problem resides in the fact that within the tabindex the arrow keys act in the same way as the tab, in that they tab forward or back through the index.
Client suggest tabbing to marker, clicking ENTER to disable tabbing, using the arrows to move the marker, then clicking ENTER again to re-enable the tabbing, move to the next marker, click ENTER to disable... etc etc.
View 0 Replies
Mar 24, 2005
I am looking for the AS for moving an abject with WASD. I had it working with Key.Left, Key.Right, Key.Up, and Key.Down but I want to change them to WASD.
Code:
if (Key.isDown(Key.LEFT)) {
this._x+=moveSpeed;
} else if (Key.isDown(Key.RIGHT)) {
this._x-=moveSpeed;
} if (Key.isDown(Key.DOWN)) {
this._y+=moveSpeed;
} else if (Key.isDown(Key.UP)) {
this._y-=moveSpeed;
}}
View 12 Replies
Apr 14, 2011
i want to create a keyboard-controlled "wasd" game with proper hitdetection,doing this tilebased is no feat and is pretty straightforward.But say i want to do this in the fashion for a game like WoW, and things quickly starts getting trickier.How would i resolve something like this with AS3? One possible solution would be to implement Box2D, but since I'm planning to make a rich 3d-game, the question is whether 2d collision-detection will be sufficient. What options are there for collision-detection in AS3 if the aim is to create a game with similar mechanics to WoW?
View 1 Replies
May 25, 2011
package
{
import flash.display.DisplayObject;[code]....
View 1 Replies
Nov 5, 2009
I have a flash project, its working fine in local system, but the same file is not working in live here is the link of the site, its showing blank page, the flash contents are not loading... [URL]
View 12 Replies
Dec 14, 2009
I have a flash project, its working fine in local system and checked this file with uploading in someother websites, its working fine there too, but the same file is not working in live here is the link of the site, its showing blank page, the flash contents are not loading.URL...and here the same file which i have uploaded it in other server its working fine.URL...
View 2 Replies
Apr 21, 2009
I missing a file that needs to reside on the server to get this working?
View 1 Replies
Apr 18, 2011
[URL]
The ad on the bottom right of the screen (the one with lightning flashing) has an invisible button in its Flash file (CS5) linking to [URL]. This file is imported as SWF in Dreamweaver CS5.
The hyperlink works in Firefox, but not in Safari. Maybe it is just my computer.
View 1 Replies
Oct 14, 2010
I have developed a player in AS3. It is working if i provide the IP of the website. But, it is not working when i provide the full domain name. Even, i provide the crossdomain.xml for global access.
View 1 Replies
Mar 17, 2012
i have a "swf" file which is picking url from xml & displaying the image, when i tested it locally it works fine, which means it picks up URL from XML & displaying corresponding image. After i uploaded it on server, it doesn't show anything.
View 2 Replies
Apr 22, 2009
I had a button when clicked, it would replace a different moviclip.This worked until I made the bulk of the code into a function and moved it to the layer, and then tried to call the function from the previously mentioned button. It generates no errors, but it stopped working.Hierarchy:Layer 1 > U1 > image
Original button script:
on (release) { var theDepth:Number = _parent.U1.image.getDepth(); _parent.U1.attachMovie("K3E", "image", theDepth);
[code].....
View 3 Replies
Apr 23, 2010
I am creating a website that has links to flash animations. i have created a folder called flash in the root folder and copied the relevant .fla, .swf and the .mp3 files into that folder. the animations are working fine but the audio isnt.it all works fine in flash itself.
View 4 Replies
Jul 10, 2010
I created a 9-scalled background in Flash CS5 which is working fine in Flash CS5.But when i imported it as embeded graphic in Flex, and change dimensions in runtime, 9-scalling doesnt work.Here is my code.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"[code]....
View 1 Replies
May 16, 2003
am using bitmapdata to make me a nice lil' background image, and it works great...until it's resized. Whats happening is it's creating a new bgHolder clip on the resize, NOT resizing the current empty clip "bgHolder"Here's the code(taken from various posts)
import flash.display.BitmapData;
#include "mc_tween2.as"
Stage.align = "TL";
[code]....
View 3 Replies
Jul 26, 2010
I have just made a website (URL...), and I have two swf. One sound swf and one video swf but none are loading in IE? Anyone know what wrong?
View 1 Replies
Dec 15, 2011
I have a weird problem,Flash banner is working "clickable" if the page url have preceding "www" and not working if not,So the if the URL in the address bar was [url]... the banner will be clickable and will redirect you to the link embedded in it, if the URL was [url]... the flash banner will not be working.
View 1 Replies
Jun 12, 2011
Okay, so this is the code I have on the frame:
ActionScript Code:
finalScore.text = "You scored: " + fishScore;
nextScene_btn.addEventListener(MouseEvent.CLICK, nextSceneGo);
[code].....
View 5 Replies
Jul 30, 2009
For some reason my swf file is playing fine in Firefox, but not in IE7. Here is the link:
[URL]
View 1 Replies
Apr 13, 2010
I have a couple different arrays holding my xml information. I want to make it so when one of the buttons is pushed(and moved) the information is resorts the information in the arrays. I can get it to sort anyway I like, but as soon as I apply an "if" statement, it just sits there and does nothing. I have also tried putting it into a function with so success.[code]
View 1 Replies
Jun 15, 2010
I'm trying to make a simple platform shooter game, although I just cant seem to get jumping right. hitTestObject works fine, but hitTestPoint doesn't seem to work at all.[code]on that last bit, if I use hitTestObject instead, it works fine, but when i use hitTestPoint, I just fall through the ground as if nothing is there.and I want to use hitTestPoint so I can make floating blocks
View 2 Replies
Nov 5, 2010
i have a container swf and 3 subfolders that load in videos and images, when i run it local everything works and loads fine ( dbl clck the swf) but when i put it on the web server and call up the url the video from the subfolder does not work?? if i go yto the web server and ( dbl clck the swf) all works? here is what i am using ( from DW CS5 )
<div id="content"><span style="text-align: center"></span>
<object id="FlashID" classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">
<param name="movie" value="start.swf">[code]..........
View 3 Replies
May 31, 2009
I am currently testing a site I am doing in IE6. There is a flash banner at the top of the site which works perfectly in IE7, FF, Oprah and safari but in IE6 it is just a white box. I have vista so I have to check this on another laptop using Multi ie as IE tester doesn't register flash. I have changed to file name, made sure the param value has the correct url in it, and updated the latest version of flash. Still nothing is working in ie6. I need it to work in order for me to align it correctly but all I see is a white box which looks to be wider then it show be.
Here is the embed code:
<script type="text/javascript">AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve rsion=9,0,28,0','width','849','height','260','src','images/slices/flas hbannersam','quality','high','pluginspage','http://www.adobe.com/shock wave/download
[code]....
View 14 Replies
Aug 28, 2009
I opened my flash movie in CS4 that was created in CS3, added additional scene, andrepublished but all links failed to work.
View 2 Replies
Oct 10, 2009
I created a custom movie clip to use as my header. I export it as a movie. And it plays fine on my dashboard, but once I upload it to my host [URL] and play it from the directory, it comes up as a white screen, and nothing happens.
View 9 Replies
Nov 13, 2009
I bought ready templete for flash website and have problem with creating code for link. You can see templete website on happyrobot.info/good and I want to place links behinde ABOUT US , SOLUTIONS , SERVICES so I can redirect to diferen sites. You can download fla file from happyrobot. info/ download it is index.fla
View 4 Replies
Dec 20, 2009
I've noticed that the Tab Order function doesn't work anymore since CS4? Is this a know bug or is something changed in how to use this function?
View 8 Replies
Jun 5, 2011
I am struggling with one issue on loading the swf file in browsers [IE, Firefox, Chrome]. Somehow the swf is not working as expected.What I have done so far:I have a php file with following code:URL... mfXH2FzG [remove spaces]test.swf has few buttons and one progress bar to show microphone level. Basically, this records the sound and plays it back.What is happening, the swf get downloaded and gets displayed in the browser. But, there micLevel doesnot show any movement and no recording happens.Now, when I try to load the swf directly URL...), everything works like a charm. micLevel is displayed, recording and playback works fine.One thing I have noticed when loading through php page, I don't get any dialog pops up to grant access to microphone but when loaded directly I do get that dialog popup.
View 2 Replies
Apr 3, 2007
why my masking effect is not working,i mean on Library display is displaying correctly[Type:Movie],i just did draged into main pannel the movie clip,and when i run it,it just show static text,why?
View 13 Replies
Jun 5, 2009
I need someone to look at my clip for me and tell me why it's not working. I have the stop(); in frame one and the last frame, I just don't understand.I can't attach the file here because i only have winrar and winzip 12 (which creates a .zipx - which won't upload...i tried)
View 1 Replies