Help with the variables!

First of all, allow me to apologize for my screen name, I tried to 31 different names and none of them would work, pretty bad if you ask me.

I tried a project for more than a year, who failed miserably after that I have had no help anywhere I asked, but the circumstances are bring me to take over this project.

To expose my project, this is a great Simulator, created in Excel, and he got several very large databases in this regard. However the most simplest thing; variable, kept me from using flash to complete the project. I don't know how to explain it more simple, that I was just on the sites of more than a dozen on the first page of google that attempt to explain the use of variables and text boxes and none of them worked.

Let me to you, my problem is that no matter what I try, I have dynamic text boxes that always return a value of NaN. I'll give my method to have an entry box return values for dynamic areas.

My first step is to have a box of text, with the defined variable such as; rlevel and a dynamic as; text box points. I have a button that applies to text input in the dynamic area.

It's the actionscript on the button;

on (release) {}

=(rlevel-1) points * 4;

}

It's pretty basic to start, but no matter the method I tried he always returns NaN. Another alternative, I've tried is defining the dynamic and input areas and other variables and do the math an individual variable;

Level = x;

points =(x-1) * 4

on (release) {}

bpoints = points;

}

Once more, this returns Nan in my box of text dynamic and undefined in my Inbox.

I'm very fluent with the mathematical formula and I have a lot of additions to make, however as said I can't get beyond the most basic part of my project once more despite the continuation of many tutorials on the subject, that note saying to do exactly what I have made. An example of method as reference is the following;

founded_date = 2000;

closing_date = 2003;

on {(press)

founded_date closing_date = years_running;

}

This is no different that mine, and she always returns NaN. I did successfully a dynamic > entry text box function, just by;

on (release) {}

points = level

}

and the string level is returned correctly, he simply refuses to do so with a calculation. I'm very lost and confused and do not want to give up my plans once more. Kudo to ANYONE who can explain what is happening. I hope this time someone mind helping me.

Chances are your first attempt to get a screen name would have stolen, but for some reason, their registration system rejects anything you enter... After some trial and error, I found that you just ignoring the message gets the name you want (unless it's really had).

For all your troubles go with the textfield, I recommend to avoid the use of the var of the textfields and just manipulate their text property.  Name the instance textfields in the properties panel instead of specifying a var for them.  Let's say you a myPoints name and the other MonNiveau.  Your button code would look like...

on (release) {}

myPoints.text = String ((Number (myLevel.text)-1) * 4);

}

If AS2 is often very indulgent if you do not throw things like a string or a number, it just helps to ensure that things are designed to work correctly if you use them.  A textfield contains string values, so treat them as numbers, you throw as the Number(), and if the result is assigned to a textfield, casting while he is a String [] is appropriate.

If you always go to AS3, it's not at all forgiving and textfields var element no longer exists.

Tags: Adobe Animate

Similar Questions

  • Please help with the variable corresponding full framework

    HI :-), could someone please hepl a beginner?

    I'm writing a small script AS3 in CS4 that allows me to take a step back and forward through an animation.

    I have a stop button a play button rewind button and a button to the front.

    the buttons work ok apart from when I hit the button to rewind sometimes it jumps to the beginning of the timeline rather than just take a step back a frame at a time.

    When I use the button stops the timeline where he is, the rewind button steps back as needed. But if you click on the button rewind everything first, he jumps at the beginning of the timeline, I know the theory as to why I can't get this to work.  I need to know how to increment a variable of integer type (meter) to increment as the playes of animation. that is the counter variable to match the chassis number.  Here is the code I have, someone could please tell me how to match a variable of integer type to the current image and tell me where to insert the line of code on the list. I added a fictitious line or pseudo-device code to show what I'm trying to do, but the syntax is wrong.

    ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ ----------------------

    var counter = 1;

    gotoAndStop (counter);

    function setupevents()
    {
    buttonplay.addEventListener (MouseEvent.CLICK, playbutton);
    buttonstop.addEventListener (MouseEvent.CLICK, stopbutton);
    buttonrewind.addEventListener (MouseEvent.CLICK, Retouret);
    buttonforward.addEventListener (MouseEvent.CLICK, forwardbutton);
    }

    SetupEvents();


    It's the dummy line or pseudo-device code that I mentioned in the question above...
    counter = frame;

    function to play the movie
    function playbutton(event:MouseEvent)
    {
    Play();
    }

    function to stop the movie using the stop button
    function stopbutton(event:MouseEvent)
    {
    Stop();
    }


    function to take a step back through film using the rewind button
    function rewindbutton(event:MouseEvent)
    {
    If (Counter > 1)
    {
    Counter = counter - 1
    }

    gotoAndStop (counter);
    }


    function forward through film using the following button. I used a value of 60 because it comes to the amount of images in the scenario

    I don't know if this is a way of doing things or not
    function forwardbutton(event:MouseEvent)
    {
    If (Counter < 60)
    {
    Counter = counter + 1
    }
    gotoAndStop (counter);
    }

    ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----------------------------

    I know that the code is rough and base but any help would be greatly appreciated, I tried to attach the .fla for anyone who needs more information about this.  But this Web page returned an error ""the content of this attachment type is not allowed.".

    Auldy66

    var counter = 1;

    gotoAndStop (counter);

    function setupevents()
    {
    buttonplay.addEventListener (MouseEvent.CLICK, playbutton);
    buttonstop.addEventListener (MouseEvent.CLICK, stopbutton);
    buttonrewind.addEventListener (MouseEvent.CLICK, Retouret);
    buttonforward.addEventListener (MouseEvent.CLICK, forwardbutton);
    }

    SetupEvents();

    It's the dummy line or pseudo-device code that I mentioned in the question above...
    counter = frame;

    function to play the movie
    function playbutton(event:MouseEvent)
    {
    Play();
    }

    function to stop the movie using the stop button
    function stopbutton(event:MouseEvent)
    {
    Stop();
    }

    function to take a step back through film using the rewind button
    function rewindbutton(event:MouseEvent)
    {
    prevFrame();
    }

    function forwardbutton(event:MouseEvent)
    {
    nextFrame();
    }

  • Help with the session variable PHP CS5.5 - Please

    Hi all

    I am needing a little help with the help of a session variable, and I hope someone can point me in the right direction.

    I created a PHP page that uses the Dreamweaver 'User authentication' feature and the basics of this works very well, to direct a user to the correct page depending on whether they are or are not a valid user. I want to customize the page 'user valid' with people, user name entered in the authentication of the user table... a seemingly simple task using a session variable, but I just seem not to be able to make it work!

    The generated code for the AU on page 1 is the following:

    <? PHP

    Validate request to connect to this site.

    If (! isset {})

    session_start();

    }

    $loginFormAction = $_SERVER ['PHP_SELF'];

    If (isset($_GET['accesscheck'])) {}

    $_SESSION ['PrevUrl'] = $_GET ['accesscheck"];

    }

    If (isset($_POST['txtfirst_name'])) {}

    $loginUsername = $_POST ['txtfirst_name'];

    $password = $_POST ['txtsurname'];

    $MM_fldUserAuthorization = "";

    $MM_redirectLoginSuccess = "member_update.php";

    $MM_redirectLoginFailed = 'login.php ';

    $MM_redirecttoReferrer = false;

    @mysql_select_db ($database_panto, $panto);

    $LoginRS__query = sprintf ("SELECT firstname, name OF web_access WHERE firstname = %s AND family name = %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysql_query ($LoginRS__query, $panto) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    If {($loginFoundUser)

    $loginStrGroup = "";

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}

    Declare two session variables and assign them

    $_SESSION ['MM_Username'] = $loginUsername;

    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    If (isset($_SESSION['PrevUrl']) & & false) {}

    $MM_redirectLoginSuccess = $_SESSION ["PrevUrl"];

    }

    Header ("Location:".) $MM_redirectLoginSuccess);

    }

    else {}

    Header ("Location:".) $MM_redirectLoginFailed);

    }

    }

    ? >

    First of all, the text highlighted in red above seems to be setting the session variable that I need. Is this correct?

    If so, what is the code that I need to put on page 2 to use this session variable? or

    I have to do something else on the page 1 to correctly assign the session variable?

    Would be very grateful for your expertise

    Mark

    It seems that you put the columns incorrectly in the user authentication server behavior. This is the SQL query that checks the credentials of the user:

    $LoginRS__query = sprintf ("SELECT firstname, name OF web_access WHERE firstname = %s AND family name = %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    You are looking for first name and last name, while you should look for the user name and password of the user.

    $_SESSION ['MM_Username"] is a session variable that stores the login name of the user. To use it in a page, all that is needed is the page start with session_start(). You can then echo the value to display.

    If you want to display the person's true name, you must create a recordset in the second page, use of $_SESSION ['MM_Username'] to search for the first name and the patronymic. Alternatively, you can change the code like this (I copied only part of it):

    $LoginRS__query = sprintf ("SELECT firstname, surname OF web_access WHERE firstname = %s AND password is %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysql_query ($LoginRS__query, $panto) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    If {($loginFoundUser)

    $loginStrGroup = "";

    $row = mysql_fetch_assoc ($LoginRS);

    $_SESSION ['full_name'] = $row ["FirstName"]. ' ' . $row ['name'];

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}

    Declare two session variables and assign them

    $_SESSION ['MM_Username"] = $loginUsername;

    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    You can then use $_SESSION ['full_name'] in a page which begins with session_start().

  • Help with the Powershell script to collect logs from all domain controllers

    I am writing a script to retrieve the last 5 days of application, security and log files from all domain controllers. The script runs, but fire the logs from the local server only. The variable $Computer has all of my DC so it's the fine mark. I guess it's a problem with my line ForEach-Object, but is not error. See the below script.

    $log = 'application '.
    $date = get-date-format MM-DD-YYYY
    $now = get-date
    $subtractDays = new-object System.TimeSpan 5,0,0,0,0
    $then = $Now.Subtract ($subtractDays)
    $Computers = get-ADDomainController-filter *.
    ForEach-Object - InputObject $Computers - process {Get-EventLog - LogName $log - after $then - before $now - EntryType error | select EventID, MachineName, Message, Source, TimeGenerated |} ConvertTo-html | {Out-file $env:TEMP\Applicationlog.htm}
    Invoke-Expression $env:TEMP\Applicationlog.htm

    Thank you

    Rich

    Hello

    To help with the repost the question script to the script Center Forum

    http://social.technet.Microsoft.com/forums/scriptcenter/en-us/home

  • Please help with these variables

    Thanks LucD and RvdNieuwendijk for helping me with the first part of my script, now I'm stuck again.  In most cases, the script works fine, the commented sections (1-3) are what I want to do in the script.  Even if I had two beautiful solutions for my first problem, which was to record the name of the virtual machine and a custom attribute named "assignee" to a variable, I went with the response as provided LucD.  Now, here's my problem.

    I want to save the new variables and then turn around and create a virtual machine with the same name as the variable $_. Name and then complete the custom attribute "assignee" with the variable recorded for the assignee.  What I've done so far was to save the $_.name in a text file, which will then create a virtual machine with the same name as that deleted line 10

    Line 11, I chose to use Stop-VM because the virtual machine will get deleted, so no need to a gradual stop.

    For line 9, I did that just to make me see the name on the screen, which will be removed

    Given that the new variables will have to name the virtual computer, the 10 online list will help me to keep track of all those and then deploy.

    I'll change the script to get data warehouses that have a certain amount of disk space, and I will choose random data warehouses and hosts ESXi Get-random, I'm just trying to get the core of the script works now.

    Sorry, I'm getting long-winded, all I want now is to save the new variables of lines 4-6 in a big variable, or arrray or something and then I want to create a virtual machine with the same name VM and the custom attribute filled with what "assignee".  Thanks for any help.

    # 1. Get the name of the virtual machine and the assignee of the virtual machines to deploy and save those as a variable
    # 2. Remove the existing VM with the same name
    # 3. Use saved data to deploy a new virtual machine with the same name and the assignee who has been registered
    1. $AllVMs = @)
    2 get-file TestDeploy | Get - VM | {foreach}
    3. $assignee = Get-Annotation-entity $_ - CustomAttribute "Assignee" - ErrorAction SilentlyContinue
    4 new-Variable - force - ErrorAction SilentlyContinue-name $_. Name - value (New-Object PSObject-property @ {}
    5 VM = $_.name
    6. the assignee = $assignee. Value
    7. })
    8. $AllVMs += $_. Name
    9 write $_. Name
    10. $AllVMs | Out-file c:\psresults\NewDeploy.txt
    11 if ($_.powerstate - eq "receptor") {stop-VM - VM $_}
    12 if ($_.powerstate - eq "Receptor") {Start-Sleep-3 seconds}
    13 remove-VM - VM $_ - DeletePermanently
    14.}
    15. (type c:\psresults\NewDeploy.txt). Foreach {new-VM-model (Get-"TemplateName") - name $_-location (Get-folder 'TestDeploy')'}
    16 - data store (data center, Get Data Center |) Get - Datastore 'Datastore') Spec - OSCustomizationSpec - VMHost (Get-VMHost 'MyHost')
    17.}

    I found the problem, the script was pouring out the complete variable instead of just the value.

    The line should be like this

      $AllVMs += (Get-Variable -Name $_.Name | Select -ExpandProperty Value)
    

    I've updated the two script above.

  • What is the correct way to ask for help with the forum, rather than product, questions?

    I can't find the right way to ask a question about the forums themselves.

    PAGulley said

    I can't find the right part of the forum to ask questions about the forum itself and its features. I wonder what the right place and the way is to get help with the forum system itself. I can find the place to ask questions about specific Mozilla products very well.

    Look up where it says contributor tools and select Contributor Forums. Make sure that you scroll to the top or you'll get a bar with different links instead,

    The forum is https://support.mozilla.org/forums where you question would be better in the SUMO community discussions.

  • Need help with the installation of an adapter of Palit GeForce 9500GT Super chart - 512 MB in a M2N68 (narrated

    Need help with the installation of an adapter of graphics Super Palit GeForce 9500GT - 512 MB - DDR2 SDRAM in a M2N68 motherboard (narra6). Should I disable the onboard graphics in the bios? When the card is installed, no VGA work outs and the PC does not start. Checked and recontroler implementation of the card in the PCI slot. PC is a desktop HP G5200uk PC. Windows 7 operating system.

    Hello

    The link below is a guige to install a video card in your Pc.  In particular, it seems that you will have to perhaps specify the location of the new card in the bios and save this change before you install the new card - see step 4 in the guide on the link below.  If your new card fits into the PCI Express x 16 slot, you will need to define PCI Express in the bios and save the changes.

    http://support.HP.com/us-en/document/c01700855

    Kind regards

    DP - K

  • help with the beats on my envy 17-3270nr, n key

    help with the beats on my envy 17-3270nr key. recent Smart hard disk crash, replaced with exact same hitachi drive, same care extended warranty repairs covered of the Frys. Windows 7 Edition home premium w / service PAC 1 installed, drivers installed, except that now there is no volume of beats on screen graphic dial button, click the button on top button on the page does not call the beat of the application settings. Futhermore; the motion sensors of laser to activate the keyboard backlit keyboard do not work.  Are there drivers hp software to enable the missing features?

    Hello

    Download and install the following.

    HP OSD utility.

    Proximity sensor driver.

    Once completed, restart the laptop.

    Kind regards

    DP - K

  • I need help with the program of Photos on my macbook pro

    I use a Macbook Pro with OS of Yosemite. I really need help with the Photo program. I never really got the hang of IPhoto and now that it's a new program, I'm really confused. Where can I go to learn this without waiting for the next workshop in a local store?

    Hi, I'm fighting to open same mine, making a new software update

  • Adjust the data in the database with the variables

    Hello

    For my internship, I have an assignment to read and set a database with the variables. This SQL server 2005 database contains variables of a controller. These are read and write variables. The assignment is to display the read variables and the user can adjust the variables of Scripture. The first part was "easy" because the forum contained a lot of examples of this. The second part is more difficult because the forum contains absolutely no example of this. Can I use LabVIEW 2010 and 2011, and also I downloaded the 30 day trial of the database connection tool. If it's useful, I can recommend my company to buy this package. Playback vi makes use of a UDL (Microsoft data link) connection.

    So you guys my question is: is it possible to adjust the specific variables in a database using LabVIEW? And maybe you can give me a little advice on this topic...

    Thanks in advance!

    Roy

    In SQL, the specific data are always selected with the keyword WHERE. In VI to update there is a link for options, you can for example add a constant 'WHERE id = 1457 and measure > 0.54 ".

    You can ofc. also build this chain through controls, settings and other means.

    If you prefer, you can use the Execute Query (under Advanced tab I think) to which you can send the complete query example "TestTable Update set name ="Zeus"where id > 14 and id.<>

    /Y

  • Need help with the launching track pack for forza code 4

    Bought new Forza 4 and the lancer Track Pack code does not work, how do I get a code that is generated in the form I've already paid for it. Rank of loads of numbers and sent 10 s of emails but cant seem to get help.

    This is the help I get when the cat to an Ambassador xbox on xbox.com

    Terry wrote:
    Need help with the launching track pack for forza code 4
    The Xbox Ambassador says:
    Location of Ambassador of the community...
    The Xbox Ambassador says:
    Location of Ambassador of the community...
    The Xbox Ambassador says:
    Your question will be answered by an Ambassador of the Xbox. You have been connected to the Ambassador as a user Xbox [3]
    The Xbox Ambassador says:
    Hello
    Terry wrote:
    Hello
    The Xbox Ambassador says:
    Hey
    Terry wrote:
    just to be on the phone to xbox live support and was told to come here
    The Xbox Ambassador says:
    ok\
    The Xbox Ambassador says:
    What is your problem?
    Terry wrote:
    I bought the 4 for forza ansd 360 new sealed Christmas...
    Terry wrote:
    has got 2 codes that accompanies the game but the pack track code does not work
    The Xbox Ambassador says:
    Wow good
    Terry wrote:
    whenever I put in the code it says code redeemed
    The Xbox Ambassador says:
    I think the code is used. You must return to the retailer
    Terry wrote:
    I tried to, but since I already opened the case they will not accept
    The Xbox Ambassador says:
    Oh. No,
    Terry wrote:
    the code had been used or defective as I am the only person who has touched the game once opened, tried to enter the code when it is open
    The Xbox Ambassador says:
    Maybe it was auto bought?
    Terry wrote:
    so, how do I get another code generated track Pack if defective?
    The Xbox Ambassador says:
    I do not know.
    Terry wrote:
    bought the game new, so I get the track pack
    The Xbox Ambassador says:
    Oh. It's bad.
    The Xbox Ambassador says:
    I think that if you Exchange 1 code it will buy it
    Terry wrote:
    car pack code worked, starter pack did not work
    The Xbox Ambassador says:
    Oh.
    The Xbox Ambassador says:
    It's a bad
    The Xbox Ambassador says:
    BTW you have an evolution of the tests?
    Terry wrote:
    Yes, I want to? but more anxious to get a code object generated for this pack
    The Xbox Ambassador says:
    Hey if I help can u give me this game too?
    Terry wrote:
    ?????????????????
    Terry wrote:
    So is it possible to get a code for that time?
    The Xbox Ambassador says:
    Hey
    The Xbox Ambassador says:
    Yes.
    The Xbox Ambassador says:
    you need to contact them
    The Xbox Ambassador says:
    and tell them that the code is used.
    Terry wrote:
    I was told to come here? where can I go to get the code?

    Hi Terryg76,

    ·         What version of the operating system is installed on the computer?

    I suggest you to contact the game manufacturer for more help and information.

  • Need help with the blue screen issue "NAVEXI5. SYS, PAGE_FAULT_IN_NONPAGED_AREA ".

    Original title: need help with the blue screen issue
    My computer turns saying a blue screen: a problem has been detected and windows were shut down to prevent damage. The problem seems to be caused by the following file: NAVEXI5. SYS PAGE_FAULT_IN_NONPAGED_AREA he seems to have a different error whenever he turns to a blue screen. Can someone help me please.

    Hello

    1. Since when are you facing this problem?
    2. you remember to make changes to the system?
    3. do you get an error with this error code?

    I suggest to unplug external devices such as printer, scanner, etc. that are plugged into the system, and then restart the system and check if the problem persists.

    Method 1.
    I suggest you to do a check disk from the recovery console and check if the problem is resolved. Follow the steps mentioned below.
    a. start into the recovery console using the XP CD. Follow the steps mentioned in the article below.
    Description of the Windows XP Recovery Console for advanced users
    http://support.Microsoft.com/kb/314058
    b. perform a disk check.
    How to perform disk error checking in Windows XP
    http://support.Microsoft.com/kb/315265

    Method 2.
    I suggest you to start with the XP CD and then do a system restore. Follow the steps mentioned in the article below.
    How do I recover from a corrupted registry that prevents Windows XP startup
    http://support.Microsoft.com/kb/307545

    I hope this helps.

  • Help with the part number - paw index screen X230ti

    Can anyone help with the reference number and or the availability of the small 'legs' that sit in the slots on each side of the keyboard on a X230ti? They locate into the slots with the screen and prevent movement when the lid is closed.

    I have the same and among the small beasts broke and the screen tends to rotate when closed.

    Have searched for a parts list but cannot find the "paw" in any list that I found. Thank you

    Here is a picture of the X230t keyboard (and palmrest) framework. You can see the small 'legs' to belong to him.

    I hope someone from Lenovo will tell you how to order this part. EDIT: part number 04W6808.

  • Help with the purchase of a microSDHC

    I recently filled my Fuze, upgraded to the latest firmware and I'm ready to increase its capacity. I thought to buy a 8 GB Sandisk from amazon, but I'm not if I need a SD adapter so I can connect it to my computer. If I keep it plugged the "rocket" I will be able to access the card through the device, or it will appear as a separate storage device? Any help with the purchase of a microSDHC will be greatly appreciated.

    The 8 GB SanDisk microcard works perfectly, and you can plug just the "rocket" and most likely to leave it there. When you connect to your computer the microcard will appear as a separate... drive for example, on mine, the "rocket" is the J: drive and the card is drive K:

    Anything on the card will be perfectly integrated into the memory of the "rocket" when using it.

  • Please help with the problems of Vista SP2

    So I spent all day on the forums here and I'm head over heels.  I had problems with Windows update and some other problems on my Dell Studio XPS.  It is a tower with double HDs in RAID mirror running Vista 64-bit with SP2.

    I got it for 3 years and I thought that I clean and correct certain defects to go back to the original Dell factory condition.  That did not fix the update install problem I did cleaning.  Now it's worse.

    I'm trying to install SP2 and get a catastrophic failure 0x8000ffff error-UNEXPECTED

    The onlychange is that several months ago, one of my WD 640 GB drives factory failed and I replaced it with a Seagate Barracuda 1 TB since I couldn't find a 640 GB drive.

    I tried to stop and restart all services BITS, etc. no luck.

    I tried to run among the MS FixIt for the problem of update, but it fails because it says that it cannot initialize the powershell.

    Help, please... I'm hopelessly lost and can not spend more money on this thing.

    Thank you!

    If you need additional help with the clean install, please start your own, new topic in this forum: http://answers.microsoft.com/en-us/windows/forum/windows_vista-system

    If these procedures look too complex - and there is no shame in admitting this isn't your cup of tea - take the machine to a local, good reputation and independent (i.e., not a BigBoxStore or a Geek Squad) computer repair shop & ask them to do the job.

Maybe you are looking for