Tarcing Value Of String Outcome.
hi there,
I have a conc. string like: v = _level"+n+".clip"+n+"._y";
This comes out as a string: "_level1.clip1._y"
How can I trace the value of the variablename that comes out? I've tried: trace(v), eval(v), call(v)
Help welcome, ThanX, Ivo
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-29-2002, 09:49 PM
View Complete Forum Thread with Replies
Sponsored Links:
Very Strane Array Outcome... Who Understands This?
This is the code:
links_ = links.split(",");
links0 = new Array(links_[1].split("|"));
This is the Output:
Variable _level0.links_ = [object #1] [
0:"2",
1:"web|C:\Program Files\Internet Explorer\IEXPLORE.EXE",
2:"help|readme.txt"
]
Variable _level0.links0 = [object #2] [
0:[object #3] [
0:"web",
1:"C:\Program Files\Internet Explorer\IEXPLORE.EXE"
]
How can I access the varibles within 0:[object #3]?
This a strange probllem for me. I thought that Flash 5 Actionscript didn't support arrays with an array, but the output seems to suggest so.
View Replies !
View Related
Radio Button Interesting Outcome
Has anyone encountered this problem. If you have two radio buttons on the stage. Yes and No, If the user presses the yes button the main timeline stops and a movie clip appears. On this movieclip I have a button that removes the movie clip. The problem: The button does not act like a button. In fact when your mouse moves over the button it does not even change to a hand.
Has anyone encountered this? Is ther a way so that I can get this button to work?
Any help would be appreciated.
Bizzum
View Replies !
View Related
HitTest Only Runs On Mouse Over? "false" And "true" Give Same Outcome
Hey,
I've got a peculiar thing going on:
the code:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
with (this) {
if (_x<300) {
_alpha = 75;
_x = _x+(_x/10);
_xscale = 300-_x;
_yscale = _xscale;
c = 1;
} else {
_alpha = 0;
c++;
if (c == 50) {
_x = 10;
}
}
}
} else {
this._x = this._x;
}
}
The thing is...the script only runs if the mouse is over the clip. It doesn't matter if I use "false" or "true", the outome stays the same. ???
I've tried as is and:
"if (hitTest(_root._xmouse, ..."
Any suggestions?
cYa
View Replies !
View Related
Error 2101: The String Passed To UrlVariables.decode() Must Be Url-encoded Query String
I am trying to make a flash contact form which will submit the firstname, lastname, email and comments to an asp.net page.
I am have having the following error:
Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs
I am using the following action script code as pasted below. This action script is communicating with an asp.net file to send the email out. In the end it responds back with response=passed or failed.
I have already spent around 3 hours figuring it out.. and looking through the internet for resolution but no luck. Any help will be appreciated.
stop();
submit_btn.addEventListener(MouseEvent.CLICK, submit);
function submit(e:MouseEvent):void
{
var variables:URLVariables = new URLVariables();
variables.firstname = firstname_txt.text;
variables.lastname = lastname_txt.text;
variables.email = email_txt.text;
variables.comments2 = comments_txt.text;
var req:URLRequest = new URLRequest(”emailacount.aspx”);
req.method = URLRequestMethod.POST;
req.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);
status_txt.text = “Sending…”;
}
function sent(e:Event):void
{
status_txt.text = “Your email has been sent.”;
firstname_txt.text = “”;
lastname_txt.text = “”;
email_txt.text = “”;
comments_txt.text = “”;
}
function error(e:IOErrorEvent):void
{
status_txt.text = “There was an error. Please try again later.”;
}
and the following asp.net code:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net.Mail" %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Try
Dim fromEmailAddress = "paul@lancierinc.com"
Dim toEmailAddress = "rizwandar@gmail.com"
Dim firstName = Request.QueryString("firstname_txt")
Dim lastName = Request.QueryString("lastname_txt")
Dim comments = Request.QueryString("comments_txt")
Dim userEmail = Request.QueryString("email_txt")
'create the mail message
Dim mail As New MailMessage()
'set the addresses
mail.From = New MailAddress(fromEmailAddress)
mail.To.Add(toEmailAddress)
'set the content
mail.Subject = "Email from" & firstName & " " & lastName
mail.IsBodyHtml = True
Dim strBody As String = "<b>Email from</b>" & " " & firstName & " " & lastName & "<br><b>Email Address:</b> " & userEmail & "<br><b>Comments:</b> " & comments
mail.Body = strBody
'send the message
Dim smtp As New SmtpClient("mail.lancierinc.com")
smtp.Send(mail)
Dim urltoencodestring2 = "response=passed&err=0"
'Response.Write(urltoencodestring2)
Catch smtpEx As SmtpException
'A problem occurred when sending the email message
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a problem in sending the email: {0}');", smtpEx.Message.Replace("'", "'")), True)
Response.Write(smtpEx.Message)
Dim urltoencodestring = "response=failed&err=1"
'Response.Write(urltoencodestring)
Catch generalEx As Exception
'Some other problem occurred
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a general problem: {0}');", generalEx.Message.Replace("'", "'")), True)
Dim urltoencodestring3 = "response=failed&err=1"
'Response.Write(urltoencodestring3)
End Try
End Sub
</script>
View Replies !
View Related
String Passed To URLVariables.decode() Must Be A URL-encoded Query String...
I really don't understand why this won't work? I've made a test which sends some POST data to a script on my page which works fine. But why does not this work?
Code:
var mapsize = _cmap.fieldx.toString(16) + _cmap.fieldy.toString(16);
var names = "Zomis_AI6";
var description = "descr";
var result = "gameresult";
var upldata: String = "mapsize="+mapsize+"&names="+names+"&description="+description+"&result="+result;
trace(upldata);
var variables:URLVariables = new URLVariables(upldata);
var request2:URLRequest = new URLRequest();
request2.url = "http://www.zomis.net/record.php";
request2.method = URLRequestMethod.POST;
request2.data = variables;
var loader2:URLLoader = new URLLoader();
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
loader2.addEventListener(Event.COMPLETE, uploadcomplete);
try {
loader2.load(request2);
trace("Loaded");
}
catch (error:Error) {
trace("Unable to load URL");
}
Tracing gets:
Code:
mapsize=1010&names=Zomis_AI6&description=descr&result=gameresult
Loaded
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
View Replies !
View Related
Randomize String And Create Textfields With String Txts
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah
View Replies !
View Related
Convert Multiline String To A One Line String With RegExp
better get my own thread for that
How can I convert a multiline String to a one line String?
EX:
PHP Code:
Testing is always full of man made bugs.
<a href="http://www.betterthannothing.com" title="betterthannothing" target="_blank">
<font color="#22229C">Believe</font>
</a>
me when times comes that you have to
<a href="http://www.vreate.com" target="_blank">create</a>
useless stuff to test some other useless stuff to have
<a href="http://www.vreate.com">some</a>
real results.. its a pain.
<img src="http://www.markval.com/deerPack.jpg" height="484" width="352"/>
<em>Got to try that stuff to eventually love it one day.</em>
and should result in
Code:
Testing is always full of man made bugs.<a href="http://www.betterthannothing.com" title="betterthannothing" target="_blank"> <font color="#22229C">Believe</font></a>me when times comes that you have to<a href="http://www.vreate.com" target="_blank">create</a>useless stuff to test some other useless stuff to have<a href="http://www.vreate.com">some</a>real results.. its a pain.<img src="http://www.markval.com/deerPack.jpg" height="484" width="352"/><em>Got to try that stuff to eventually love it one day.</em>
I think it have to play with the ^ (caret) and m (multiline) ... just need to put the puzzle together.
View Replies !
View Related
String.as (Fishing Line Or Kite String)
Hello everyone. After reading the article on Glen Rhodes (Proud Canadian) I was wondering exactly how to insert the string.as file. I have been having huuuuuuge speed issues with my code. My file sizes are quite small (40 - 60 k)but they are very sluggish.
Thank you......
Please help
http://www.moodvibe.com
View Replies !
View Related
Trouble With String.indexOf And String.lastIndexOf
Hi,
I have an input text field used for time. I'm trying to set it up so the user has to enter a valid time into the box.
I set the box to be only 5 characters in length and to only use numbers and the ":" character.
I thought this code would insure there wouldn't be two ":" characters and the ":" would be at lease one character from the begining and at least two from the end.
But the if you enter 2:321 it comes back as a valid time.
Thanks in advance,
thurston
Code:
if(string.indexOf(":", 1) == string.lastIndexOf(":", string.length-3) ){
trace("Valid Time");
}else{
trace("Invalid Time!!!");
}
View Replies !
View Related
Changing A String Name In A Loop / Concatonating String Name?
Hey all,
Does anybody know of a way to change a string name as a loop proceeds?
This is the main piece of code that I wish to loop with i incrementing, so that whilst i=0 then:
_root.barARed._visible=barRed[i];
_root.barARed._width=barLength[i];
_root.barAYellow._visible=barYellow[i];
_root.barAYellow._width=barLength[i];
_root.barAGreen._visible=barGreen[i];
_root.barAGreen._width=barLength[i];
infoA.text=info[i];
and i=2 then:
_root.barBRed._visible=barRed[i];
_root.barBRed._width=barLength[i];
_root.barBYellow._visible=barYellow[i];
_root.barBYellow._width=barLength[i];
_root.barBGreen._visible=barGreen[i];
_root.barBGreen._width=barLength[i];
infoB.text=info[i];
and so on...I would use _root.barRedInstanceName[i]._visible=barRed[i]; but I can't give the movie clip (the bar) an instance name such as redBar[1], redBar[2] etc. (system reserved I'm told)
I guess what I am trying to ask in a roundabout way: is how do you concatonate the name, rather than the contents of a string?
Hope you'll forgive me if this is something really simple that I am overlooking, but I only have a very short experience of flash.
Thanks
Al
View Replies !
View Related
Ball Bouncing On String: Getting The String To Be Bigger?
I have a black line which is simply a movie clip and a yellow circle which is also a movie script. The ball works great, it bounces on the bottom of the movie, and you can pick it up and throw it around. So now I want to attach the ball to the black line. So:
1. How can I make it so that the top part of the line will stay in one position, and so that a bottom part of it will move around? Is there any way I can link the two at a certain point so that wherever the ball goes the line will stay attached to it at that point?
2. In an attempt to try and reach this point I came up with this script in the ball for when it is not being dragged anywhere. The most important bit is really the bottom:
ActionScript Code:
} else {
old.x = pos.x;
old.y = pos.y;
pos.x = _x;
pos.y = _y;
vel.x = (pos.x-old.x)*2;
vel.y = (pos.y-old.y)*2;
//Finds the change in position and adds that as an extention to the line:
_root.ballstring.height += (old.y - pos.y);
Anyone reckon they could help me out? Thanks!
View Replies !
View Related
Keeping A String A String With Dynamic Text
I've got some dynamic text (from MYSQL & ColdFusion) that needs to be kept as a string and is (i think) being converted into a number.
The recordset is returning 8'6" (eight feet, six inches)
and my dyn text box displays 86.
Anyway around this from within Flash? I know you can strict data type in AS 2.0 but no chance of migrating this project to 2.0!
View Replies !
View Related
What's The Best Way To Parse Out A Url String Using The String Object In Flash
I'm creating a CMS(Content Management System) tool so that users can change text and the changes be reflected in a text window in flash . The text that the user enters in the CMS tool will be stored in the database.
In flash I want to parse the string that I get from the database and look for URL strings that start with http "http://www.someurl.com" and parse out that substring.
For example the string could be "Please vist my site at http://www.site.com". I would want to parse out the http://www.site.com
If I find this url string I want to pre-pend the a href tag <a> and append the closing </a> tag to the string so that this link will be clickable from the textfield.
Does flash have an object that deals with Regular Expressions?
I've looked at the String object in flash but not sure how to achieve this task
I'm currently working on this so any ideas?
View Replies !
View Related
Randomize String And Create Textfields With String
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah
View Replies !
View Related
Pass A String, Return Object With Name String
I feel like this should be pretty easy, but I 'm not quite sure how to do this...
I've got a string that is the name of a movieclip which is on the stage. I'd like to write a function which I can pass that string and have it return the object which has the instance name of that string.
Any hints?
Thanks.
John
View Replies !
View Related
What's The Best Way To Parse Out A Url String Using The String Object In Flash
I'm creating a CMS(Content Management System) tool so that users can change text and the changes be reflected in a text window in flash . The text that the user enters in the CMS tool will be stored in the database.
In flash I want to parse the string that I get from the database and look for URL strings that start with http "http://www.someurl.com" and parse out that substring.
For example the string could be "Please vist my site at http://www.site.com". I would want to parse out the http://www.site.com
If I find this url string I want to pre-pend the a href tag <a> and append the closing </a> tag to the string so that this link will be clickable from the textfield.
Does flash have an object that deals with Regular Expressions?
I've looked at the String object in flash but not sure how to achieve this task
I'm currently working on this so any ideas?
View Replies !
View Related
Randomize String And Create Textfields With String
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah
View Replies !
View Related
Complex String.split And String.substring
Hey, Im an actionscript newbie and am having a little tourble with a string.
I have a string variable containing the value:
myString = "Johnny Lewis, Danny Lopez, Alex Prince, Sandro Lee, Nick Salvage"
What I want to do is trim their last name so it only shows their first initial, so it would be converted to:
myStringTrimmed = "Johnny L, Danny L, Alex P, Sandro L, Nick S"
So im guessing I need to split it by the commas, then split those again by the blank space.
The only problem is that this variable will be dynamic and the number of people in the variable will always be different. Sometimes there will only be one name, sometimes as many as five.
Any help would be much appreciated.
View Replies !
View Related
String = String + If(string.length) ... + String
A few languages have an IIf() statement, which works like the if statement, but is good for use inside of strings.
Flash 8 apparently doesn't have it, but I tried something similar to this..
Code:
_global.mStruct.mString = "My first name is " +
mf.text + if(mi.text.length > 0) { ". My middle initial is " + mi.text} +
". My last name is " + ml.text + "."
And I get
"Operator '+' must be followed by an operand", referring to the red + above.
Is there a way to do this, or do I need to just break into seperate if statements and appending the value to the value of the textbox?
Thanks for any help.
View Replies !
View Related
String Manipulation : Pad A String.length
hi,
i have an array of track/artist titles
_level0.trkList = [object #218, class 'Array'] [
0:[object #219, class 'Object'] {
label:"Jeff Beck - Space for the Papa",
data:"spacepapa.mp3",
__ID__:0
},
1:[object #220, class 'Object'] {
label:"Jeff Beck - Another Place",
data:"anotherplace.mp3",
__ID__:1
},
i wish to add the array to a track info listbox component,
in such a way that the individual items in the array are
padded with spaces -" ", so as the length of the shortest
string equals the length of the longest string,
my listbox output is now -
Jeff Beck - Space for the Papa| * from time array
Jeff Beck - Another Place| * from time array
by adding spaces i would like it to be-
Jeff Beck - Space for the Papa| * from time array
Jeff Beck - Another Place"""""""| * from time array
does anyone know how to do this ?
many thanks for any help,
View Replies !
View Related
LoadMovie - Target String Or Not String?
I'm trying to figure out what the major differences and/or uses for using a target as a string with double quotes or without quotes...
For example whats the difference between the following 2 lines?
1. loadMovie("products.swf",_root.dropZone);
2. loadMovie("products.swf","_root.dropZone");
I know the target in the second line is a string and the target in the first line is a MC object(?). Any other major uses for these 2 variations?
View Replies !
View Related
Can Trace String But Cannot Set String To Variable
Hi,
I am importing a some text values from a text file and then trying to pass this value via a function
I can TRACE the text value successfully but cannot set it to a variable.
************************************************** **************
function test(){
var aTestVariable
myData = new LoadVars()
myData.load("thenews.html")
myData.onLoad= function(success){
if(success){
trace(myData.Title); //THIS WORKS
aTestVariable = (myData.Title);
}
}
return aTestVariable
}
function testFunction() {
trace(test()); //THIS DOES NOT WORK!
}
************************************************** **************
Can someone please tell me what is wrong with this:
trace(myData.Title); //THIS WORKS
aTestVariable = (myData.Title);
HELP!
Rich
View Replies !
View Related
Trouble Finding A String Is A String
I'm trying to find a certain string I provide in another string, I know that in JavaScript you can use indexOf to find it:
myString = "hello world";
findString = "world";
if(myString.indexOf(findString) >= 0) {
alert("found");
}
I tried that in flash (replacing alert with trace) and it doesn't work
can anyone help???
View Replies !
View Related
Can't Pass String To Nc.connect(string)
hey guys. fairly new to flash, but I've managed to throw together a player with info and tutorials from here and other places. I've got everything just how I want it save for one problem. I've got an XML file that I get the URL for my server from and also get the names of videos to populate a list. Here's the problem:
I can get the URL into a string in my program (it traces fine). However, when i try to pass that string in my nc.connect(string) it doesn't work. Everything loads fine, but when you click a video, it can't connect to it. If I manually enter the URL into the connect field like this: nc.connect("rtmp://url") it works fine.
So am I missing something? Why can it take the URL manually entered and not from a string?
View Replies !
View Related
Find A String In A String Chaine
Hi, I need a function that detects if a string was found inside another string:
here's an example:
string1 = "ABC"
string2 = "FGABCJHG"
in this case, the function would return true...
any ideas on how to make this? i m being lazy, i could try to do it by myself but sometimes this kind of functions were already made by someone and they are in internet or whatever.
thanks!
View Replies !
View Related
Remove String (string Var - String Var )
hi guys ,
i need to remove a string to an other string
here a simple example
ActionScript Code:
var test1 = "test.allo255"
var test2 = "test.allo"
trace(test1)
trace(test2)
trace(eval(test1-test2))
i need to catch the number at the end
or remove the string part
(or even just a part , like if i can remove "test." and hang up with "allo255" its ok too)
here what i got ,
my output is
ActionScript Code:
_level0.my_sp.spContentHolder.img_mc5
i need to grab only "img_mc5" or only the # "5"
plz and a big tnx in advance
View Replies !
View Related
Save Object To String -> Load String And Convert Back To Object?
Wondering if anyone knows if this is possible. First a little explanation:
1. I have container grid where you can add and position MC's
2. The MC's x,y and other data is stored in a 3d object
3. The object is setup like this: matrix (object) -> levels (objects) -> profiles (objects). So basically a grid which mirrors what you see on screen.
This all works great; however, the application needs to have a save feature. My first thought was decode the matrix into an XML and save that.
Then I thought maybe you can just convert the matrix object to one big string and save that.
Questions: when the string is loaded back into the movie how do you (or can you even) covert it back in a object that flash can read?
Any help/input is greatly appreciated.
View Replies !
View Related
Number Or String => String
Hello people,
I have a function wich gets a number, this could be like 12.5(=number) or like "12.4"(=string).
I want the variable always to be a string;
function to_string(a_getal) {
// This is where the code should be
// if (a_number = [a number]) {
// a_number = string(a_number)
// }
trace(a_number.length); // This won't work if it's a number
trace(a_number);
}
to_string(12.4);
to_string("12.4");
Please, help!
Mzzl, Chris
View Replies !
View Related
Finding A String Within A String
Is there a simple way to find whether a string contains a string?
I'm looping through some xml and I want to have a search that finds whether the "description" attribute at each node contains the searched for term.
I'd like to do this without having to split the whole description at white spaces and turn the words into array elements. I thought there was some way to test whether a string occurred within a string....
View Replies !
View Related
Search String For String
Is it possible to search a string of text for a particular word?
I thought i could use indexOf() but it's not doing what i thought it would.
i am building a chat app and would like to incorperate some effects like quick alpha fades, elastic effect on the chat app when a word is found in the msg sent.
I have the effects in place just trying to figure out how to trigger them.
Effects:
(flasher)
(squiggy)
(happy snapping)
Thanks
Paul
View Replies !
View Related
How To Search String In String?
Hey,
Does anyone know how to search a string in a string. For a reference, it is same as what we do in VB using instringrev() function. It works by passing two strings to it. instringrev(string1, string2). The string1 is the string that we are searching and string2 is the string that we look for string1 in.
Please can anyone let me know how to do this in Action Script 3.0 . What I am doing is creating an XML table and storing it in a variable. Now I want to search the table for a particular string.
Thank you in anticipation.
View Replies !
View Related
String Var Defined By Another String Var?
Let's take the following...
ActionScript Code:
var motto_en:String = "God and my right";
var motto_fr:String = "Dieu et mon droit";
trace(motto_fr);
This returns Dieu et mon droit. Cool. But if I try this...
ActionScript Code:
var motto_en:String = "God and my right";
var motto_fr:String = "Dieu et mon droit";
var lang:String = "fr";
trace("motto_"+lang);
... what I get back is motto_fr, which is not cool, because I want to get back Dieu et mon droit.
Basically I'm looking for a setup like the second example that returns the value of "motto"+lang.
HELLLLP!, please. Thanks!
View Replies !
View Related
Search String For String
Is it possible to search a string of text for a particular word?
I thought i could use indexOf() but it's not doing what i thought it would.
i am building a chat app and would like to incorperate some effects like quick alpha fades, elastic effect on the chat app when a word is found in the msg sent.
I have the effects in place just trying to figure out how to trigger them.
Effects:
(flasher)
(squiggy)
(happy snapping)
Thanks
Paul
View Replies !
View Related
Replacing A String With Another String ?
Hi
Following is the script written first to match the values from one array to another and then replace the values in an array with the values stored in 3rd array...well sounds confusing...just have a look at it...
----------------------
info=["M", "12/12/2000"];
search=["Gender", "date"];
b=["gender", "date"];
String.prototype.searchReplace=function(find,repla ce) {
return this.split(find).join(replace);
}
var myString = "{gender}";
//trace(data[0]);
if(search[0].toLowerCase() eq b[0]){
var newString = myString.searchReplace(search[0], info[0]);
trace(newString);
}
--------
Can anybody tell me why my string is not getting replaced....in the above code...I want my output to be...{M}...
thx
View Replies !
View Related
Query String ( Get String )
Lately I've been sick of the fact that I can't query the get string, dont' know how many other people are having this issue, in any case I wrote a class that doesn't require you to have any javascript in the html, and it's really simple to use, so here it is if you guys wanna improve it feel free, I'll do what I can when I get the time. Which isn't often.
TakeCare.
_Michael
ActionScript Code:
import flash.external.ExternalInterface;/* * Created so that I can query values from the get string. * *@author: Michael Avila*/class URLQuery{ // Instead of calling a function from javascript // we will build the function in flash and call it private var get_url_function:String = "function get_url(){return window.location.toString();}"; // a multi-dimensional array that contains the name value pairs, index[0] is the name and index[1] is the value private var name_value:Array; /* constructor */ public function URLQuery() { name_value = new Array(); // here we are making the call to our function, and we are taking it's return value, then we are spliting // it in half at the first ? and taking the right side of the string, then we are spliting into another array // this array will be split up on all of our & symbols name_value = ExternalInterface.call(get_url_function).toString().split("?")[1].split("&"); buildNameValues(); } /* * You pass in the value for the variable, and we will return it if it extists * if it doesn't we will return null */ public function queryString( getVar:String ):String { for(var i:Number=0; i<name_value.length; i++) { if (name_value[i][0] == getVar) return name_value[i][1]; } return null; } /* * Builds are name_value array, simple parsing */ private function buildNameValues() { for (var i:Number=0; i<name_value.length; i++) { name_value[i] = name_value[i].split("="); } }}
View Replies !
View Related
String String Behaviour
Hi,
Please check and let me know whether I am doing something wrong
Code:
var answers:Array=new Array("0070","0006","0454","5356","7276","0767","4373","0646","1545","1252");
var count:int=2;
var sx:int=int(answers[count].substr(0,0));
var sy:int=int(answers[count].substr(1,1));
var ex:int=int(answers[count].substr(2,2));
trace("ex "+ex);
var ey:int=int(answers[count].substr(3,3));
trace( sx+" "+ sy+" "+ex+" "+ey);
Below is the output I am getting, I should be getting value of ex as 5 whereas I am getting it as 54. Am I doing something wrong?
Code:
ex 54
0 4 54 4
View Replies !
View Related
Replacing A String With Another String ?
Hi
Following is the script written first to match the values from one array to another and then replace the values in an array with the values stored in 3rd array...well sounds confusing...just have a look at it...
----------------------
info=["M", "12/12/2000"];
search=["Gender", "date"];
b=["gender", "date"];
String.prototype.searchReplace=function(find,repla ce) {
return this.split(find).join(replace);
}
var myString = "{gender}";
//trace(data[0]);
if(search[0].toLowerCase() eq b[0]){
var newString = myString.searchReplace(search[0], info[0]);
trace(newString);
}
--------
Can anybody tell me why my string is not getting replaced....in the above code...I want my output to be...{M}...
thx
View Replies !
View Related
If A STRING Contains ___, Then...
I can't find any info on this so I was wondering if the nice folks at Flashkit could help...
I have a user-input text field, where I need to look at what the user typed and if the string CONTAINS certain words, give them different outcomes.
How can I search a string to see if it CONTAINS certain key words???
View Replies !
View Related
Cut String
what is the best method to cut this string?????
a DON'T want to have the letters after the dot and the dot itself.....
pic = "examplepic.jpg"
this should be the result:
pic = "examplepic"
thx
View Replies !
View Related
Cut String
i have a string from a textfield....like 000345
what i want is to cut all the zeros in front of the number
000345 ---> 345
your hints please...thx
View Replies !
View Related
How To Take
From A String?
What I need to do is to load a variable from the text and then load data from a textfile, the name of which I get from a variable. So basically, (using LoadVars) this looks as:
Code:
fname = new LoadVars()
fname.onLoad = function () {
newname = fname.filename;
newfile = new LoadVars();
newfile.load(newname + ".txt");
}
fname.load("data.txt");
The problem is that when I pass the value of fname.filename to newname var, it inherits /n/r, and if I try to load a file named newname/n/r.txt, it doesn't do so.
Is there any way to clear the var of all /n and /r's?
Thanks.
View Replies !
View Related
STRING HELP
Flash 5.
How to evaluate an input text field where user is supposed to write a SENTENCE (not a word) into and I want to know if that sentence contains the word "car" for instance. If it does Flash goes to one place if it doesn't to another. Controling all that from a MC
THX
Alek
View Replies !
View Related
|