Setting A Function To A Lot Of Symbols - actionscript-3

I am a beginner in programming and my question is how do I set a code to a lot of symbols?
Like if I want to set a code to 30 different symbols but the code is the same..
Is there any shorter way to do it than repeating it 30 times?
I heard the flash player version you have will affect a few codes & I have Flash player 11.2 r202
Thank you!

Related

Can I avoid the lost in quality of pixel graphics in Flash?

Im making a videogame in flash (using AS3, Flash CS6, flashDevelop, etc) and almost all the big code is done. So I made some new graphics in photoshop, exported as PNG, loaded them to the library and replaced some of the placeholder vector art. When I tested the movie I noticed a huge drop in quality even when the code does no scaling at all.
http://i.imgur.com/qIE7Vk9.jpg
Is there something else I should be doing?
Ok, so i feel kinda silly answering this like 5 minutes after posting the question but you can set the properties for the file inside the library so it isnt compressed any further.
http://i.imgur.com/iI2mnLa.jpg

AS3 replace string/text with image characters

i am developing the code for a simple game in AS3 and i have all the graphic assets made by a designer.
He wants all the textual messages (i.e. win, lose, lives, etc.) to be done exactly as in the original photoshop drawing, they have lots of visual fx on them.
Since these messages inside the game are dynamic, I tried to use normal textfields and replicate the visual fx with Flash filters, but the result is not even comparable.
I think i could try to export from photoshop a spritesheet with the all the image characters, or the single image characters one by one, and replace my old textfields with sprites/movieclips in which i would load the specific image characters based on the string i need to show to the enduser, but i don't know precisely how to do it.
Does anyone have some hints on how to achieve this result? Better to use a separate class and image library? I googled online hoping to find some class or method alike to customize a little for my needs, but unfortunately i haven't found anything!
You could add all the graphics to the library exporting them with each name.
Than call them when needed creating a MC. If useful, you could store the names in an array and use it to simplify your script (it depends on usage)
Ok, after some more research, i found out my main problem in not finding answers to my problem was the terms of research i was using.
I was erroneously looking for "AS3 string replace with images" or "text replace with images in Flash", while the correct question was: "how to use a BITMAP FONT in AS3".
I was sure someone else had to do what i'm trying to do (like in old games where texts were all image sprites) but i didn't know how to find it!
So, this is the solution i found, i still have to refine the workflow but it's a good starting point:
Create a custom Bitmamp font using the SHOEBOX tool in conjunction with photoshop, where you will be able to apply all the raster fx you want (here's the tutorial: http://renderhjs.net/shoebox/bitmapFont.htm)
You will obtain a .fnt file (descriptor) and a .png image (font characters atlas)
You will need to flip the png image vertically: apparently, a lot of bitmap text engines work with flipped characters, and i found this one to be working like this as well
Once you have these files, use the BMFontRenderer AS3 class to embed your bitmap font into an AS3 project of your choice (tutorial here: http://blog.bengarney.com/2011/12/07/fast-bitmap-fonts-in-flash/)
I hope it will be useful for others who may need to replace standard text in Flash with font images.

Box2D Flash - Perfect Character Collision? (AS3)

I was wondering if it's possible to get almost perfect character collision with Box2D (Flash)?
I know the basics of Actionscript 3 but know very little about Box2D. I can create character collision to stop the character running through platforms and such with Actionscript 3 but because the character isn't a simple shape, it's quite glitchy.
Thanks
In a word, yes. See the interactive ragdoll example right on the Box2DFlash homepage. You can download the source code for the examples from the same page to see how they work.

OCR Actionscript

Hi guys i want to create a OCR in Actionscript 3. At first i thought that i would create a neural network in AS3. But, it's very difficult. Any guidelines on how to proceed would be helpful.
I found this: http://code.google.com/p/zeez/
If you go to the ZeezSample.fla you need to change the main stage class to ZeezSample. It was set to a non-existent file thus the .fla was useless. With that tweak you can see the algo at work. I'm trying to find a way to trim this down and simply recognize a few basic numbers in a flash bitmap / bitmapdata pulled from a webcam.
Cheers!
You could use Alchemy and find a C/C++ library which you would then wrapp for AS3.
I found this one, but I never tried it: http://code.google.com/p/as3ocr/

Two Webcam At Same Time AS3?

Dear guys ,
Is this possible to stream two webcam at same time in flash !?
I want to use one to track a person from top and one for face detection ?!
I just wonder am i able to use two webcam at same time in as3 or as2 !?
Thanks in advance
I thought it would be impossible but I found this link : http://blog.tricedesigns.com/2006/10/multiple-cameras-in-flex-demystifying.html
It's pretty old so I'm not sure it's still working with the latest Flash Player versions