ActionScript 2.0 :: Addition Of Two Strings?

Mar 11, 2010

Here we go... i know, that i have to CAST them... but how? The idea is to add (adition) two strings...

a:String = "20";
b:String = "10";
c:String = a+b;

I get c=2010 and not 30 as i expected... i guess i have to cast, but how?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Push Multiple Strings Into An Array, And Some Of The Strings Are The Same?

Aug 24, 2009

I work on AS3 one week, and then take a break for a few weeks, then work on it a day, take a break, etc.. So I forget some of the basics, and need refreshers. I think I need to stop taking breaks.

Problem: I push multiple strings into an array, and some of the strings are the same.

Code:
var myArray = new Array();
myArray.push (Snivvle);
myArray.push (Kirupa);
myArray.push (Snivvle);

I want to find out which element positions "Snivvle" hogs up. We can see that it would be using element 0 and 2, and if we do an "indexOf" we would only get to see element 0, and doing a "lastIndexOf" we would only see element 2. How do I find out ALL of the element positions "Snivvle" is located in, so that it returns: element 0, element 2.

View 2 Replies

ActionScript 3.0 :: Addition Using Input Text Fld

Feb 17, 2011

i want to add two numbers, which has entered in two input text fields.[code]here if i entered 3 in one text field and 2 in another text field. the result is comming like 32. It should be "5".

View 4 Replies

ActionScript 3.0 :: Addition Of 2 Colors (hex Values)?

Jun 28, 2010

I am trying to figure out a way to add 2 colors (hex values) to generate a new color.I am not sure as to how this can be computed. Is the new color an average of the hex values of the 2 colors?

View 7 Replies

ActionScript 2.0 :: Write A GotoAndPlay With The Addition Of A Variable?

Nov 25, 2009

So I've defined my variable:_global.current = 1;And below i am accessing an MC called 'carousel_holder', which has an MC named 'bar' and inside this MC is a final MC named 'bar1'.So ive tested my path and can hard code it fine, so its not a paths issue but i think my syntax is incorrect:_root.carousel_holder+".bar"+current.gotoAndPlay(" start");

View 4 Replies

Actionscript 3 :: How To Do Flex Date Deduction And Addition

Jun 23, 2010

In flex, I am trying to do date deduction and addition, but couldn't find a way to do it.

e.g.: public var dateNow:Date=new Date();

How can I get the Date 3 months earlier than dateNow?

View 4 Replies

Flex :: Avoid The HorizontalScrollBar Addition To Container?

Aug 3, 2011

if container like VBox have autoScrollPolicy for both scrolls. if VerticalScrollBar is added, why the horizontalScrollBar automatically added.. is there any option to avoid the horizontalScrollBar addition to container.. without using horizontalScrollPolicy="off"

View 1 Replies

Actionscript :: Call A Function On Addition Of New Row In List And Not Afterwards

Feb 5, 2012

I have created an item renderer spark list in flex , but i want to call a function on addition of new row in list and not afterwards. I am getting a data object in rendered list in it i am getting the type of data to be displayed in list ie. either text or image. So on addition of new data in list i want a function to be called up in rendered list that checks the type of data received and then it will either create and add an image element or a text element. So the main problem is how i get a function called on addition of data. I have tried events like datachange and added but they keep on calling the function over and over again when we scroll the list but i want the function to be called once only on addition of data and not after wards. Below is the renderer list code , maybe you will get a better idea of what i am trying to do:

[Code]...

View 1 Replies

ActionScript 3.0 :: Number Addition On Data Change?

Aug 17, 2011

how can I add number to a current variable in actionscript. My variable has data coming though php(numeric data) so I want to create an if statement to say this:

