Add variable to script

I have a script that will be animating 5 different movieclips
those will have the names:
klok1, klok2, klok3, klok4, klok5
and i have a function called "roteren" which will animate klok1
to animate the others, i will have to copy paste that long script 5 times, once for each movieclip
isnt there a way to somehow add a variable to the script?
like this:
mc_klok("kloknr").rotation = mc_klok("kloknr").rotation + snelheid;
where ("kloknr") would be the variable inserted after the name, so it could say: mc_klok1.rotation or mc_klok2.rotation or mc_klok3.rotation etc.
how can this be done?

yeah, but when i change that this[blabla] to mc_klok1 again, it all works just fine...
this is driving me crazy :/
let me just post the whole script:
stage.addEventListener(Event.ENTER_FRAME, roteren);
mc_klok1.addEventListener(MouseEvent.CLICK, klok1klik);
mc_klok2.addEventListener(MouseEvent.CLICK, klok2klik);
mc_klok3.addEventListener(MouseEvent.CLICK, klok3klik);
var geklikt;
var kloknr;
var snelheid = 10;
var draai = 0;
var klok1_klaar = 1;
var geluid1:geluid_klok1= new geluid_klok1(); //geluid van klok1
var geluid2:geluid_klok2= new geluid_klok2();
var geluid3:geluid_klok3= new geluid_klok3();
//Klikken op klok -> roteren toestaan, en zorgen dat die kan draaien
function klok1klik (evt:MouseEvent) {
    kloknr = 1; draai = 0;
    if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
        geluid1.play();    }
    geklikt = 1; roteren(null);
function klok2klik (evt:MouseEvent) {
    kloknr = 2; draai = 0;
    if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
        geluid2.play(); }
    geklikt = 1; roteren(null);
function klok3klik (evt:MouseEvent) {
    kloknr = 3; draai = 0;
    if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
        geluid3.play(); }
    geklikt = 1; roteren(null);
function klok4klik (evt:MouseEvent) {
    kloknr = 4; draai = 0;
    if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
        geluid2.play(); }
    geklikt = 1; roteren(null);
function klok5klik (evt:MouseEvent) {
    kloknr = 5; draai = 0;
    if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
        geluid3.play(); }
    geklikt = 1; roteren(null);
