ActionScript 3.0 :: SomeThin.text = String(value1) And Multiple Values?

Jun 22, 2009

someThin.text = String(value1) I'm using the above code to pass an integer to a dynamic textBox.The problem is I'd like to post a second variable (value2) in the same textBox as well as a '/' between them. I could use multiple textboxes but that just seems sooooo inefficient.

I've tried the following permutations and none have worked.

someThin.text = String(value1 ' ' value2) ;
someThin.text = String(value1) '/' (value2);
someThin.text = String(value1) '/' String(value2);

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Way To Split String By Multiple Values?

Feb 3, 2010

When you want to split a string in to an array, seperated by the letter "e" for example. So string: 0e5e8e7 would become 0,5,8,7..[code]Is there a way you could split a string by multiple values? So instead of it splitting the string when it comes across "e", could you have it split when it comes across "e", or another character.

View 5 Replies

IDE :: Matching Text String When Filtering Node Values

May 18, 2009

Kirupa's tutprial "Using XML in Flash CS3/AS3" when filtering the node values, how can I match a text string say "Stephen" with "Stephen E. Ambrose"
var authorList:XMLList = bookInput.Book.(author == "Stephen E. Ambrose");
Using the above code it only searches the node which author value is "Stephen E. Ambrose" but I want to search only "Stephen" and want to get this node returned.

View 2 Replies

ActionScript 3.0 :: Add The Values From Multiple Text Fields?

Apr 8, 2011

What I have is two buttons that when clicked they add an input text field and a third button that puts a text field and gives you the total value of the two input fields after the user inputs some numbers, the problem is that the buttons adding the input fields can be clicked multiple times and of course adding a new input field each time they are clicked and as you can imagine when I try to add the values I only get the result of the last two fields added.

How can I tweak my code so it adds-up the total value of all input fields on the stage?

I didnt test my code it may have some errors, I just put it together to show the concept.

ActionScript Code:
button1.addEventListener(MouseEvent.CLICK, addField);
button2.addEventListener(MouseEvent.CLICK, addField2);
button3.addEventListener(MouseEvent.CLICK, addTotal);

[Code].....

View 9 Replies

Flex :: Multiple Text Areas With Different Rotation Values Causes Borders To Be Very Wrong?

Nov 5, 2009

If you have two textareas, one has a rotation value besides 0 and the other has no rotation value or a value of 0 and you 'tab' focus from the one w/rotation to the one w/out. The border around the textArea w/out rotation will be rotated. If you set the rotation value of the non-rotated text field to a non-zero number, even 0.01, it fixes the problem, this causes tons of other problems in text rendering though so its not a solution.

I found setting the focusThickness style to 0 removes the border, which is a good solution but not a great one, anybody got a better one? Here is some sample code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:VBox width="100%" height="100%">
<mx:TextArea id="source" width="100%" fontWeight="bold" fontSize="20" height="50" rotation="5" />
<mx:TextArea id="dest" width="100%" height="50" />
</mx:VBox>

View 1 Replies

ActionScript 2.0 :: Multiple Text Formats On One String?

Dec 11, 2008

how I can make one String, displayed in a TextField, have different text formats?

View 2 Replies

ActionScript 3.0 :: Sockets And Making A String Equal To Multiple Lined Text

Jun 24, 2010

I've been making something using sockets, and I've run into a problem. The outstanding data from the socket is loaded into a string, like so:

[Code]....

To check if a sentence started with PING, I wouldn't be able to, because it will only acknowledge the first line (even though I can append all of it to a text box fine). I also tried testing scenarios with strings containing multiple lines, but found that by making a string equal to multiple lined text, it produces this error:"1094: Syntax error: A string literal must be terminated before the line break.", and I checked, I didn't miss out any speech marks.

View 7 Replies

ActionScript 3.0 :: Random Angle Ranging From Value1 To Value2?

Jun 26, 2011

I want a random angle ranging from - let's say - 10 to 80 (degrees). I got some code but there seems to be a bug inside of it. It calculates a random number (working) between 10 and 80. But when I paste it into the other variable (astAngle1) it's generating a random value not higher than 56(???).

Code:
var randomNumber:Number = ((Math.random() * (80 - 10) + 1) + 10);
trace(Math.round(randomNumber));

[Code].....

View 2 Replies

ActionScript 2.0 :: Values Of TextRo Or TextEn Or TextRu By Using The String "text" And Value Of "lang"?

Oct 17, 2005

I have 3 variables textRo,textEn,textRu and another variable "lang" that can take the values Ro,En,Ru. Is there any method in Action Script that i can refer to the values of textRo or textEn or textRu by using the string "text" and value of "lang"??

View 14 Replies