If the data number(let's use 5) is equal to 5+any number then do something.

Should be pretty simple but I can't seem to figure it out right now, how can I say "any number" with code?

ActionScript Code:
if(myVar == myVar+1){
//do something;
}

Thing is the + number is uknown... so + 1 may not work cause the number may be higher than 1.

View 4 Replies

ActionScript 2.0 :: Dynamic Addition Of Images In Flash Using Xml?

May 7, 2007

how to put the images deynamically into flash-the complete procedure. what all is to be done in flash n xml n how to connect them properly.

View 1 Replies

ActionScript 2.0 :: Arithmetic Addition; Joining, Not Adding?

Oct 20, 2004

I am trying to add two variables, but my AS is joining them

volume1=function(answer1){
aa=wtft*12;
aaa=wtin;[code]....

There is more to this script, but I cut it down to this in order to focus on the error, which results in a joining aa and aaa. i.e. aa=36 aaa=4 results in a=364, where what I want would be a=40

View 5 Replies

ActionScript 2.0 :: Addition - Get Two Numbers To Add And Instead It Is Concatenating Them Together As A String?

Mar 29, 2005

has anyone had any problems with addition? I'm trying to get two numbers to add and instead it is concatenating them together as a string, however when I multiply, divide, or even subtract them it works fine.

View 10 Replies

Actionscript 3 :: Does FlashPlayer 10 Support MP4 And AAC Audio Codecs In Addition To MP3

May 11, 2011

I am developing an Audio Player application in Adobe AIR with Flex SDK 3.2. I wanted to know if i can play songs in other audio formats?

View 2 Replies

Actionscript 3 :: MX:DividedBox Dynamic Panels Addition And Subtraction

Feb 16, 2012

I have a divided box that has 3 panels in it... when a certain tab in tab navigator is clicked, then the sidebar with the three panels changed. One tab might show one Panel, another tab might show two of the panels and so on.

I can turn panels invisible and hide the dividers and ever almost positions the panels right, but the dividers still exists so it's not as dynamic as I would like.

Is their an easier way to add and remove panels from the Divided box that won't take as much manual configuration and hacking to make look right?

The problem is once I hide a panel the divider still exists.

View 2 Replies

ActionScript 3.0 :: Strange Number Addition With Timer Ticks?

May 21, 2010

I find the output of the following code extremely strange!

ActionScript Code:
package  {
import flash.display.Sprite;

[code]....

View 3 Replies

ActionScript 2.0 :: Math Error In Flash For Addition - C'mon Adobe?

Jan 14, 2011

Why do these numbers produce different results. Leading zero-trails shouldn't affect the result!!! GRRR!! :P


[Code]....

All of these produce in correct answers except the last one (which is the standard equation with no leading-zeros.)

View 1 Replies

ActionScript 3.0 :: Dynamic Component Addition / Removal With Flex

Jun 15, 2010

I've created a MXML Component that consists of two TextInput boxes (user can input a "name" and "description"). I'm attempting to add and remove this component dynamically to a VBox in an MXML application. I've achieved addition thusly:

[Code]....

However, I cannot seem to get the remove() going after trying various ways with box.removeElement().

View 2 Replies

Professional :: Adobe Flash CS5 Product Directly Generate Mp4 / other Formats In Addition To SWF?

Sep 8, 2010

Why not have the Adobe Flash CS5 product directly generate mp4 and other formats in addition to SWF?From my chair (as an Adobe Flash CS5 user) it 

-Going about using other additional software has direct effect on a software budget.
-Costs extra manhours to gather information of how it is done.
-Costs extra manhours/user time to process.
-Perhaps even increases the likelihood for errors and noise in re-processing already processed files (SWF->{F4V,MOV,MP4}) (F4V->{MP4,MOV},)relative to the original source FLA file?

View 3 Replies

Flex :: Prevent The Addition Of Dragged Item In Tree Which Drag Accepting?

Oct 25, 2010

i have two tree one tree lets say TreeDrag is drag enabled and other is drop enabled lets say TreeDrop.. when i drag item from TreeDrag to TreeDrop,, i want to show feedback and everything else normal except the addition of dragged item in TreeDrop..

View 1 Replies

ActionScript 3.0 :: Vector Addition (Physics) - Move Ball Towards A Specific Angle And Magnitude?

Jun 28, 2010

Say for example I have a ball and I would like to move it towards a specific angle and a specific magnitude I would use something like:

[Code]...

Now if I wanted to change this force, for example, add a force to it, say, with magnitude 0.5 and angle 20, how would I do that?

View 2 Replies

ActionScript 2.0 :: [CS3] Addition With Input Field And Dynamic Field?

Jan 20, 2009

is there a way to make it so when you are done putting something into an input field it will automaticly add/subtract from a dynamic field.Dynamic1 + Input = Dynamic2where each time you change the input text it will readd dynamic1 and input show it on dynamic2

View 5 Replies

Addition Output Shows "NaN"?

Sep 20, 2007

working on a Flash Game for my final project but only ever used Flash before for animations not games! I got a Flash Games book but I'm stuck on one of the exercises

Code:
btnAdd.onRelease = function() {
sum = parseInt (X) + parseInt (Y) ;

[code].....

View 2 Replies

ActionScript 2.0 :: CS3 Adition Of Two Strings?

Mar 11, 2010

i know, that i have to CAST them... but how?add (adition) two strings...

a:String = "20";
b:String = "10";
c:String = a+b;

I get c=2010 and not 30 as i expected...i guess i have to cast, but how?

View 1 Replies

Formatting Strings For Time?

Mar 30, 2010

how to format strings better and pad for leading zeros.here's the code:

var dt, timeint;
dt = new Date();
var TimeText:String;[code]...............

View 6 Replies

Actionscript :: Wildcard For Strings In E4X?

Jan 29, 2011

I'm trying to solve an Actionscript problem using E4X.I have an XML like this one:

<root>
<person firstname="john" lastname="doe" age="21" />
<person firstname="jayne" lastname="doe" age="35" />[code]....

I want to have just one function search() that takes three parameters (firstname, lastname, age) and return an XMLList. So the result could look like this:

var result:XMLList = xml..person.(@firstname == firstName && @lastname == lastName && @age == age );

But I don't want to use all three parameters all the time. I would like to have a function that uses a 'wilcard' if the parameter is NULL. So if the wildcard would be "*" the function could look like:

searchPerson( firstName:String ="*", lastName:String = "*" , age:String = "*") {...}

so that I would only pass 'John' for the firstName I'd get the first and the third node in return.

View 2 Replies

ActionScript 2.0 :: [FMX] Loading TXT And Strings?

Jun 26, 2003

i have a .txt full of words (strings) devided by lines and separated with ; and i want to be able to load 1 random line and the first string of it..xALI;DALI;IDEAL;DELIRAREDIAL;REPELIDAAMO;MATO;MORTA;MOSTRA;MAESTRO;BATERMOSi want to be able to load "ALI" for example. and then load DALI etc etci used loadvariablesnum to load the text, but maybe that shouldn't be the best option..

View 7 Replies

ActionScript 2.0 :: Encoding Strings For PHP/SQL?

Jun 3, 2002

which characters need to be encoded for PHP and SQL, and how to do it?

View 2 Replies

IDE :: Converting Numbers Into Strings?

May 26, 2009

I'm doing the finishing touches on my games. I want to keep track of and display the level (waveCount) and display it in a dynamic text box. However, AS isn't allowing me to convert the number into a string.

[Code]...

View 1 Replies

ActionScript 2.0 :: 2 Strings In Textfield?

Apr 15, 2005

I have a texfield in which I would like to display to strings. Right now, I can only use one of the strings by doing:myTextfield.text = str1

View 3 Replies

ActionScript 3.0 :: Converting Numbers Into Strings?

May 26, 2009

I want to keep track of and display the level (waveCount) and display it in a dynamic text box. However, AS isn't allowing me to convert the number into a string.

PHP Code:

private var waveCount:Number = new Number();
private var waveOutput:String = new String (waveCount);
private var waveWord:Sprite = new WaveWord();

[code]....

View 5 Replies







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