Hi all,

Need some advice here: I wrote some code to recieve KeyboardEvents but when I "Test Movie" inside the flash program, many keys are being captured by the flash program instead of my swf test movie. Most notably, all alphabets are trapped only numbers are detected within the swf. if I embed in html and run it in a web brower, it works fine.

is this the correct behavior? Isn't this ... quite dumb? Is there anyway to fix this?

Thanks!

PS: BTW, I'm utterly surprised there's no dedicated forum for flash here. Why?

Hi all,

Need some advice here: I wrote some code to recieve KeyboardEvents but when I "Test Movie" inside the flash program, many keys are being captured by the flash program instead of my swf test movie. Most notably, all alphabets are trapped only numbers are detected within the swf. if I embed in html and run it in a web brower, it works fine.

is this the correct behavior? Isn't this ... quite dumb? Is there anyway to fix this?

Thanks!

PS: BTW, I'm utterly surprised there's no dedicated forum for flash here. Why?

So your actionscript is ok, and it picks up keypresses properly in an external instance of flash-player or on a web page but not when debugging in the IDE?

Sounds like the keybindings for your IDE are intercepting your keypresses, so they are not even getting to your .swf. There isn't really a lot you can do about it.

If you're using Flashdevelop to build and test your .swfs, you can set your options to allow you to test movies in an external instance of flash-player instead of an instance embedded in the IDE. That should solve the problem.

But if you're using one of the Adobe Flash IDE's, I'm not sure if you have the option to do this or not...Might be worth taking a look. If not, I'd recommend opening your .swfs directory and manually running the .swf to test it...which sucks, but it's the only way!

You'll also run into this problem when running a .swf in a web page if you try getting your .swf to pick up F5 keypresses....In a standalone flash player your .swf will pick up and process presses of the F5 button with no problems, but if you embed and view the file in a web-page and then try pressing F5 it is more likely that the browser will pick up the keypress, subsequentally refreshing the page and reloading your .swf...If you catch my drift!

Anyways, I hope that is of some help!

Jas.

If you're using Flashdevelop to build and test your .swfs, you can set your options to allow you to test movies in an external instance of flash-player instead of an instance embedded in the IDE. That should solve the problem.
.

So I suddenly realise alot of people are talking about and using Flashdevelop to create swfs. So is this thing better than the original Adobe Flash?

My other issue is that I cannot run swf external to the flash IDE. when I double click (open/run) it, it says file association required in the Set Associatation's panel (i'm runing windows vista). Well, that's fine, but I cannot find, and dont know which program is used to run swf externally. I posted this issue into another thread: see http://www.daniweb.com/forums/post848166.html

So my debugging -- really sad --- is to refresh the web browser everytime.

You do not have the standalone player. See your other thread.

Once you have the standalone player, you can right click on the shortcut icon and find out the name and location of the player executable file. This information can then be put into the My Computer file associations.

But I would bet that installing the player automatically sets the association, or asks you if you want to.

I see that this has already been solved, but regarding a couple of points....

So I suddenly realise alot of people are talking about and using Flashdevelop to create swfs. So is this thing better than the original Adobe Flash?

I wouldn't necessarily say better, but an equivalent alternative; as the workflow is slightly different!

I've been using FlashDevelop since version 2 and it's a great way of creating flash content quickly in code. The main advantage (from a programmers point of view) being that there is no need for any of that messy timeline stuff. You just create classes for everything in your flash file and script everything. No more .fla's with hundreds of layers with code on various frames of the timeline, or code buried deep inside nested movie-clips!

Your source ends up being a lot clearer. Of course, you can create flash files just as easily in code using the Flash IDE without having to use the timeline or loads and loads of layers, but Flashdevelop is free and does the job well, whereas Flex Builder and Flash CS3/CS4 cost money (Although, flex builder is considerably cheaper than CS4!).

So if you're more of a coder or on a budget, then Flashdevelop or Flex-builder are definitely the way forward. If you prefer to stick to the more traditional flash/timeline style of programming and you can afford it, then CS3/CS4 are probably best.

Of course a major advantage of owning CS4 Pro would be that it comes with the video encoder and several additional components that don't ship with the standard version of Flash!... So it's all swings and roundabouts!

But FlashDevelop is pretty good, it gives you loads of different project options and templates. So you can create your AS3 based flash files using mxml/flex, or pure AS3 code. You can even create AIR apps and it even supports creating flash projects in AS2, so you can target older versions of flash-player if need be!

My main reason for using Flashdevelop was I couldn't afford to buy CS3/CS4 pro, but as soon as I can afford it I'll probably end up buying it anyway and I'll use it in conjunction with Flashdevelop. Flashdevelop works pretty well with the Flash IDE's. If you have a flash IDE installed, Flashdevelop can load and use the components that ship with it. Flashdevelop can also fire up the flash IDE to test .swf's built in Flashdevelop. That way I can use flashdevelop for coded projects and use the flash IDE for quick and dirty timeline based stuff as and when the need arises!

So my debugging -- really sad --- is to refresh the web browser everytime.

If you're trying to make your .swf pick up keypresses of keys that are bound to your IDE as hotkeys, then debugging using an embedded instance of flash player in the IDE is not really an option; so yes...it's either that or use the standalone player to debug..which I see from your other posts, you've got working now, so this part of the post is rather academic now!

Cheers for now,
Jas.

commented: Good effort in explaining. Thanks a lot. +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.