Regex :: Use The String.match Method To Find Multiple Occurrences Of The Same Word In A String?

May 25, 2010

In Actionscript and Adobe Flex, I'm using a pattern and regexp (with the global flag) with the string.match method and it works how I'd like except when the match returns multiple occurrences of the same word in the text. In that case, all the matches for that word point only to the index for the first occurrence of that word. For example, if the text is "cat dog cat cat cow" and the pattern is a search for cat*, the match method returns an array of three occurrences of "cat", however, they all point to only the index of the first occurrence of cat when i use indexOf on a loop through the array. I'm assuming this is just how the string.match method is. I want to find the specific indices of every occurrence of a match, even if it is of a word that was already previously matched.

how the string.match method is and if so

View 1 Replies

ActionScript 3.0 :: Using String.match Method For Multiple Occurrences Of Same Word In String

May 25, 2010

I'm using a pattern and regexp (with the global flag) with the string.match method and it works how I'd like except when the match returns multiple occurrences of the same word in the text. In that case, all the matches for that word point only to the index for the first occurrence of that word. For example, if the text is "cat dog cat cat cow" and the pattern is a search for cat*, the match method returns an array of three occurrences of "cat", however, they all point to only the index of the first occurrence of cat when i use indexOf on a loop through the array. I'm assuming this is just how the string.match method is (although please let me know if i'm doing something wrong or missing something!). I want to find the specific indices of every occurrence of a match, even if it is of a word that was already previously matched.

View 1 Replies

ActionScript 3.0 :: Using String.match For Multiple Occurrences Of Same Word In A String?

May 25, 2010

I'm using a pattern and regexp (with the global flag) with the string.match method and it works how I'd like except when the match returns multiple occurrences of the same word in the text. In that case, all the matches for that word point only to the index for the first occurrence of that word. For example, if the text is "cat dog cat cat cow" and the pattern is a search for cat*, the match method returns an array of three occurrences of "cat", however, they all point to only the index of the first occurrence of cat when i use indexOf on a loop through the array. I'm assuming this is just how the string.match method is. I want to find the specific indices of every occurrence of a match, even if it is of a word that was already previously matched.

how the string.match method works and if so

View 2 Replies

Use String Values To Access Movieclips?

Dec 24, 2010

I'm just wondering if it is possible to use a string values as a way to use the addEventlistener function.[code]...

View 5 Replies

Flash - How To Navigate Through String Values

Sep 1, 2011

I'm trying to get the values contained in the following XML
<user>
<id type="integer">122</id>
<name>newuser</name>
<email>newuser@user.com</email>
<created_at type="datetime">2011-08-31T19:16:52Z</created_at>
[Code] .....
But in the debugger I can see that the vars XMLNAME< XMLEMAIL & XMLPoints are all being created but they are empty strings. How can I navigate to their values?

View 1 Replies

ActionScript 2.0 :: Get Values From Embed String?

Jan 28, 2010

Something so simple, yet i want to slit my wrists.

i pass a variable into my querystring: "eof=true"

so in my html it looks like "filename.swf&eof=true" in the few places this is required.[code]...

View 3 Replies

ActionScript 3.0 :: Add A String Values To An Array?

May 11, 2010

How can I add a string values to an array

for Example

var abc:String = "my name is salim"

I just want to add four words my,name,is,salim into an Array.

View 2 Replies

ActionScript 2.0 :: Adding The Values Of 2 String Variables Together?

May 17, 2009

I meant to call it "Convert a value to a variable". Using CS3, AS2: If I have a variable that's a string value = the name of another variable, can I extract the value and then look for the extracted value's matching variable name to get it's value?

Ex:

color = "blue"
box = "color"

(Assuming I don't know the value of box) How would I get the value of "box" out so I could search for the value "color" as if it were a variable? I need to convert a value to a variable name is what i'm getting at... I think.

View 21 Replies

ActionScript 2.0 :: Adding Values Of 2 String Variables Together?

Aug 23, 2010

I meant to call it "Convert a value to a variable".Using CS3, AS2:If I have a variable that's a string value = the name of another variable, can I extract the value and then look for the extracted value's matching variable name to get it's value?[code](Assuming I don't know the value of box) How would I get the value of "box" out so I could search for the value "color" as if it were a variable? I need to convert a value to a variable name is what i'm getting at.

View 4 Replies

ActionScript 2.0 :: Getting Values Separated By Commas In A String?

Aug 17, 2009

if I read a string from an external file, for example "51,42,7"

how would I break apart the string into a bunch of values?

View 1 Replies

ActionScript 2.0 :: Adding String Values To An Array?

Nov 20, 2007

is it possible to add the values from a string to an array?For example my string looks like this:

var bookmarks:String = "book1, book2, book3";

And I need to add these values to the end of an array?

