ActionScript 1/2 :: Convert A Datagrid Back To A String?
Oct 6, 2010I want to convert a datagrid back to a string. I tried Code:var myString = _root.myDatagrid.toString();But this does not seem to work.
View 5 RepliesI want to convert a datagrid back to a string. I tried Code:var myString = _root.myDatagrid.toString();But this does not seem to work.
View 5 RepliesMy program saves text files, which contain various text, some of which is a string representation of a ByteArray. It does this by using the toString() method of the flash.utils.ByteArray class, which I assume converts a ByteArray (for example, 13x$) into its string representation "13x$". So how do you reverse the process, and turn the string ("13x$") into a ByteArray (13x$)? Even if it's not that simple, I just need to have the ByteArray, put something in a text file, and extract from it the same ByteArray.
View 1 RepliesIn 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?
how do convert the myString var which is a string to the class name?
var myString:String = "movieClipInTheLibraryClassName"
var t:myString = myString()
I have Flash CS4 but my school has CS3, i did a project in CS4 brought it to the school and the file will not open, what sould i do about this? How do i change the file format? The error message was unable to open file format.
View 1 RepliesI am using the Astra Tree component.I am passing XML to the tree's DataProvider.I want the user to be able to add nodes to the tree.The most convenient way seems to be to add the node directly to the tree component.This works but I need to be able to save the new tree back out as XML.Is there an easy way to convert the tree back to XML?I have not been able to find an easy way to convert from DataProvider to XML.
View 0 RepliesIf I set the rotation for any object on the stage, flash renders it as a 3d object, even if I set the rotation to 0 like this..[code]3d objects render differently and look fuzzier when you look at it dead on than when it is rendering as a 2d object. How do I convert the 3d object back to 2d so that I get the better quality 2d rendering back?
View 1 RepliesMy project has a center-registered movie clip with a z-axis setting of 850 that I need to keep centered on the stage at all times, including when the stage is re-sized.Code like this for centering 2D objects doesn't seem to work:[code]My guess is that I need to convert the movie clip back into 2D space somehow, center it using the code above and then change the z-axis back to 850.
View 4 Repliesif I have a map of say, Wisconsin, and I know what the Latitude coords (degrees, hours, minutes) of the top and bottom of the map, and I know how many pixels tall the map is, then I should be able to convert, with math, degrees:hours:mins to pixels. (same thing with longitude, but lets just focus on one way first)
I would first find out how may hours (minutes would be over kill for my app) there are to a pixel. Thats pretty easy. But this gives me a decimal number. How do i convert a decimal value (like 10.25) back to degrees and hours (in other words, how do i make .25 a "60" based value)? Ultimately, i want the user to be able to input coords in the form of degrees, hours, mins. Then convert that to X, Y (to place a marker on the map).
Has any one had experience with this or know how to do this?
How can I get back the focus to the column after editing datagrid by Keypress.Enter, so that I can move to another column using arrow keys. Now its stuck in the edited cell and I cant move to another column.
View 1 RepliesHow can convert Julian dates to system date and back in AS3.
View 2 RepliesThe entire .fla animation consists of nothing but two really long movie clips. Which are placed on frames 1 and 2 of the main timeline. Now for reasons that are too deep for me to go into explaination about my boss is telling me that I have to have everything main timeline -no movie clips. I've tried copypasting all of the frames but they all paste wayyy to large on the main timeline and they wind up in different places on the stage.
How can I move all of the frames from my two movie clips onto the main timeline without everything breaking? Better yet - is there any way to just convert a movie clip into an .fla?
In flex (flash builder 4) I have a Date() property that I am passing to Zend AMF (php) and I want to store that (as well as other data) in mongoDB. Mongodb is complaining about the date because it comes across as a Zend_Date object, which appears to be an object containing several properties and Mongodb is saying that it can not accept blank properties. So, I take that to mean it needs to be converted to something else before I can store it? If so, how do I do that?
At the moment I have taken the approach of converting the Zend_Date object in to a date string to store it (in php):
$object->readyDT=date("m/d/Y H:i", strtotime($object->readyDT)); //convert to string
That works fine, and I have a string in mongodb of that date. Now, when I load the date from MongoDB, I need to convert it back to a Zend_Date so it properly converts back in to a Date() object in flex (I have to check that it's not blank or it throws errors in php):
if (isset($object->readyDT) && $object->readyDT!=="") $object->readyDT = new Zend_Date($object->readyDT, 'MM/dd/yyyy hh:mm');
This all works, but it seems like there should be a much easier way to take a Date() from flex and get it stored in MongoDB via Zend AMF/PHP. ?
I am working on a game that will have couple of XML files and couple of images external to the game.
i would like to protect those files so that they cant be changed/editted
is there a way to encrypt all files and then convert them back to normal on the fly as the game loads?
I want to take the following information, which I have as a string in Flash, and convert it into an XML object in AS3:
// information
<list>
<a>
[code].....
I tried to write a function that will strip the carriage return off of strings in a text file... it works fins inside the function, but the changed string is not passed back out... trace commands show that the word is being stripped of the extra characters inside the function, but after the function is called the changed string is not passed back out because the length is back to the original size again
[Code]...
I'm trying to convert an variable that contains XML data to a String. Anyone have a clue on how to achieve this?
My main problem is that the XML data is formatted nicely, but I need to store it in the database without the linebreaks and tab stops and whitespaces.
I think converting it into string would work with .toString();, but that doesn't get rid of the XML formatting...
Code:
function f_choosePhoto(photoNum)
{
var photos:Array = ["photo0","photo1","photo2"];
[Code].....
I've cobbled the AS together from a couple of seperate tutorials, and if I replace "new this[path](560, 380);" with "new photo1(560, 380);" it works.
I want to simply some repetitive code like this:
letter1.gotoAndPlay(Math.round(Math.random()*letter1.totalFrames));letter2.gotoAndPlay(Math.round(Math.random()*letter2.totalFrames));letter3.gotoAndPlay(Math.round(Math.random()*letter3.totalFrames));
I want to store letter1... into a string array. so I can call all of them with a loop.
Been searching for a simple way to do this but it's not out there, or is it?
I simply need to convert a sting to an int. The string will be a number, that is a given.
So I am trying to take an XML document, load it in, then organize the elements into an array of Objects with the elements nodes as the properties of each object.All of that I am able to do so far.What is the real problem here for me is when I try to take one of the properties and try to assign it to a dynamic Textbox's .text property.I can trace the object property, but it will not go into a textbox.[code]Also, I noticed that when the code hits the first output error, it never executes the rest of the code in the changeQuestion function; or else I would have gotten more than one output error.
View 3 RepliesIs there anyway to convert an XML to string(whitout the tags) ?
View 5 RepliesI have an array of string values that represent accessors to another array. I need to be able to use those to access the secondary array, so I need to find a simple way to convert the string to the actual array accessor.[code]...
However, it seems like there should be some way to cast the string into AS, that Flash can use to access the proper array, without having to do the complex string.slice statement.
Something like: var str:String = ActionScript(arr3[i]); would be much easier to type, as many times as I'm going to need it, than the .slice statements.
It is possible to converta string to a name?want to make a text to speech project that plays the sounds by name and i use the charAt function to split the text.[code]...
View 9 Replieshow to convert a string to an int...here's the thing when I use Number(myVar) it returns NaN. The string that I am trying to parse has a leading number followed by because I'm using loadVars and in order to make it more readable I'm trying to make a new variable on everyline....how I can do this I just need to remove the
.
I'm trying to add an ExternalInterface.addCallback, to get a string back from a javascript function so that I can set the "visible" property of movie clip "title" to "true." Can someone tell me what I'm doing wrong?Here's my AS code:
[Code]...
Is there a way to write a UTF-16 string into a ByteArray in Flash/AS3? Basically I have a string (var test:String="allan"; for example) and I would like to write that into a ByteArray with UTF-16(LE) encoding. In this case it would be "61 00 6C 00 6C 00 61 00 6E 00".
I've tried using utf16le.writeMultiByte( clipText, "utf-16" ); but it just comes out with what appears to be UTF8 (or just straight ASCII given the test string).
I need to convert a string such as "x*y+2" (from an input text field) into an expression x*y+2, so that it can be evaluated normally, eg f=x*y+2. The variables x and y are already defined and can have various values; I need to evaluate the strings as expressions.
I have tried f=Number("x*y+2") but it seems to work only when the string is actually a number such as "1.2e-4".
Is it possible to convert a string to hexadecimal? For instance I have a string that says "Hello World" I want the output to be 48656C6C6F 576F726C64
View 2 Repliesi have a simple dynamic textbox and want to store the TotalTime-property (= seconds of the video) of my video (flvplayback component) into this textbox. how can this super-easy thing be done?
View 1 Replies