Change string to variable (sort of)

Hi. I am making a game in flash which requires lots of
similar functions, such as
function getSomeNumber():Number{
return number;
I was wondering if i could generalize this by doing the
following. take a parameter of string defining the name of the
variable. i then want to change this string to the name of the
variable so that i can output the value of the variable. a bit like
this
function getSomeNumber(nameOfVar:String):Number{
//somehow use string to find out variable name and return
value of variable
return unknown;
hope this makes sense.
trigger2160

@kglad: yeah, I see what you're saying there kg, but I think
he's just wanting a return from a previously created list of
variable references. I'm not sure why he wouldn't call them
directly, but I think it has something to do with the user input
from his system being in the form of a String, so he wasn't able to
access the value of the var named similarly ... but I follow you,
and I guess I should have even simplified the return as ...
return this[nameOfVar];
... rather than setting up the extra reference in the
function, but your method is the way to go for constructing a new
variable from an input String and value, and I love the wildcard
use here, didn't know that would work, cool.
OH, but hey (@trigger also) if the variable already exists,
one should be able to reference it directly by calling ...
this['something'];
... and if you've got a function which is gathering the input
you could say ...
value = this[input];
... if 'input' is in the form of a string, and it should
return the value of the variable, without having to call to a
function, right? that's what you're saying by 'just use it
directly', I got it now :)

Similar Messages

  • Can't change string variable values in Flash CS4 Debugger

    I'm using the Flash CS4 debugger, and while I can change numeric variable values in the Variables panel, I can't change string variable values. The only characters the fields accept are the numbers 1-9 and the characters "d" and "j".
    I can  paste strings  into the value fields, but that's a bit of a pain. I've tried this on a couple of different Flash CS4 installations and get the same results.
    Does anyone know if it's possible to change string values in the Variables panel of the Flash CS4 Debugger?

    See:
    http://forum.java.sun.com/thread.jspa?threadID=591012&tstart=15

  • How to Change String Default Sort Order for Table?

    I have a RichTable with SortableModel, but all string properties sort as follows:
    AAAAAA
    ZZZZZZ
    aaaaaa
    bbbbb
    zzzzzz
    As you can see upper case is before lower case, however I know I'm going to be told that they need to be like this:
    AAAAAA
    aaaaaa
    bbbbb
    ZZZZZZZ
    zzzzz
    Is there a way I can change / override how this sorts?
    Thank you,
    Kris

    So I think you are saying that I need to create my own wrapper class for String. Then override the compare and equal methods and return this class in my getters and setters?
    Or is there a way to tell the String class to use a different method for sort since it would be a global change?
    Thank you,
    Kris

  • Action on Change of a variable possible? Fe. in combination of checkbox widget.

    Hello,
    I'm using the checkbox wizard with 35 items from wich the user has to select max. 7 items. The checkbox wizard is a great tool that keeps the choices in user variables.
    Is it possible that  for every (de)selection a choice a counter keeps track of the number of choices and perfoms an action when the status of 7 is reached? Or is there an alternative?
    Lucas

    I have been blogging about the checkboxes widgets, you don't tell the version you are using? Because it has been replaced totally by the Checkboxes Learning interaction in CP8 and its latest version allows also to control what is displayed by changing the associated variables.
    However it remains a static widget, which means that it cannot trigger an action, because it doesn't have events: Events and (advanced) Actions - Captivate blog
    Even if it was an interactive widget, it wouldn't have helped. You will need an interactive object like a button to trigger an advanced (or shared action) that will count the number of variables that have a value different from 'null' Where is Null? - Captivate blog. 
    It will never be possible to trigger an action when the counter reaches 7, because the action will only be executed when the interactive object is clicked.
    Alternative: at this moment I only see to create the radio buttons yourself (use shape buttons) and each button can trigger an advanced/shared (use shared if you are on CP8!) action that will increment a counter and store the choice in a user variable, then (second decision in a conditional action) checks if the counter has reached the value of 7 to give a warning that the allowed number of choices has been reached and eventually disables all the shape buttons. I mention a shared action, because you'll need 32 instances of that action.

  • BEx: How to change a Query Variable that is not visible in Filters List?

    Hello Experts,
    Good day, I'm currently editing an old query, I am changing the Query Variables with new ones, but I found one variable that I cannot replace.
    Please see the screenshot below, in the Query Properties Window [Variable Sequence Tab (right side of picture)] the Variable that I am trying to replace (Unit) is visible. But when I look for the variable in the "Filter Tab" (left side of picture) under Characteristic Restrictions, it doesn't exist in the list.
    How can I find this Variable and replace it with a new one?
    Other reports are still using this variable so it will impact the other reports if I simply edit the variable. So I need to replace it with a new variable instead.
    Thank you for your time.

    Hi,
            SInce you are searching for a variable for Unit, look into below screenshot and navigate to the variables.
    First click on drop down and select 'Entry for variable' then you will get lisl (after you click on drop down in 'Target Unit' drop down option.
    Normally these type of variable called 'Formula Variable' try editing any of the formula and locate the option as shown below,
    Hope it helps! don't forget to update the final solution and mark the correct/helpful answers.
    Remember it will help others to find the solution and motivate the members to answer your question.
    Thanks,
    Umashankar

  • How to change the text variables for a standard report-writer report ?

    I am trying to change the text variables for a report -writer report and transport the same so as to change the title page and the report output heading  .I know the Report-Group 6Z02 and the library 6O1 to which it belongs.I tried using the change transaction GR32 after going to the area menu through FGRP . I try to change the text variables through  but it throws an error "You chose a name in the reserved name range - try different name ".
    I have also tried copying this report into another report and changing the new report . I was able to change and save the text variables . Now when I try to overwrite the original report 6Z02-001 with this new report , it does not allow that.
    Let me know how I can change the text variables for the same

    Can anyone please suggest me what to do here ?

  • Essbase server - automatic change of substitution variable from SQL

    Hi,I would like to automaticaly change the substitution variable in Essbase Server. Is it posible to change the substitition variable from external source e.g. SQL statement?Simple sample:I would like to assign value "2003" to "CurYear" substitution variable. But value "2003" I would like to get from SQL:"select year(current date) from table".There are commands in Esscmd and MaxL Shell, see bellow.Esscmd command:CREATEVARIABLE "CurYear" "localhost" "" "" "2003";MaxL Shell:alter system set variable CurYear '2003';Is it possible to get the value '2003' from SQL and pass this value to Esscmd command or MaxL Shell?My system:Windows 2000 Professional Service pack 4Essbase at 6.5.3 levelThanks,Grofaty

    You can create a text file from the SQL server that writes the command like"CREATEVARIABLE "CurrYear" "Servername" "AppName" "DBName" "2005";then you can create a schedule job that would run this script which can update the variable. CREATEVARIABLE creates/replaces the current variable.

  • URL Not Changing Session State Variables Specified

    I am trying to change a variable on a target page with a URL, however, the variable never changes. The variable is set to 8. I send the following URL which should change it to 0 but it does not change.
    We just recently upgraded to 1.6
    Why is this not working. It still works on pages I designed prior to the upgrade, but I can't get it to work since the upgrade.

    I am trying to change a variable on a target page with a URL, however, the variable never changes. The variable is set to 8. I send the following URL which should change it to 0 but it does not change.
    We just recently upgraded to 1.6
    Why is this not working. It still works on pages I designed prior to the upgrade, but I can't get it to work since the upgrade.

  • Change the environment variables for sid adm failed

    Hi Experts,
    I have installed ECC HA on AIX/ORACLE
    now i want to change the environment variables for the qr1adm user at the standby node
    i tried to change the /home/qr1adm/.profile with command
    vi  /home/qr1adm/.profile  it is changed  and i saved this changes.
    now I login with qr1adm user and i executed this command
    env |more
    it comes with the old values
    i don't know why?
    and if i oppened the .profile file i'm finding the new values
    So could you please tell me how can i change the environment variable for qr1adm user
    Thanks
    Sherif
    Edited by: Sherif Eid on Jan 23, 2008 9:08 AM

    Thanks Sridhar ,
    which hostname?
    for example i have
    .dbenv_R3QASsvc.csh
    .sapenv_KFGKWERPR303.csh
    i want to tell you that R3QASsvc is the virtual hostname
    and KFGKWERPR303 is the name of the primary node A
    and the phiscal host name of node B is KFGKWERPR307
    so which one should i change it?
    thanks
    Sherif
    Edited by: Sherif Eid on Jan 23, 2008 11:59 AM

  • How to use type cast change string to number(dbl)?can it work?

    how to use type cast change string to number(dbl)?can it work?

    Do you want to Type Cast (function in the Advanced >> Data Manipulation palette) or Convert (functions in the String >> String/Number Conversion palette)?
    2 simple examples:
    "1" cast as I8 = 49 or 31 hex.
    "1" converted to decimal = 1.
    "20" cast as I16 = 12848 or 3230 hex.
    "20" converted to decimal = 20.
    Note that type casting a string to an integer results in a byte by byte conversion to the ASCII values.
    32 hex is an ASCII "2" and 30 hex is an ASCII "0" so "20" cast as I16 becomes 3230 hex.
    When type casting a string to a double, the string must conform the the IEEE 32 bit floating point representation, which is typically not easy to enter from the keyboard.
    See tha attached LabView 6.1 example.
    Attachments:
    TypeCastAndConvert.vi ‏34 KB

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Unable to go to change mode of variable in BI query designer

    Hi Friends,
    I need to change the variable in BI Dev server to meet the requrement, but when ever i am trying go to change mode of variable (right click on the variable and click on restriction) getting the error that <i>"the key is already is assosiated with an element of this collection".</i>
    Already i have updated my GUI for BI and able to open and create the queries
    can any body give me solustion please.
    Thanks,
    Shaliny.

    Hi Sebastian,
    Just see whether you have included nay keyfigures in your column.
    Because the suppress result option is grayed out if you donu2019t have any keyfigure in your queries.
    Thanks and regards
    Arun

  • How to change String to double ?

    I want to change String to double in Applet program, but for the run time, error is occurred.
    It can not find the method parseDouble.
    Error -> Double.parseDouble("7.5");
    I try to test String to Integer, it works fine.
    OK -> Integer.parseInt("7");
    How to change String to double in Applet ?

    Yea, the Double.parseDouble method came in a later release (first time in 1.2).

  • [svn] 3438: Forgot to change a private variable to protected in my previous check-in.

    Revision: 3438
    Author: [email protected]
    Date: 2008-10-01 08:27:31 -0700 (Wed, 01 Oct 2008)
    Log Message:
    Forgot to change a private variable to protected in my previous check-in.
    Modified Paths:
    blazeds/trunk/modules/core/src/flex/messaging/services/messaging/ThrottleManager.java

    Hi Ignacio ,
    To change the username you should follow these steps ;
    1-You should have to use nQUDMULGen command to export your rpd into a file.Go to ...OracleBI\server\Bin
    ex. nQUDMULGen -u Administrator -p Administrator -r C:\OracleBI\server\repository\paint.rpd -o c:\paint.txt
    2-After importing try to find your user and change its settings.
    3-Then import it back to your rpd.
    ex. nQUDMLExec -u Administrator -p Administrator -i c:\paint.txt -b C:\OracleBI\server\repository\paint.rpd -o C:\OracleBI\server\repository\paint2.rpd
    The new rpd is going to be created (paint2).Test the new rpd.If its OK.Then replace with your original rpd.
    I hope this method works...

  • Change a global variable with a function

    HI ALL!
    I have the following problem...
    I would like to change a global variable with a void function so not like this: variable = function(); .
    What do you suggest?
    Best regards,
    Korcs

    I have the following problem...
    I would like to change a global variable with a void
    function so not like this: variable = function(); .
    What do you suggest?>
    >
    I dont quite understand your question but if your variable is a reference to an object then you can certainly have a method to alter the object that the reference is pointing to and/or the reference itself..
    otherwise your 'function' will have to return the same type as the variable itself in order to do the assignment as you demonstrated, regardless of wether it's C, C# or Java, AFAIK, WIRNM
    HTH

Maybe you are looking for

  • Query for Linking Two Tables without Reference

    Hi Folks, Good Day! I have this dilemma on how to link two tables without a reference. In the Business Partner Master Data, there is a field for the Territory which is from the table OTER. This OTER focuses on its description. Once you have added the

  • Bridge does not open Photoshop CC files

    When I try to open a photoshop cc file in Bridge I get a message that says " Windows cannot find C:\Program Files\Adobe\Adobe Photoshop CS5 (64 Bit)\Photoshop.exe Make sure you typed the name correctly and then try again.  Even though The last versio

  • My storage is almost used up by 40gigs of'Other'. What is this and how do I reduce it?

    Can anyone help on this storage problem? On a PC you just run disk clean up routine but what do you do on a Mac?

  • Resource plan not migrating to all targeted cluster members

    Hi, We got an environment setup like: Physical machine 1: AdminServer, OSB1, WLS1 Physical machine 2: OSB2, WLS2 Where we have put OSB[1,2] into a cluster and WLS[1,2] into a cluster. The servers are running WLS 10.3.3.4. The problem is that: When cr

  • Backlight problem, very weird

    Hi! I have a HP 6730s laptop, the screen had a vertical green line in it so I decided to switch the panel out. I actually had an extra display assembly from another machine(same type). I tried it out but the backlight was not working, the display its