Loading Non-ascii Data. Possible?
Hallo. I've got a bit of code that creates a dot-image from a monochrome picture. I have the image file saved in .raw format (hex, 1 byte per pixel), and thusly, the file is simply hex FF's and 00's. I've tried importing it anyway, and got about 10 null chars in return (file contains hundreds). The way I've done it previously was to load the file into a hex editor, and convert the FF's (white) to 30's (ASCII 0) and the 00's (black) to 31's (ASCII 1). Then I load the text file in and get a huge string of 1's and 0's, which I can then dice and slice to make my arrays. This is not awfully bad, but it is time consuming, and prone to keyboard error. So is there anyway to cut out that nonsense with the text editor, and bring the hex data straight into flash, for further processing? Here's an example, to show how many 1's and 0's we're talking about - dotlogo Thanks
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-02-2004, 04:33 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading Non-ascii Data. Possible?
Hallo.
I've got a bit of code that creates a dot-image from a monochrome picture. I have the image file saved in .raw format (hex, 1 byte per pixel), and thusly, the file is simply hex FF's and 00's. I've tried importing it anyway, and got about 10 null chars in return (file contains hundreds).
The way I've done it previously was to load the file into a hex editor, and convert the FF's (white) to 30's (ASCII 0) and the 00's (black) to 31's (ASCII 1).
Then I load the text file in and get a huge string of 1's and 0's, which I can then dice and slice to make my arrays. This is not awfully bad, but it is time consuming, and prone to keyboard error.
So is there anyway to cut out that nonsense with the text editor, and bring the hex data straight into flash, for further processing?
Here's an example, to show how many 1's and 0's we're talking about - dotlogo
Thanks
How To Assign ASCII Values To ByteArray By ASCII Value?
Hello folks,
How can I assign an ASCII value to a byte array by using the characters ASCII value (not the actual character). For example, 32 decimal (0x20 hex) is the code for a space -- how can I assign the space character to the first element in an ByteArray using 0x20 or 32?
Thanks!
Mike
Edited: 02/05/2008 at 11:11:50 AM by MikeSDCA
Loading Ascii Into A Var
Hi everyone,
I'm totally new to action scripting...
I'm trying to load a var using:
banner = substring(info, 1, position) + "%5F";
to read from a var from a file, and add an underscore...
Problem is......nothing I do works, I've tried %5F...nothing
I've tried "String.fromCharCode(95)" without the quotes....nothing
I've tried mbchr and chr(95)....... nothing
yet, the String.fromCharCode() will work with normal alpha's
Please help :/
Thanks.....
Ed
Loading External Txts With NON Standard ASCII Characters
Hello everybody. This is my first post here.
I've used a Kirupa tuto for loading externat txts in a dynamic text box and works...
but the problem is I'm spanish and we use accents and the break c: ç
So I changed the externat txts to html files in order to use accents, but...
as Flash uses the "wonderful" ampersand to change between texts blocks, everytime I write an accent or a ç , Flash thinks this is the end of the text and hides the next text.
So, there's is a way to use externat txts or html with non standard ASCII loaded in Flash?
Loading External Txts With NON Standard ASCII Characters
Hello everybody. This is my first post here.
I've used a Kirupa tuto for loading externat txts in a dynamic text box and works...
but the problem is I'm spanish and we use accents and the break c: ç
So I changed the externat txts to html files in order to use accents, but...
as Flash uses the "wonderful" ampersand to change between texts blocks, everytime I write an accent or a ç , Flash thinks this is the end of the text and hides the next text.
So, there's is a way to use externat txts or html with non standard ASCII loaded in Flash?
Saving Data And Loading Data From A .txt File...
Hi,
I know there's a way to do it but i just couldn't get the right tutorial around..
I have read through Shared Objects but i couldn't get it work...
I just have to save my data, maybe array into .txt file and later on
retrieve from the same .txt file...
Anyone here have an example or some source code so i can have reference on it?
Thanks for the help provided....
Regards,
Lacus
Loading Xml Data - The Rest Of The Movie Is Not Loading
I have a custom FLV player that loads an XML file from our server to get the movie details, then once the data is successfully loaded the swf advances to frame 2 where the player loads the flv and the interface (stop FF, RW, etc.) Problem is that when I load the swf the first time, all of the XML is successfully loaded (I know from trace that all vars are set...), and the swf advances to frame 2 to actually show the movie and controls but it is a blank screen. if you refresh the page that contains the swf, everything loads fine. This has only begun since I added the XML functionality, so I am thinking the XML loading is the reason but I can not for the life of me figure out...
has anyone else experienced a similar problem?
the swf player is only 11k so I know it should be loading fine...
see example below:
http://www.vidrokker.com/viewpage/NzA%3D
Any input is greatly appreciated,
-nathan
example below:
Ascii 0
I just wanted to know if anyone knows whether or not it is legal to use the null character in flash strings, I know it causes issues in sql so i wanted to know.
Are there other control characters that cause issues?
Ascii Art
ASCII problem,
I have an ASCII program that converts bitmaps to ASCII art,
I'd like to know how to load it,with actionscript from an external
ascii text file,And still maintain the image?
Pic->ascii
http://www.flavour.pl/ascii/index.html
one cool thingy made by flavour.pl
Using Ascii
I'm am trying to use ASCII codes for keyboard pressing.
Ex:
if(key.isDown( ascii code ) {
}
but i keep getting errors.
Can somone please help.
Loading External Swf, Then Loading Data...
I'm kinda new, im switching to flash from Swishmax... Concept is kinda the same but some parts are different...
I have my main swf loading an external swf which is than loading >
loadVariablesNum ("discography.txt",0);
now when I run the external swf by it self , it loads correctly.
But when I run the main swf, and it loads the external swf correctly the data being loaded does not come in at all... Ive pulled it off before on swishmax but on the real flash coding i cant
ASCII Characters?
How can i put ascii characters and latin/french letters etc in to my text fields?
ASCII Question
Real quick: Can anyone tell me what the ASCII equivalent of html <BR> is?
Get ASCII For Text
i am familiar with getting ascii code for a pressed key. . .
how do you get ascii for a given letter, say I want to convert a user imput string into a set of ascii values (for dupiating the ropriate MC's)
?? ny Ideas or code would be EXTREMELY helpfull. . .
thanks
dairn
How To Get Ascii Code
I would like to get the ascii code of a certain part of a string for eg. i want to get the ascii code of the following:
myString.charAt(2);
so how can i do it to STRINGS?
Getting Ascii Codes
How do u find the ascii code of a char within a string
Ï'm trying to display text from a text file in a movie. the text file has 3 var in it
delay .........the amount of time each line is displayed
text...........lines of text ending with a return
eof............this is declared false in the script and set to true at thr end of the file.
I'm trying to search for the return(13) at the end of each line so i can break them up in to separate string that will be displayed one at a time
[Edited by johntigner on 03-14-2002 at 12:23 AM]
ASCII Key Codes
look at my ASCII key code creater...
http://www.geocities.com/zosflash/ascii.swf
hope you like it
ASCII Function
Hi, is there a function where I can get the ASCII val of something, (not key press).
EG variable = variable.ASCIIValue;
M@
Length Of ASCII Value 0
Hi Gang,
Happy New Year.
I'll start this year off with an easy question (hopefully). I'm trying to convert some ASP scripts into Actionscript for the purpose of encrypting game high scores and game id numbers as they are passed back and forth between the browser and Flash.
At one point I'm doing an Xor operation or "^" in actionscript. The result of which is a new number that is turned into a character. For example ....
s = acsii 115
5 = ascii 53
115^53 = 70
string.fromCharCode(70) = F
These "encrypted" characters form a new string which is sent back to the browser. The Achilles heel here seems to be when I'm trying to evaluate fromCharCode(0) I end up with no character at all. Its length is zero. This throws off my encryption string.
I thought ASCII went from 0 to 255. Why does actionscript not recognize this when in ASP ASCII zero evaluates into a char of length 1?
TIA,
Randy
Ascii Code
how can i convert a variable to an ascii code?
thax,
Mapisto
Movement With Ascii
i need help on making the code for making movie clips move with ascii
someone plz help.
i did this...
onClipEvent(load){
moveSpeed=10;
}
onClipEvent(enterFrame){
if(Key.isDown(97)){
this._x-=moveSpeed;
}
}
that didn't work though and i can't figure anything else out.
Ascii String
Removing any helpful previous posts I mistakenly contributed to these forums.
See ya FK'ers
String To ASCII ?
Ok, I have a really fast question... After a bit of searching trough the flash help file I found something like this: trace("x61"); which will trace "a" because in ASCII 61 is "a"... but I can't seem to get work if I'm not writing the trace as you saw before...
PHP Code:
trace("x61"); // traces: a
trace("x" + String(61)); // traces: x61
trace("\x" + String(61)); // traces x61
Essentially, I'm trying to get the same "a" result but instead of having to type manually "x61" i'd like to use a variable to specify the desired ASCII value that I want to display...
Could someone help me out with this because at the moment, I'm stuck.
Thanks.
Ascii Code
On press of any key on keyboard, how will i get which key was pressed?
I know that we can get the ascii code and then will come to know which key was pressed depending on the ascii code, but is der anything with which we will get which key we just pressed?
eg. If i press I, my function should trace "I".
Thanks...
ASCII Art Generator
For anyone who wants to fiddle with this
I'm planning on using this to create a huge ASCII artpiece on one of my living room walls
currently only uses 50x50 grayscale images, but is easily expandable
***********
The 2nd iteration below converts a 150x150 image to ASCII, and contains it in BMPdata (whereas the other one merely copied a lot of mc's...)
if anyone is up for making it save jpg's after render, please do, and post it here
PHP, Flash And ASCII ?
Hi,
We are designing a site for a customer, completely in Flash and using the miracles of PHP and ActionScript to display certain info and news-messages in particular.
The French version of the site however has a problem with accent characters such as é, è, à, ... These characters are replaced by squares and can only be displayed by entering the according ascii-codes in the news' adminpanel. I can't expect my client to learn using ascii when posting French newsposts, right?
Anyone has any experience with this problem? Any suggestions on how we can solve this issue?
Thanks in advance for you help/tricks!
ASCII Table
I am trying to create an o with two dots above it. I found it on asciitable.com. It is number 148... but this site doesn't have directions as to what I should type in flash to get the character that I want.
Does anyone know how to decode that table?
[HELP] Get Ascii Code
Hi, I was trying to get the Ascii code through key presses,
here's my code, I have a text box called "txt" and I want the code value to show it in this box.
ActionScript Code:
var myKey:Object = new Object();
myKey.onKeyDown = function(){
txt.text = myKey.getAscii();
}
Key.addListener(myKey);
it doesn't WORK!!~argh, please advice...thanks a lot
ASCII Function
Hi, is there a function where I can get the ASCII val of something, (not key press).
EG variable = variable.ASCIIValue;
M@
Random ASCII Character
Hi All,
I want to fill a text box with random characters, including extended. I'm very new to A/Script, migrating from Lingo. I really don't have a clue about doing this the right way, please help.
Any good tips for jumping from Lingo to A/Scipt, the rules differences are massive.
Thanks
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 ¿
ASCII To UTF8 Conversion
good morning (well, here it's morning anyway),
I'm looking for a way to convert a dynamic text (loaded from a text file) from ASCII to UTF8 before it's displayed in the text box. I have a small program that does this manually but I was wondering if there's a line of actionscript in MX that I could include (like in php: "$text=utf8_decode($text)" ).
thanks
Text Effect Using ASCII
I am writing some code to produce a nice text effect that acts like a typewriter but it searches for the next digit using ascii code. So it would be something like :
'this ain't w'
at the end of this sentence you would see 0123456789ABCDEF... run quickly after eachother until it finds the right ascii value and then continues with the next one. I've splitted my movie up in 4 frames, using 2 layers. One layer for the textfield(dynamic) and another on for the actions. The first actionframe initialises the variables (text that has to be placed in the textfield and a counter to keep track of the number of characters that have been found.)
the code in frame nr2 :
if(counter <= text.length)
{
for(i=1;i<150;i++)
{
if(char(i) != text.substring(counter-1,counter))
{
textinput = textinput.substring(0,teller-1)+char(i);
tekstfield.text = tekstinput;
}
}
textfield = textinput;
teller++;
}
else
{
textfield.text = text;
gotoAndStop(4);
}
frame 3 loops back to frame 2 and frame 4 contains only the stop() command.
The problem is it just ain't working, can someone tell me where to find a tutorial on this effect or the right code ?
Now I'm a n00b actionscript programmer, I only know java code and because it's alot like actionscript I made this thing up. I hope I explained it as clear as possible.
Hope you can help me,
thx for reading nyway.
The True Face Of ASCII
I am a little bit confused with what ASCII really does and is. Is ASCII a system that maps the keys on a keyboard? Or is it a system that maps the characters (a-z, A-Z, and symbols) only?
I ran into this question while testing two functions with Flash ActionScript. The SWF can be tracked from http://www.geocities.com/evresihopes/Test_KeyObject.swf
To use this SWF, just make sure your browser is active, and press any key on the keyboard.
The two functions that I was testing are getAscii(); and getCode();. getAscii(); returns its value, which is the ASCII representation of the particular key pressed, to the upper field (labelled ASCII >), and getCode(); returns its value, which is a virtual code that is
associated with each key on the keyboard, to the lower field (labelled Virtual Code >).
So, when we press the "Shift" key on our keyboard, the "ASCII >" field returns 0, but the "Virtual Code >" field returns 16, and pressing the "Caps Lock" on our keyboard, the "ASCII >" field returns 0, too... Umm, it's really confusing as it's not returning something I
really expect.
Could someone please help?
How To Recognize Non ASCII Characters?
Hello there,
I'm building a Flash file (for Flash Player 6) with external XML-text to load, problem is, since the text is in Spanish it has accents (non ASCII characters) which are completely ignored. How can I set Flash dynamic textfields to read these characters or maby there is a mistake with the XML?
Here some lines from the XML as example:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<articulo>
<seccion nombre="Artículo">
<item>
<b>Anales de Pediatría Continuada</b>
Volumen 1 Número 1 Julio - Septiembre 2003<font color="#FF0000" size="13">Orientación terapéutica</font>
Antonio Moreno, Santos Liñán
</item></seccion>
<seccion nombre="Puntos clave">
<item>
Las penicilinas y cefalosporinas de segunda y tercera generación a dosis altas son eficaces frente a las cepas de neumococos resistentes.
</item>
</articulo>
Thanks
How To Recognize Non ASCII Characters?
Hello there,
I'm building a Flash file (for Flash Player 6) with external XML-text to load, problem is, since the text is in Spanish it has accents (non ASCII characters) which are completely ignored. How can I set Flash dynamic textfields to read these characters or maby there is a mistake with the XML?
Here some lines from the XML as example:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<articulo>
<seccion nombre="Artículo">
<item>
<b>Anales de Pediatría Continuada</b>
Volumen 1 Número 1 Julio - Septiembre 2003<font color="#FF0000" size="13">Orientación terapéutica</font>
Antonio Moreno, Santos Liñán
</item></seccion>
<seccion nombre="Puntos clave">
<item>
Las penicilinas y cefalosporinas de segunda y tercera generación a dosis altas son eficaces frente a las cepas de neumococos resistentes.
</item>
</articulo>
Thanks
How To Recognize Non ASCII Characters?
Hello there,
I'm building a Flash file (for Flash Player 6) with external XML-text to load, problem is, since the text is in Spanish it has accents (non ASCII characters) which are completely ignored. How can I set Flash dynamic textfields to read these characters or maby there is a mistake with the XML?
Here some lines from the XML as example:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<articulo>
<seccion nombre="Artículo">
<item>
<b>Anales de Pediatría Continuada</b>
Volumen 1 Número 1 Julio - Septiembre 2003<font color="#FF0000" size="13">Orientación terapéutica</font>
Antonio Moreno, Santos Liñán
</item></seccion>
<seccion nombre="Puntos clave">
<item>
Las penicilinas y cefalosporinas de segunda y tercera generación a dosis altas son eficaces frente a las cepas de neumococos resistentes.
</item>
</articulo>
Thanks
Netscape Changes To ASCII Code?
The site that I get about ten minutes a day to work on is http://www.fpsweb.org ... I know it needs a lot of work, but the main issue I am trying to resolve is why Netscape changes links that I create in flash to ASCII code and therefore the links don't work... I've changed the to / in the HTML code and in Flash to no avail. I'm kinda new to all this web stuff, I know enough to be dangerous, thanks in advance for any help you can offer
Ascii Load In Text Help
When I load ascii text into flash and view it locally all is fine, but when I view it live on the web it doubles up the line space. Any ideas on why this happens?
Windows Key ASCII Keycode?
I'm looking for the ASCII value of the windows key for events. Does anyone have an idea what the keycode number is? It is not listed in the actionscript dictionary.
Thanks,
Sam
[F8] ASCII Code From A Given Char
Hey,
Maybe this question will seem stupid for you (it seems stupid for me!), but... how can I get the ASCII code from a given char (not keyboard, a char!)????
Thanks!
[flash 6] How To Ascii Value Of ALT Key + 0197
I want to take the value of Alt Key+0197 as ascii and display this value as text in text field.
Actually it is a letter of font. I know the value of ALT key is 18 but when I press ALT+0197 it does not give any value.
Thanks for any help.
Mouse To Ascii Input
I can use
onClipEvent (keyUp) {
_root.makeGuess(Key.getAscii());
}
so that when the user hits a key, this will tell flash what the letter is.
wha I want to do is have a button ot movieClip that has the letter A on it. When I click the button with my mouse, flash will see that its an A. THis is for a hangman type game. THis way I have a hangman game that works with just the mouse. Each letter will be a button. I just cannot figure out how to do this.
ASCII Code Problem
I'm trying to restrict a textfield with "-" but it doesn't work, why oh why?
I think I looked up the correct ASCII code...
ActionScript Code:
myText_txt.restrict = "u002D";
this one for "=" works, so... I don't get it...
ActionScript Code:
myText_txt.restrict = "u003D";
well I use this one for now. Allows + - * and ,
ActionScript Code:
myText_txt.restrict = "u002D-u002E"
Flash MX 2004 btw
|