ActionScript 3.0 :: Stop Flash From Concatenating Strings?
Jan 6, 2011
I have an external interface call which I need to pass several values to. Each value has an indentifier string and the value itself.
Code: ExternalInterface.call("submitIUR", answers +"promo", promo+ "url", nextUrl); The problem is that when I pass this through to the javascript function, flash concatenates the identifier strings. So for example if promo is 12345 when passed through the "url" indentifier gets tacked on the end so I get 12345url.
Is there an easy way to separate out the variables being passed through to stop the strings being tacked on to the variables?
View 6 Replies
Similar Posts:
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
Sep 30, 2009
I have the following function which returns a string: cues.getCurrentCue(); returns: "Definition_1" Definition_1 is the class name of a movie clip. I would now like to do something like this:
var currentDev:String = "new " + cues.getCurrentCue() + "()";
def_mc = currentDev;
addChild(def_mc);
But I get the following error: 1180: Call to a possibly undefined method currentDev.
View 1 Replies
Jul 14, 2005
It's another simple problem that has me stumped.
x = 1;
y = 2;
z = 3;
[code]....
View 7 Replies
Oct 10, 2011
I need to get an XML node by using this syntax:
[pseudo code]
xml.node["subnode"].@string.children();
[real code where _xml is XML]
_xmlList:XMLList = _xml.cases["case"][@id == event.target._id].files.children();
And yes, case is a reserved word - therefore the brackets and quotes.
event.target._id is a string, but I can't seem to figure out how to concatenate the @ (at sign) with a string to get the attribute (or the node that corresponds to the attribute).
I've tried _xml.cases["case"].(@id == event.target._id).files.children();
But it doesn't work. How am I totally off in the wrong direction?
View 1 Replies
Jun 6, 2008
I'm trying the add the data value of a selected combo box item (.35) to 1 using:
var theFringe:Number = _root.calc.fringe.getValue();
_root.calc.fFringe.text = theFringe+1;
Returns: .351
Is there a way to convert the data from the comboBox to an integer so that when I add .35 +1 I'll get 1.35?
View 1 Replies
Apr 8, 2010
I have three text boxes on the stage id=red, blue, green same as the keys in my
cars Object/Array
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code]....
So I'm thinking "tempObj.text" would equal red.text but I can't stick "tempObj" with ".text" is there a way this can be done?
View 1 Replies
Dec 1, 2009
I'm writing a menu generating script. It's suppose to display arrays
and any inner arrays.
Ex:["test item",["item 1",["item 2","item 3"]],"item 4"];
These movie clips should be displayed if the actionscript is correct.:
test item
item 1 <---this of course, has a following subarray
item 4
and the submenu should display:
item 2
item 3
I run the script and it see's the inner array items ["item 2", "item 3"] and shows them in the next submenu -FINE---but what I get in the main menu to my surprise is 'run-on text' in the Dynamic field of that movieclip. ex:
test item
item 1; item 2; item 3 <---? seems to concatonate inner items in text field
item 4
I only want to see text "item 1" ....not the items associated with it as well.
(they are already displayed in submenu)
Code:
for (var i = 0; i < menuArray.length; i++) {
var menuItemName = "mc_menu_item_" + i;
if (typeof(menuArray[i]) == "object") {
this["mc_menu_box"].attachMovie("h_menu_middle_sub", menuItemName, tempLevel);
View 2 Replies
Jul 24, 2009
I�m calling a ColdFusion page that generates output in the form of a text file to be used in a scrolling dynamic text field.So, Instead of calling a text file like so:
//calls a static text file
loadText.load("StaticTextFile.txt");
Im calling a ColdFusion page like so:
[code].....
View 1 Replies
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
Dec 29, 2010
I am working in flex builder 3 with an XMLListCollection and have run into this (should be simple) parsing snag...The XMLListCollection Data:
<data>
<term name="NUMBERS">
<alt_form name="1"/>
[code]......
View 3 Replies
Oct 2, 2009
A snippet of my code is [code]The first element in the mainOptions Array is linked (metaphorically) to tab1.The second element in the mainOptions Array is linked (metaphorically) to tab 2 and so on.I want to create 12 variables named AudioMP3, AudioHEAAC, NewsBBC, NewsTwitter, VideoVideo and so on down to PicsPics2. i.e concatenate each entry in say tab1 through 5 to the each element from mainOptionsArray and make a new variable using that name then assigning a number to this variable.[code]
View 1 Replies
Jun 12, 2009
I'm having trouble getting the following to work:
I have declared an array "playlistArray" which will hold a series of track names (for an mp3 player.)I have declared a URLVariable "playlistVariables" which loads the data from an external text file.If I brute-force assign values from playlistVariables to playlistArray, everything works fine:
playlistArray[0] = playlistVariables.track0;
If I test this with trace(playlistArray[0]) I get the track name I am looking for. But obviously I don't want to brute-force assign all those values, I want to use a "for" loop:
for (var i:int = 0; i<maxTracks; i++) {
playlistArray[i] = ["playlistVariables.track"+(i)];
trace(playlistArray[i]);
When I do this,I end up with playlistArray[0] containing the string "playlistVariables. track0" rather than the value of playlistVariables.track0.
View 3 Replies
Oct 8, 2009
in php I could do:
$prices['ford']['mondeo']['2005'] = 4500;
$prices['ford']['mondeo']['2006'] = 5500;
$prices['ford']['mondeo']['2007'] = 7000;
[code].....
View 3 Replies
Dec 1, 2010
I used strcmp(x,y) in C++. Do you know how to do that in as3?
View 5 Replies
Mar 25, 2009
I have this code that activates when rollover, rollout, and release. I functions for rollover and rollout works, but the release function does not. I'm trying to pass some strings with url's to the function within a loop.
var url1:String = "http://www.google.com";
var url2:String = "http://www.google.com";
var url3:String = "http://www.google.com";
[Code].....
View 2 Replies
Oct 24, 2011
How can I get the previous focus/be able to compare strings?
View 2 Replies
Jun 29, 2011
I have an array of strings. Each string is a name of a class. How can I call the library item with the class name that corresponds to the string in the array?
View 1 Replies
Oct 25, 2011
I am working with a function that converts csv data to a multi-dimentional array. I am then going through the characters to find specific situations in the way the strings are handled in the array. One example is if I have a string like - "this is a string, yeah" - then I make sure not to count the comma in the string because it is between quotes from that string. Anyhow In the following function I have some how lost my spaces in the results.Instead of getting "this is AS3" I am getting "thisisAS3". Spaces seem to only be available in the strings that have quotes.
function CSVtoArray(csv:String):Array {
var inQuotes:Boolean = false;
var field:String = "";
[code].....
View 1 Replies
Jan 4, 2011
I have a Flash file which contains some dynamic text boxes. ActionScript is being used to fill these boxes using strings. However, I can't seem to get Chinese characters to appear properly. I've tried the actual unicode character as well as their unicode-escaped equivalent but when I export the movie, nothing shows up (blank - it was assumed that the characters are not even present).
View 3 Replies
Jul 20, 2011
How would I achieve the following in AS3 or AS2.0. You have 5 sentences, you can select any of them with click button, they get stored somewhere in your flash file then you move on to something else like a movie playing and at the end of the movie you are presented with a screen showing the sentences you selected before...
View 2 Replies
Dec 19, 2005
I have an idea for something at work. I want to have stars hanging by strings from the top of my flash document. if the user mouses over these stars I want the star to lightly swing in the direction the mouse went over at. Almost as if you had a cardboard star hanging from the ceiling and you tapped it with your hand. I know this probably includes friction but my tests don't seem to work out the way I want. Does anyone know how to achieve this?
View 8 Replies
Apr 5, 2011
I've just developed a function to ring frequencies, but I can't make it sound like a guitar string, I can only change it's frequency. Is there some way to change other parameters of a generated sound?
function sineGenerateSound(event:SampleDataEvent):void
{
for (var i:int=0; i<4092; i++)
[code].....
View 2 Replies
Jun 12, 2009
I thought I had a handle on the timer class (even just a beginners understanding), but I'm having trouble with it.I have an event listener for the timer and it starts fine i get a delay, then a tween,but when I place a myTimer.stop();in the fuction the listener called (to stop it) it dosent stop.it will repeat placing the first image, and then call the first function again
......Wait its placing the first image in (a couple of lines before the start), so Its restarting the whole movie, not just the function?
myTimer.addEventListener(TimerEvent.TIMER, tweenone)
myTimer.start();
function tweenone (event:Event):void[code]...........
View 6 Replies
Dec 1, 2004
give me the actionscript for a bar that has a play and stop button to play and stop frames in a flash movie. i would be gratefull if you could as i am really stuck
View 2 Replies
Aug 26, 2009
I have a contact form for which I have a tween. That contact form consists of two keyframes, first the form, I tried putting the code stop(); in the first keyframe but it didn't stop. I then changed stop(); to _root.stop();, which didn't work either. I have to stop it because otherwise users would see a thank you note before they even enter their details. What can I do? Converting to movieclip didn't work either, besides it puts a funny character when I press AltGr
View 2 Replies
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
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
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
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