//Checken of er geklikt is, en dan laten draaien
function roteren (evt:Event) {
    trace(kloknr,this["mc_klok"+1],this["mc_klok"+kloknr],mc_klok1);
    if (geklikt == 1) {
    if (draai < 2) { //Alleen  als er niet al op en neer is gegaan
//    mc_klok1.rotation = mc_klok1.rotation + snelheid;
    this["mc_klok"+kloknr].rotation = ["mc_klok"+kloknr].rotation + snelheid;
    if (mc_klok1.rotation > 45) {
        snelheid *= -1;
    if (mc_klok1.rotation <-45) {
        snelheid *= -1;
    if (mc_klok1.rotation == 0) {
        draai = draai+1;
    if (draai == 2) { //Na op en neer gaan zorgen dat het opnieuw kan
        geklikt = 0;

Similar Messages

  • Office 2013 VL and app-v 5 SP2 on RDS server - package add fails with script error

    We have used the MS Office Depolyment Tool for click-to-run to download the latest Office 365 version, and flatten it into an app-v 5 package - not a problem.
    When we try to add the package to our client machine (Server 2008R2 running the app-v 5 SP2 client software), it fails with an message that a script has failed and not returned a 0 code.  We have not added any scripting to this automatically created
    package, so it seems that the app-v client does not like the "official" package.  Any hints and tips gratefully accepted, thanks
    App-v client has scripting enabled.
    The powershell command line we are using is:
    PS C:\windows\system32> Set-ExecutionPolicy Unrestricted
    PS C:\windows\system32> Add-AppvClientPackage -path file://hostname/app-v/o365-noaccess/ProPlusVolume_en-us_zh-cn_x86.appv -DynamicDeploymentConfiguration \
    \hostname\app-v\O365-NoAccess\ProPlusVolume_en-us_zh-cn_x86_DeploymentConfig.xml
    with a result of:
    Add-AppvClientPackage : Embedded Script process exited with an error code indicating failure (return code other than 0). Please ensure that Embedded
    Script process can complete successfully and exits with 0.
    Operation attempted: Configure AppV Package.
    AppV Error Code: 100000000C.
    Please consult AppV Client Event Log for more details.
    At line:1 char:1
    + Add-AppvClientPackage -path
    file://hostname/app-v/o365-noaccess/ProPlusVolum ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
        + CategoryInfo          : InvalidResult: (:) [Add-AppvClientPackage], ClientException
        + FullyQualifiedErrorId : ConfigurePackageError,Microsoft.AppV.AppvClientPowerShell.AddAppvPackage
    and these are the error messages we see in the debug app-v client logs:
    Script Launcher successfully waited for script with command line: '"C:\ProgramData\App-V\D24C3BDD-8FAD-44D3-998C-933F8F053682\CD9725CE-4503-4932-863B-4FCDA3F9551D\Root\..\Scripts\Integrator.exe" /I /Msi /License /AppV PackageGUID=D24C3BDD-8FAD-44d3-998C-933F8F053682
    PackageRoot="C:\ProgramData\App-V\D24C3BDD-8FAD-44D3-998C-933F8F053682\CD9725CE-4503-4932-863B-4FCDA3F9551D\Root" MsiName=SPPRedist.msi,SPPRedist64.msi PidKey=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx,xxxxx-xxxxx-xxxxx-xxxxx-xxxxx,xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
    PRIDName=ProPlusVolume'.
    and...
    Package {d24c3bdd-8fad-44d3-998c-933f8f053682} version {cd9725ce-4503-4932-863b-4fcda3f9551d} failed configuration in folder 'C:\ProgramData\App-V\D24C3BDD-8FAD-44D3-998C-933F8F053682\CD9725CE-4503-4932-863B-4FCDA3F9551D' with error 0x79100E10-0xC.
    and...
    machine script for event AddPackage with command line: '"C:\ProgramData\App-V\D24C3BDD-8FAD-44D3-998C-933F8F053682\CD9725CE-4503-4932-863B-4FCDA3F9551D\Root\..\Scripts\Integrator.exe"'
    exited with failure error code: The extended attributes are inconsistent.. Because Rollback is set to true in the script definition, the current AppV Client operation was rolled back.
    We believe this last error message is the kicker, but can't debug any further.

    Just to validate the problem, I started again.
    I have just downloaded the latest ODT from MS, and then downloaded the latest Office 2013 packaged - volume license.  Then created the app-v package - all went perfectly, no error messages.  Uploaded the package to the app-v 5 server and published
    it.  I have made NO changes to any of the files.
    I have just built a brand new Windows Server 2008R2 Datacentre VM, patched it to the hilt, and installed the RDS role, powershell 3 and appv 5.0 SP2 client for RDS.
    I then use powershell as above:
              scripting unrestricted
              app v client scripting enabled
             app v server added
              global and user update enabled
             add-appvclient package  "url of office package.appv"
                 and received exactly the same error message.  
    It is not complaining that scripting is not allowed, it is complaining that the script is invalid.
    Help!!!!

  • How to add Variable in variant attributes in query

    Dear all,
    User required to add one variable (e.g. Last Week date) in variant attribute.
    For example: If we select D: Dynamic date calculation then in that case i want to add one variant attribut (Last Week).
    How i can maintained this.
    Thanks in advance.
    PM

    Dear All,
    I want to Add Variable name to Dynamic Date Calculation List as Last Week.
    How i can create variable for Last week.
    Thanks in advance.
    PM

  • Doubt in printing variables in script

    Hi Experts,
    I am having small doubt.
    1).I need to write one condition for sales org 'US11' and divisions '20' or '40'. So the below logic is correct or not.
    if vbdkr-vkorg = 'US11' and and vbdkr-vtweg = '20' or vbdkr-vtweg = '40'.
    select........
    endif.
    2). i need th print these variables in script. can i use the logic like this.
    if &vbdkr-vkorg& = 'US11' and and &vbdkr-vtweg& = '20' or &vbdkr-vtweg& = '40'.
    &zkbetr1/ zpery1&
    else.
    &zkbetr/ zpery& (This is for sales org other than US11)
    endif.
    Thanks & Regards,
    Ramana.

    Hi,
    I think your condition would be more apt if you code this way:
    IF vbdkr-vkorg EQ 'US11' AND ( vbdkr-vtweg EQ '20' OR vbdkr-vtweg EQ '40' ).
    ENDIF.
    Also, look at putting the code into a subroutine called from your driver or subroutine program and then returning the value. The "logic" for determining the value to be printed can then be performed within the subroutine rather than the SAP script.
    Cheers,
    Aditya

  • How to Add an SQL script to another existing SQL script

    I have just created an SQL script and i need a way to join it with several other existing SQL scripts.
    I don't want to change any of the other scipts, i just need to add my new script on to the existing ones.
    I've looked at some of the functions and they don't seem to work for me.
    Let me use this as an example.
    Here is my new script:
    SELECT DISTINCT max(case when EC.EQUIPMENT_CLASS like '%_ERT' then 'Y' else 'N' end) over (partition by E.CURRENT_SERVICE_ID) as ERT
    FROM EQUIPMENT E,
    EQUIPMENT_TYPE ET,
    EQUIPMENT_CLASS EC
    WHERE E.EQUIPMENT_TYPE_ID = ET.EQUIPMENT_TYPE_ID
    and EC.EQUIPMENT_CLASS = ET.EQUIPMENT_CLASS
    and E.CURRENT_SERVICE_ID = 38514
    I need to add this to an existing script such as this:
    SELECT E.EQUIPMENT_NUMBER,
    E.EQUIPMENT_TYPE_ID,
    ET.EQUIPMENT_TYPE_DESC
    FROM EQUIPMENT E,
    EQUIPMENT_CATEGORY ECAT,
    EQUIPMENT_TYPE ET,
    EQUIPMENT_CLASS EC
    WHERE ET.EQUIPMENT_TYPE_ID = E.EQUIPMENT_TYPE_ID
    and EC.EQUIPMENT_CLASS = ET.EQUIPMENT_CLASS
    and EC.EQUIPMENT_CATEGORY = ECAT.EQUIPMENT_CATEGORY
    and E.EQUIPMENT_ID = 113950
    * The Reason why i can't just add the line i need together with the existing script, is because it's giving me invalid data from what i want to see. When i run them separately i get the desired results.
    Not sure if anything can be done like this or not, but if so, i'd appreciate a shove in the right direction.
    thanks

    I have just created an SQL script and i need a way to
    join it with several other existing SQL scripts.
    Do you simply want to append your newly created query to the file that contains an existing query ?
    >
    I've looked at some of the functions and they don't
    seem to work for me.
    Not sure how this is a SQL or PL/SQL related question, you'd probably want to just append the files using a text editor or maybe an OS command like cat or type.
    >
    * The Reason why i can't just add the line i need
    together with the existing script, is because it's
    giving me invalid data from what i want to see. When
    i run them separately i get the desired results.
    You may want to explain how the data is different from what you are expecting. In any case, your queries do not end with the sql terminator - the ";" character or a forward slash "/" at the first column of a line after the query; maybe that's the culprit.
    Consider this:
    SQL>
    SQL> host type c:\t1.sql
    select first_name from employees where rownum = 1
    SQL>
    SQL> @c:\t1.sql
      2  /
    FIRST_NAME
    Ellen
    SQL>
    SQL> host type c:\t2.sql
    select last_name from employees where rownum = 1
    SQL> @c:\t2.sql
      2  /
    LAST_NAME
    Abel
    SQL>
    SQL> host type t3.sql
    select first_name from employees where rownum = 1
    select last_name from employees where rownum = 1
    SQL> -- now, t3.sql contains both the queries of t1.sql and t2.sql
    SQL> -- however, they do not end with the sql terminators
    SQL>
    SQL> @c:\t3.sql
      2  /
    LAST_NAME
    Abel
    SQL> -- the first query was not executed...
    SQL>
    SQL> -- t3.sql has been fixed now
    SQL> host type t3.sql
    select first_name from employees where rownum = 1;
    select last_name from employees where rownum = 1;
    SQL> @c:\t3.sql
    FIRST_NAME
    Ellen
    LAST_NAME
    Abel
    SQL>pratz

  • How to access system variables in Script Component in data flow task in SSIS

    Hi,
    I am new to SSIS. Can someone tell me how to access system variable in Script Component in SSIS using C# code.
    Thanks

    You can use the System.Environment.GetEnvironmentVariable(...) to read the variables. An example is here:
    http://msdn.microsoft.com/en-us/library/y6k3c7b0.aspx
    Vikash Kumar Singh || www.singhvikash.in

  • I chose an add-on, "No Script", and I cannot remove it.

    I chose an add-on, "No Script", and I cannot remove it.

    So if you do
    Tools > Addons > Extensions
    and select NoScript (click it) and hit Remove or Uninstall (I forget which) what happens?
    It should disappear after the restart

  • Add an inertia script to mask/shape-path keyframes?

    anyone knows how to add an inertia script to mask/shape-path keyframes? OR a workaround that would yield similar results?
    thanks
    manojit

    Since no answer seems to be forthcoming would you recommend that this be a manual test?
    Thanks,
    Eric

  • How to add variables to  navigational block?

    Hi,
    How to add variables to navigtional block.
    I have placed navigational block but I am not finding option to add variables to navigational block.Can any one help me out.

    In earlier version when I selecte the navigtaional block and add some characterstic to that navigational block then those characterstic are avaialble for the navigation purpose.But in this version I could add navigation pane .But I am not finding any option to add the characterstics.
    But when I execute the WAD I am getting fallowing error.
    In the Web Application Designer, create a data provider with the name %NM% in template ZMARKTING_PERFOM_GROUP, or change the reference to the data provider in Web item NAVIGATION_PANE_ITEM_1
    Please help me.

  • Add variable to Exchange script

    Hi,
    I'm doing a bulk import of mailboxes using this command:
    $import = Get-Mailbox; $Import|%{$_|New-MailboxImportRequest -FilePath "\\location\$($_.alias).pst"}
    My problem is that this command will create number of requests, each with the same name "importrequest"
    What I'd like to learn is how to add the alias as the name of the request, so each request will be named ofter the mailbox alias.
    One request is simple, I know:
    new-mailboximportrequest -name john -mailbox john -filepath \\localhost\john.pst
    But, how do I create bulk requests with names?
    Thanks.

    You might want to check out Example 3 in the New-MailboxImportRequest cmdlet guide.
    http://technet.microsoft.com/en-gb/library/ff607310%28v=exchg.150%29.aspx

  • Assigning value to a variable in Script Component.

    I'm pretty new to SSIS development and need to figure out a problem with assigning a value to a user defined variable. I created a pretty simple package. It reads a flat file, extracts date from a header record and subsequently uses derived column component
    to reformat data to the desired output format. One of the columns (FileRunDate,
    string, length 8) in the derived component is defined as a string and in the expression I'm assigning it to a variable I set earlier in the script component -
    @[User::vRunTimeDate]. When the process runs, the output file gets generated, however FileRunDate reflects
    originally set varible's value. It seems that the variable assignment in the script task does not work, even though in the debug mode, I do see how the value is being set. The variable has an attribute of ReadWrite. Is it due to the fact that the value is
    being set in the same workflow?
    Any feedback is greatly appriciated.

    Unfortunately I'm unable to add a screenshot of the process, for some reason I get an error message when I try to do that. In a nutshell the entire workflow consist of flat file source component, following by a script component (this is where I read and
    assign the variable) 
        public override void PostExecute()
            IDTSVariables100 vars;
            base.PostExecute();
            // Set run date
            if (strRunDate != null)
                VariableDispenser variableDispenser = (VariableDispenser)this.VariableDispenser;
                variableDispenser.LockForWrite("User::vRunTimeDate");
                variableDispenser.GetVariables(out vars);
                // Set the variable
                vars["User::vRunTimeDate"].Value = strRunDate;
                //Unlock the variable 
                vars.Unlock();
                //Variables.vRunTimeDate = strRunDate;
    then goes conditional split ( filtering out unwanted records), which is connected to a derived column component (this is where one of the columns get assigned a variable's value), one more script component (this where I identify
    specific data element and do a replace command) and finally flat file destination.
    BTW, the article in the provided URL clearly states that variable won't reflect assigned value till the entire workflow has finished. If that's the case, then I think I know my
    answer. Is there is such a thing as putting execution of different steps in a different step, so anything executed subsequently will see that value?

  • How do I add variables to different checkboxes without using the 'Export Value' and then add them together (if checked)?

    Hello,
    I am very new to JavaScript.  I would like to create a checkbox with a numerical value variable activated if the box is checked.  Unfortunately, I cannot use the 'Export Value' because I already need to use it for something else.
    Any help is really appreciated.
    Thanks,
    Robyn

    Brace yourself, here's your solution.
    First of all, the export value of you checkboxes should definitly be the number of hours for the class since you will just add them up further.
    Second, we will use the userName property for our second export value (its the field right under Name and its labeled "tooltip").  You will name the class there.
    Finally, you need to name each checkbox with a number at the end starting with 1 all the way to 190.  This will be used in loops. ("whatever.1", "whatever.2,....."whatever.190")
    In the calculate event of "total hours":
    var sum = 0;  //declaring a variable that will be used in the loop
    for (var i = 1; i <= 190; i++){    //this loop will scan through all your checkboxes
         if (this.getField("whatever."+i).isBoxChecked(0) == true){  //if box is checked....
              sum += Number(this.getField("whatever."+i).value);   //.....add its value to the sum
    event.value = sum;  //display the total
    Now for the course name field, we will use the same pattern in the calculate event
    var courseList = new Array();  //declaring an empty array that will contain the courses
    for (var i = 1; i <= 190; i++){    //this loop will scan through all your checkboxes
         if (this.getField("whatever."+i).isBoxChecked(0) == true){  //if box is checked....
              courseList.push(this.getField("whatever."+i).userName);   //.....add its userName (tooltip) to the array
    event.value = "You are attending these courses:  "+courseList.join(", ")+".";  //display the array by turning it into a string and joining its items with ", "
    You can try it out with just a few checkboxes at first.  Don't forget that the loop mustn't go further than the existing field or you will get an error and the script will stop.  Make sure no error show in the console (ctrl+J).

  • Update and Write Back DataTable in Object Variable Using Script Component

    Hi All..
    I'm trying to update an Object Type Variable [ReadWrite] with a Data Flow Task Script Component. Variable is already holding a record set with Column(s) like, ID, Name, IsProcessed.
    Now in my Data Flow Script Component, I'm trying to 1st) Fill a DataTable with my variables value then 2nd) Loop through each Input Rows in Data Flow Component and accordingly if there is a match of ID then updating IsProcessed Column in DataTable. 3rd &Finally,
    Copy datatable back to Object Type Variable.
    Below is the code used and just for your ref. I tried Printing content of whole DataTable after Update. This looks perfect but not sure why my variable is able to capture it.
    using System;
    using System.Data;
    using System.Data.OleDb;
    using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
    using Microsoft.SqlServer.Dts.Runtime.Wrapper;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Text;
    [Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
    public class ScriptMain : UserComponent
    DataTable dt = new DataTable();
    OleDbDataAdapter adapter = new OleDbDataAdapter();
    List<string> listriuid = new List<string>();
    public override void PreExecute()
    base.PreExecute();
    public override void PostExecute()
    base.PostExecute();
    adapter.Fill(dt, this.Variables.varobjChildPackageLog);
    dt.AcceptChanges();
    foreach (DataRow row in dt.Rows)
    if (listriuid.Contains(row["ID"].ToString()))
    row["IsProcessed"] = "Y";
    // Just to see the Final Data Table Output
    //StringBuilder b = new StringBuilder();
    //foreach (System.Data.DataRow r in dt.Rows)
    // foreach (DataColumn c in dt.Columns)
    // b.Append(c.ColumnName.ToString() + ":" + r[c.ColumnName].ToString());
    //MessageBox.Show(b.ToString());
    this.Variables.varobjChildPackageLog = dt;
    dt.Dispose();
    adapter.Dispose();
    public override void RIUIDInput_ProcessInputRow(RIUIDInputBuffer Row)
    try
    listriuid.Add(Row.ID.ToString());
    catch (Exception ex)
    MessageBox.Show(ex.Message.ToString());
    Regards, Avik M.

    why do you need to do this in script task.
    This is just a matter of using lookup task while you retrive data from source itself to find the matches and use a derived column transform to check and set appropriate value for IsProcessed column. The object variable itself is not required and you dont
    even require a looping statement either!
    If both source and lookup tables are in same server then you can just wrap them inside source sql query itself to do matching and retrieve the value for IsProcessed within select statement itself in OLEDB Source inside data flow.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Error while trying to add a SQL Script via DB02

    Good Morning and happy Sysadmin day to everyone,
    I have the following Problem regarding DB2 9.5
    I'm trying to run a SQL Script via DB02 in an ERP 6.0 System.
    I'm using DB02 -> Jobs -> SQL Script Maintenenace -> Add
    Then there is a Textfield "Script Name". When i'm using the F4-Help I'm getting the following error Message:
    List box value range for field DYN_SED-SCRIPT_NAME could not be created
    Message no. DB6PM004
    Any suggestions what might be the Error?
    Thanks in Advance
    Marco

    Are you trying to create a new Model or trying to import a Model ?

  • Add Variable in an existing planning layout

    Dear guys,
    I have a problem with planning in KEPM.
    in the planningslayout there was defined one variable for record type.
    We want to plan the figures for three record types. In the planning level I added those three record types but I am not able to add more record types in the planning layout.
    Can you let me know how can I add more variable for this chracteristic in the planning layout.?
    kind regards
    udo

    It would also help me to know if it is possible to give an interval for the record type. If we try this, we only get the planfigures of the first record type in the interval.

Maybe you are looking for

  • How many times can I install my CD LR4 ?

    Hi I have LR4 in CD but the past few months, I have the Creative Cloud. I installed the LR5 from my CC, but I want to uninstall the LR4. Could I possibly reinstall? Thank you

  • Can't get sound back into Compaq Presario 2199US

    Read other people having issue with this for this model. Couldn't find an answer. HP claims driver sp23455 is my version(while chatting with them) but it fails to install. I reinstalled XP with no luck. Updated the bios. Its drove me crazy at this po

  • Efficient data structure to implement simple text editor?

    I was given this problem in an interview: What data structure would you use to implement a simple text editor that does these 4 functions: a) goto(line number) b) insert(char input,location) c) delete(location) d) printAll() //print entire file Given

  • Correlation in union, is good or we should put it out side.

    hi , 1) Select t.* from  t  where not exist ( select t1.id from t1 where t1.id=t.id                             union                            select t2.id from t2 where t2.id=t.id ) 2) select t.* from  t  where t.id not in ( select t1.id from t1 

  • BANK PARNTER TYPE

    Respected Professionals, I am not able to pay the invoices using particular Partner Bank Type I am getting an error like "Please choose a valid Bank Partner Type" I checked in FK03 also and bank partner type is duly assigned So could you please guide