View 2 Replies

ActionScript 3.0 :: Get Values From Query String On Browsers URL

Oct 10, 2009

i am trying to tell flash to put some text on a dynamic textfield on stage based on some variables written on the URL in the browsers address bar, sort of like how PHP uses $_GET.so for example, i have a file called "embed_page.php" and embedded in it is a swf file called "dynamic.swf"UrL>..trace("name is: " + n + " and color of choice is: " + c + " and gender is: " + g);if only i could get access to the URL in the address bar, i could play around with indexOf and slice to get the values i want...

View 1 Replies

Actionscript 3 :: Sorting The Arrays And Comparing The String Values

Jul 12, 2011

I'm having a hard time wrapping my head around this problem. I have 2 unsorted arrays that need to be compared, array2 must contain all elements of array1 and array2 can any number of extra elements without affecting the result. I don't see any benefits from sorting the arrays and comparing the string values as array2 can have extra information causing noise.

[Code]...

View 5 Replies

PHP :: MySQLI Values Returning Bits And Ints As String

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

ActionScript 3.0 :: Extend To String And Change The Numeric Values?

Feb 10, 2010

I'm creating a Inches scale based game.. So I want to change the numeric values like

1.9 + 0.1 = 2 ( Not I need );
1.9 + 0.1 = 1.10
& 1.9 + 0.3 = 2.0 (thats I want)...

for example Ist possible like below class..

Code:
package com.classwork{
public class Inches extends String{
public function Inches(Str:String = "0'0"):void{[code]...........

View 3 Replies

Flash :: Search For Specific Words And Values In A Long String?

Apr 12, 2011

my objective is:

1.Read in a text file. e.g containing text like this, teacher/student/1/sn/2/3/4/5/9/f/tn/02/

2.pass it to a string.

3.then beable to extract different parts of the string and place them in different arrays.

The bit I dont know how to do is the extracting specific parts of the string? Is it possible to search for / and to treat what comes after it as a specific peice of information until the next / is read? Or perhaps there is a more efficient approach?

View 3 Replies

Regex :: Evaluate String Of HTML And Split Into Individual Values

Apr 26, 2011

I have piece of ActionScript code which is supposed to evaluate a string of HTML and break it up into individual pieces. So a string like <p>Hi</p><span>Hi</span><a href="index.php">Hi</a> would be translated into:

1. <p>Hi</p>
2. <span>Hi</span>
3. <a href="index.php">Hi</a>
...

However, when I run a test version of this code, I get a value of null in return. I'm pretty sure my regexp string is good, but I'm doing something wrong in ActionScript. My code is below:
var evaluatedInput:RegExp = new RegExp('/<([A-Z][A-Z0-9]*)[^>]*>(.*?)</1>/');
var output:Object = evaluatedInput.exec("<p>Hi</p><span>Hi</span><a href="index.php">Hi</a>");
trace(output);

View 2 Replies

Actionscript :: Regex - Converting String Values To Their Metric Equivalents?

Oct 5, 2011

for instance distance values,and temperatures For instance say I have a string containing some unknown inches value And the inches sign can either be the proper double prime OR double quotes. So, I'm guessing as a first step I would search for double prime or double quotes preceded by a number value, then parse out and convert this number value. But this doesn't seem foolproof for instances when it is actually a doublequote, NOT an inches sign

View 1 Replies

ActionScript 2.0 :: Showing Entire XML File Display As String In Dynamic Text Field (XML To String)?

Nov 24, 2009

Basically I'm trying to output the contents of an XML document into a dynamic text field (as loaded - not just its node values and content - the entire thing - into a variable called _root.log). The text field is set to show the variable value of _root.log.This is the actionscript...

PHP Code:
var newProfileXML:XML= new XML("<contacts result='true'><contact name='John Doe'/><contact name='Jane Doe'/></contacts>");

[code].....

View 2 Replies

ActionScript 3.0 :: Error 1067: Coercion With String Values From TextInput And ComboBox

Nov 29, 2010

I might as well be a damned newbie that's fer sure. I'm trying to fill one simple value object class using this code.

[Code]...

View 8 Replies

ActionScript 2.0 :: Load A New External JPEG Image Into A MC With A String Var Encoding A String Caption In The URL Link / Text Fader

Jun 6, 2003

I have a very general requirement that seemed very simple: Step 1: Load a new external JPEG image into a MC with a string var encoding a string caption in the URL link (VALUE="../fadeTest.swf?someTextVar=TestCaption") within the EMBED / OBJECT sections. I know how to do this and it semed to work fine. STEP2: When the JPEG is loaded I would like the substituted Text to Fade In over the JPEG. The JPEG should also fade in before the Text. The fade rate should be programmable.

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved