ActionScript 1/2 :: CharAt Is Returning ASCII Values?
Feb 20, 2011
I'm running some script using the charAt() function, that is supposed to return the character at specific indexes in a string, however for some reason it is returning ASCII values.
View 2 Replies
Similar Posts:
Feb 10, 2005
I'm trying to take an xml object, parse through it, turn the appropriate elements in object properties. Then, finally, pushing each object an array.
Then I need this array accessible outside of the XML.onLoad() function (since it returns nothing, I lose my array).
Here's the code from my timeline:
#include "functions.as"
XML.prototype.ignoreWhite = true;
var top_nav:Array = new Array();
[Code]....
how I can get needed values out of the onLoad function?
View 1 Replies
Oct 12, 2005
I need to load data from a database, so I created the following function and placed it in frame 2 on the main timeline.
Code:
getQuestionSet = function (category:String, subject:String, level:Number, count:Number):Array {
var questionSet:Array = new Array();
var writeV:LoadVars = new LoadVars();
[Code]...
Whenever I try to call the function, it fails to set the value of the questions array. It always appears empty(questions[0]-questions[10] have the value undefined). But, if I check the values from within the function after I have set them, it works, so I know that it is receiving the values. What am I doing wrong?
Code:
questions = getQuestionSet("Art and Music", "Art", 1, 10);
Here is an example of how I have would call the function.
View 7 Replies
Feb 3, 2009
I am getting variaables from a mysql database and then returning them back to the main file. However, the script is going faster than the query. is there a function that can make the file wait until it has finished loading in the variables.
Code below:
practiceIntroScreen.as
Code:
[code]....
View 2 Replies
Feb 10, 2005
I'm trying to take an xml object, parse through it, turn the appropriate elements in object properties. Then, finally, pushing each object an array. Then I need this array accessible outside of the XML.onLoad() function (since it returns nothing, I lose my array).
Here's the code from my timeline:
#include "functions.as"
XML.prototype.ignoreWhite = true;
var top_nav:Array = new Array();
var my_xml:XML = new XML();
var xml_url:String = "nav/top_nav.xml";
[Code] .....
How I can get needed values out of the onLoad function?
View 1 Replies
Feb 24, 2012
I have a project made in flex, using php data services to access a sql server database, and I need to convert it to mysql, I have changed all my php services from sqlsrv to mysqli. Something like this:
$this->connection = mysqli_connect(SERVER,USERNAME,PASSWORD,DATABASE); // Start Connection
$ssqlstring = "select * from Users";
$runssql = mysqli_query($this->connection, $ssqlstring);
while($user = mysqli_fetch_array($runssql)) {
$users[$user["ID"]] = $user;
} return $users;
It worked fine on sqlsrv but with mysqli it returns to flex the INT, BIT or DATE values as string the main Datatypes on mysql are INT,VARCHAR,BIT(1),DATETIME,DATE (same as sqlsrv)
and on the flex the return types are mainly as object[]
View 1 Replies
Jun 9, 2010
Let's start with the following XML:
Code:
<swatches>
<swatch>
<swatchName>Plaid</swatchName>
<swatchColors>
<color>black</color>
[Code] .....
I want to return a list of the <color> values without having any duplicates.
View 2 Replies
Jul 15, 2009
I'm making an activity that involves measuring the depth of a fictitious river at various points. I have an array containing those depths at the various points and a slider for traversing through the depths and outputting to a textfield.
As the user moves the slider up and down, they can see the depth of the river at that point and plot it onto a graph. What I would like to do is be able to figure out the depths inbetween the explicitly defined values.
here is the code, it's pretty simple:
[Code].....
How would I go about figuring out the values inbetween?
View 2 Replies
Apr 12, 2010
In C you can pass a reference to a data item as a parameter to a function. then within the function you can write to that address thus passing back a value to the caller. Can you do anything similar in AS3?
I know you can use the return statement but I want to return a status by that mechanism plus a value in a parameter.
View 10 Replies
Jun 5, 2011
I am developing in Flash Builder 4.5 using as3.
I have created a class to connect, write and read to a TCP Socket using 'import flash.net.Socket;'
Within this class is an event listener which reads the incomming data:
Code:
socket.addEventListener(ProgressEvent.SOCKET_DATA, readSocketData);
private function readSocketData(progressEvent:ProgressEvent):void {var response:String = socket.readUTFBytes(socket.bytesAvailable);
trace response;}
My problem is how to output this data back to my main application. Ultimately I want to process the data and output it in a text box.
View 4 Replies
May 26, 2010
I am trying to connect to an FMS application without flash (no SWF). To the best of my knowledge,the only way to accomplish this is thru the admin APIs, is that correct? If so, how do I return meaningful values from the admin API? I can call functions and stuff using the broadcastMsg API call but I can't seem to get back any values. All that is returned is a useless "Success" type message. I have tried using shared objects and the getSharedObjects API call, but the call doesn't return any info on the contents of the shared objects, just their names and some info on their persistance.
Is there another way of accomplishing my goal outside of the Admin API? If not how do I return meaningful variables from the Admin API? Is there a way to hack or extend the admin API?
View 2 Replies
Sep 11, 2009
How to use charAt for 1 file on more than 1 line? I'm using this
relText.load("Count.txt");
// Declaring Releasing Date ( 01.07.07 - 00:00:00 )
var relYear = Number(relDt.charAt(6)+relDt.charAt(7)+relDt.charAt(8)+relDt.charAt(9));
var relMonth = Number(relDt.charAt(3)+relDt.charAt(4))-1;
var relDay = Number(relDt.charAt(0)+relDt.charAt(1))-1;
var relDate:Date = new Date(relYear, relMonth, relDay, 23, 59, 59, 99);
And Count.txt has
09-21-2009
But I'm wanting to have the actionscript have more than 1 timer in the flash running at the SAME time, due to the fact that I will be having multiple timers for different things. So ideally if I can make the charAt look in the same file just different lines.
View 5 Replies
Mar 31, 2011
AS2 , and I have double checked the names. I am feeding in xml text to a button then trying to check to see if the button has '*' as first character then delete the '*' from the string....
Code:
box4.onRollOver = function():Void {
this.gotoAndStop("over");
[code]......
View 7 Replies
Mar 29, 2011
I'm making a hang man app in AS3 and when I try to run or debug it I get this error.
TypeError: Error #1006: charAt is not a function.
at Hangman_fla::MainTimeline/loadingText()[Hangman_fla.MainTimeline::frame1:93]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I'm not entirely sure what it all means since I'm extremely new to AS3. So can someone please help me. Also I pasted the code function that charAt is a part of below.
if(words.charAt(i)!= " ")
{
underline = new Underline();
underline.x = tempText.x + tempText.width/3;
[code]...
View 7 Replies
Aug 12, 2011
I am taking feed files from an XML, so in order to make those not throw out errors when reading the XML, I convert all entities to their numerical equivalents and write them as "�" for example.This then gets imported into a database, so that it now has "�" in the database.
I then take the text in the database and use that to generate a new XML file, which still contains the "".Flash then reads this XML file and displays the text.Now I think every character is fine (haven't seen all of them, but seen many), including "" (), however, for some reason, the ï symbol refuses to work () and it just displays and not the symbol.
View 4 Replies
May 23, 2009
This is really simple, but I can't it after spending 20+ minutes searching on google! I just want a function that turns a number into a character; basically the inverse of mystring.charCodeAt(0). For example-
[Code]...
View 2 Replies
Mar 18, 2010
I am working on a Flex project that is interfacing with physical hardware.Using the AS3 command of socket.send I can set a particular feature on the physical hardware.The problem I am having is I need access to send from the Extended ASCII codes.[code]This would be translated to me sending two numbers to the hardware.7F and 07. The Dec equivalent of these Hex codes are 127 and 7.The hardware takes these two numbers and calculates a length along with a third integer.[code]
Unfortunately the Hex 88 is in the extended ASCII table.The highest the regular goes up to is 7f which is a Dex of 127.I need the ability to send full 0 to 255 numbers in ASCII form.I can't send from 128-255 without using the codes from the ASCII extended table.I get an error every time I try to send something form the extended ASCII table back from the hardware.Can anyone confirm that AS3 does not support the Extended ASCII codes?
View 1 Replies
Sep 30, 2010
can i recognise a movement on a joystick with ascii codes???
View 1 Replies
Oct 1, 2009
I want to create a board class from canvas, which will allow to track click position on it in coordinates like A2, where A...D is Y coordinate in some scale and 1...3 is X coordinate [URL]What I want to create is a kind of convertor from canvas localX and localY to my new coordinates like A2.I am thinking of implementing if condition this way if (0.4 - x*size(from 1-3 here)/canvas.width <= X <= 0.4 + x*size(from 1-3 here)/canvas.width)
X = x;
This way I can assigned needed coordinates in X range. e.g. 1, 2 ,3 etc But what to do with alphanumeric range. (if for example I want to make it extensible)...
View 2 Replies
Apr 28, 2011
How can I check if a string has any other character than the ones listed here: [URL]
I would like to know if the string was inputted in any other language than English. Is finding special characters in the string the best way to detect non-english characters?
View 2 Replies
Feb 9, 2010
I'm trying to allow ascii codes to be entered into a textField, using num codes (ALT+Num), and am seeing some very strange behaviour. If I enter: Alt + 14, I get a charCode of 9835, and ♫ is displayed in my trace output, but a placeholder square is entered in the textField. If I enter: Alt + 0014, I get a charCode of 14, placeholder square is displayed in trace, and ♫ is displayed properly in the text field.
View 3 Replies
Feb 13, 2006
I am trying to make a game where if you press down on a letter key, it fires a bullet. How do i assign the fuction to the keypress?[code]90 is the key number for key "z".fireBullet(); is the function to fire the bullet. It is working.
View 7 Replies
Aug 29, 2004
Just list them if you could or link. even if you just have letters
View 1 Replies
May 19, 2009
I know letters have a number code to them, or ascii code, how can I use this to trace a letter with a number, for example lets say the ascii code for the letter 'a' is 97, in AS3 is there a way todo something like:
trace(asciiToString(97));
to trace out 'a'.
View 4 Replies
Aug 29, 2004
Just list them if you could or link. even if you just have letters
View 1 Replies
Dec 22, 2003
In Sweden we have these characters (and of course also in caps). But my MySQL db can't store characters, so if I look in the db and search for my name, Bostm, i can't find it..The search is ran from within flash (mx2004, and from there to a php-script, wich then sends the matching row back to flash.I want to convert all thein a string, and to be able to reconvert them when flash gets the string back... So the string should be stored in the db with the encoded...(am I confusing you now?)And I can't use the html-code for 'cause if the php-script prints this: Wow... quite an explanation...Ok, short summary:
AS-sting: Bostrm
>encode (so that =ASCII or so)
>send to PHP-script
[code].....
View 4 Replies
Aug 2, 2011
I need for my little project know a way to do following things:
- Getting any character from string (preferably operating on strings like on 1 dimensional arrays)
- Get ASCII code for character
- Convert number which contains ASCII code to character
View 4 Replies
Dec 22, 2010
use unicode character 187 (hex:BB) or ascii character 174 as a seperation character in my mysql database.This was working great in one of my swf files but not flash keeps reading an extra character. [code]The trace output from this looks like this: 1«1.If I change the php so that it's sending a 1B1 (no special characters) it works ok.I tried using the ASCII version and the Unicode version alt-174 and alt-0187 and both return this extra %2c character.I have tried urlencode from php, but even sending a 1%BB1 provides the same results.I can't fathom why it would all of a sudden start adding extra characters. So should I change my seperation character. If so, what's recommend? If not, should I check every variables from php for this extra character and remove it?
View 7 Replies
Jan 28, 2011
does anybody wrote a class for convert the special characters in ASCII/ISO Latin-1 Character Code, passing a string? i need to return for example:
[Code]...
View 3 Replies
Jan 23, 2011
In AS2 you had the functions ord() and chr() which specifically converted ASCII codes to their string equivalents.
However in AS3, String.charCodeAt() and String.fromCharCode() work with Unicode values.
Is there any way to convert a string character to its ASCII equivalent and back?
View 4 Replies