Calling a variable inside a movieClip.

Hi. I'm having problems in calling my variable score which I assigned inside a movieClip. What I want to happen is when my score reaches my desired value(e.g. 10), I want the congratulations screen to be visible. The congratulations screen is placed in the main timeline. Is there a way I can access the variable that I created inside a movieClip?
I tried using:
if (score == 10)
MovieClip(root).screen_1.visible = true;
// this code snippet is placed inside the movieClip where the variable score is declared. But it doesn't seem to work.
I also tried:
if (MovieClip(root).score == 1)
screen_1.visible = true;
//this code snippet is placed in the main timeline.  It also didn't work. I didn't get any errors in this codes but it doesn't give me the result that I wanted. Thank you.

i assume the congratulations screen is on the same timeline as the code you showed.
in that situation, you should be using MovieClip(root).score to reference score defined on the main timeline.  in addition, that code needs to execute everything score is updated so put that code in a function and call that function each time score is updated.

Similar Messages

  • How can I list all available  variables inside a movieClip

    I have a lot of movieclips in my file and each movieclip has
    its own set of variables.
    There is any way to trace all available variables inside any
    movieclip? I mean, how can i know what variables and their values
    are inside a movie clip!
    Tks,

    if your movieclip has instance name mm, you can use:

  • Calling a variable from inside a movieclip AS3 in Flash CS4

    I am trying to trace a variable string from inside a movieclip which is inside another movieclip on the main timeline using:
    trace(VariableString);
    and also
    trace(stage.VariableString);
    Neither work
    The variable is an input textfield and traces fine when it is on the main timeline but will not work from inside the movieclip. I am using Actionscript 3 in Flash CS4.
    I appreciate this has probably been discussed previously on this forum but I cannot find a difinitve answer that seems to work.
    Thanks

    Thanks for the reply. However this did not seem to work.
    I think I had better explain a little better.
    On Keyfrme1 I have a MovieClip1 containing a text input component. I have created a variable on keyframe 1 using:
    var VariableString1:String = new String();
    When clicking on a seperate button this happens:
    VariableString1 = MovieClip1.text;
    I can trace this correctly on the main timeline using:
    trace(VariableString1);
    However, if I try to trace this from  another keyframe inside a movieclip2 which is inside another movieclip3 using:
    trace(MovieClip1(root).VariableString1);
    I just get the error 1180 call to a possibly undefined method MovieClip1
    Sorry if this is not very clear but I am getting very confused with this.
    Thanks again

  • Please help on how to use variables inside a method call

    Hello guys,
    How's it goin?
    Pardon me if you find my question silly, but I am relatively
    new in ActionScript 2.0 programming.
    I have here a simple problem. It seems I can't use a variable
    inside a method call of an object. Here's the code. Please note of
    the authParams string variable below.
    import AkamaiConnection;
    import mx.services.WebService;
    var GeneratedToken:String;
    var authParams:String;
    // Create a Web Service object
    var TokGenService:WebService = new WebService("
    http://webservice.asmx?wsdl");
    // Call the web service method
    var myToken:Object = TokGenService.GenerateToken();
    // Create an AkamaiConnection object
    var connection:AkamaiConnection = new AkamaiConnection();
    connection.addEventListener("onConnect", this);
    connection.addEventListener("onError", this);
    // If you get a result from the web service, save the result
    in a variable
    myToken.onResult = function(result)
    // If you get a result from the web service, save the result
    in a variable
    myToken.onResult = function(result)
    GeneratedToken = result;
    authParams = GeneratedToken +
    "&aifp=v001&slist=37414/test/Streaming/";
    //Call the Connect method of the AkamaiConnection class
    connection.connect("cp37414.edgefcs.net/ondemand",true,true,5,true,false,"443","rtmpt",
    authParams);
    But then, if I use a hard-coded string value in lieu of the
    variable, the method call works!
    connection.connect("cp37414.edgefcs.net/ondemand",true,true,5,true,false,"443","rtmpt",
    "testStringvalue");
    I don't know what I'm missing or what I'm doing wrong... Can
    somebody help me please? I am using a 30-day trial version of Adobe
    Flash CS3. Also, when I Trace output the variables, the values are
    there. It just that they can't be read or recognize inside the
    method call. Is this a ActionScript limitation?
    Thanks so much in advance!

    The result param is a returned, “Decoded ActionScript
    object version of the XML”. I am not exactly sure what that
    means but I have had issues of returned XML values and their
    datatype. When I did have these issues I had to cast or convert
    into the desired datatype. Try one of the following, assuming the
    problem is related to the code that you have bolded.
    GeneratedToken = result.toString();
    authParams = GeneratedToken +
    "&aifp=v001&slist=37414/test/Streaming/";
    Or
    GeneratedToken = String(result);
    authParams = GeneratedToken +
    "&aifp=v001&slist=37414/test/Streaming/";
    Or
    GeneratedToken = result.toString();
    authParams = String(GeneratedToken +
    "&aifp=v001&slist=37414/test/Streaming/");

  • Call string/ action from other movieclip?

    on the mainTimeline if have a movieclip.
    inside this movieclip i have a script that loads text from database.
    what important note is:
    var myPageText: String
    now if i place inside this movieclip a other label further in the time, and create a action to call out myPageText like:  my_input_text.htmlText = myPageText;
    this works fine
    now i want this to work inside a other movielip in other scene.
    is it possible to call myPageText???

    if you save your fla as a temp fla (so you don't change the only you're working on), comment out or remove all the actionscript and remove all the components, if any, you should be able to change your publish settings to as2 and use:
    trace("from: "+this);
    on the timeline that you want to use to reference that variable and use the trace("to: "+this) statement on the timeline that contains that variable.  paste the resulting output and i can tell you the path you should use, assuming all your movieclips are created in the authoring environment.

  • How to Print the Value of a variable inside a PL/SQL package

    Hi Friends,
    Here is my Scenario
    I have a PL/SQL Package. Let us call it Baseline Package.
    This Package includes a dynamically built merge Statement.
    Execute Immediate v_merge_query.
    I have a procedure which replaces which few Keywords from the Package Text and Creates a new one depending on Inputs I provide. (This is something like a Code generator)
    Now while Creating the new package, I need to print the Value of v_merge_query.... I Need s Static Query to be Printed inside the new package and not a dynamic query.
    My Question is "Is there a way to print the value of the variable inside a different PL/SQL package?
    Thanks in Advance,
    Mohit

    Print where?
    That PL/SQL code is server-side code. It runs in an Oracle server process.
    That server process does not have a keyboard. Or a screen/monitor. Or display canvas. Or an attached printer.
    That server process is incapable of "printing" as that is not its job or responsibility and not part of its environment.
    What is can do is record data for the client to look at afterwards. This can be done using static PL/SQL session variables. Or a SQL table.
    The former is done by DBMS_OUTPUT - a very primitive interface for writing text into a static PL/SQL string array. That btw resides in expensive private process server memory. The client can query the array after a database call and render the contents.
    PS. Also keep in mind that bind variables are critical for performance and server robustness - especially when (ab)using dynamic SQL.

  • AS3 loading external swf files with buttons from inside a movieclip

    In my main .swf I have labels on the timeline, navs for those btns are on the first frame of the AS layer and each button sends the playhead to a different frame.
    On one frame called fr1 there is an mc called mc_1 that appears on stage when the playhead stops there. Inside mc_1 are a set of navigation buttons that need to call external .swfs.
    Do I add event listeners on the last frame of mc_1 for each button?
    how do I call the loaders for the swfs on the buttons since the swfs will load on the main timeline NOT the mc_1 timeline?
    So label on main timeline called fr1 will load external1 swf , on fr10 external 2.swf will load and so on.
    any help?

    The code for that button's event listener needs to be placed wherever it has direct access to the button.  Not necessarily on the same timeline, but in a place where both the button and the code are present at the same time.
    The code could be placed at the frame in the main timeline where the movieclip with the button(s) is, targeting the buttons via the movieclip (mc.button.addEvemtListener...) , unless the buttons are somewhere down the timeline of that movieclip.
    If they are down the timeline of that movieclip, then you would need to have the event listener also inside the movieclip, down its timeline where the buttons are finally settled in... being sure to assign instance names to the buttons at every keyframe.

  • Play a frame in timeline from inside 2 movieclips.

    Hi. I have tried everything but it just isn't working.
    On my main timeline I have a MC called "rainbow." Inside "rainbow" I have a MC called "greenbow."
    Inside "greenbow" I have a MC called "meetbtn2"
    I want it to play frame 134 on the main timeline when you click "meetbtn2."
    my code inside greenbow is as follows:
    meetbtn2.onRelease = function () {
    _root.gotoAndPlay(134);
    however it doesn't work! is it because i am inside two MC's?
    I have also tried
    _root.rainbow.greenbow.meetbtn2.onRelease = function () {
    _root.gotoAndPlay(134);
    any help? Thanks!

    i believe you miss understood me. the actionscript and the MC are on the same frame on the same timeline.
    however
    on the main timeline: the MC "rainbow" doesn't appear til frame103
    inside "rainbow": the MC "greenbow" doesn't appear til frame 48
    inside "greenbow": the movieclip that acts as the button"meetbtn2" doesn't appear til frame 11
    however all instances have been named correctly and all actionscript is on the same frame-space as its objects....

  • Bind variable inside a package

    Can we declare a bind variable inside a package specification?
    CREATE OR REPLACE PACKAGE GET_EMPLOYEEDETAILS
    IS
    PROCEDURE GET_FIRSTNAME(E_ID IN EMPLOYEES.EMPLOYEE_ID%TYPE, F_NAME OUT EMPLOYEES.FIRST_NAME%TYPE);
    VARIABLE O VARCHAR2(20);
    END GET_EMPLOYEEDETAILS ;
    CREATE OR REPLACE PACKAGE BODY GET_EMPLOYEEDETAILS
    IS
    PROCEDURE GET_FIRSTNAME(E_ID IN EMPLOYEES.EMPLOYEE_ID%TYPE, F_NAME OUT EMPLOYEES.FIRST_NAME%TYPE)
    IS
    BEGIN
    SELECT FIRST_NAME INTO F_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID = E_ID;
    DBMS_OUTPUT.PUT_LINE(F_NAME);
    END;
    END GET_EMPLOYEEDETAILS;
    Output:
    ERROR at line 4: PLS-00103: Encountered the symbol "VARCHAR2" when expecting one of the following:
      := . ( @ % ; not null range default character
    The symbol ":=" was substituted for "VARCHAR2" to continue.
    2. IS
    3. PROCEDURE GET_FIRSTNAME(E_ID IN EMPLOYEES.EMPLOYEE_ID%TYPE, F_NAME OUT EMPLOYEES.FIRST_NAME%TYPE);
    4. VARIABLE O VARCHAR2(20);
    5. END GET_EMPLOYEEDETAILS ;
    6. /
    or is there any alternative for bind variables inside an package
    Thanks in advance
    Message was edited by: 1009739

    The "VARIABLE O VARCHAR2(20);" syntax is the way SQLPlus declared bind variables - it is specific to the client. Because PL/SQL packages and procedures are server code that continue past sessions, its only access to the client environment is what the client gives it - it can't go and create a bind variable in the client.
    PL/SQL procedures, functions and packages run from lots of environments, so they cannot access bind variables inside their body - you have to pass any external variables as parameters.
    Anonymous PL/SQL blocks can access bind variables.
    You can declare package public global variables - just leave out that "VARIABLE". E.g.
    CREATE OR REPLACE PACKAGE GET_EMPLOYEEDETAILS
    IS
    PROCEDURE GET_FIRSTNAME(E_ID IN EMP.EMPNO%TYPE, F_NAME OUT EMP.ENAME%TYPE);
    O VARCHAR2(20);
    END GET_EMPLOYEEDETAILS ;
    For local variables in your procedure, just put them between the IS and BEGIN. Using them in SQL inside the PL/SQL automatically uses them as a bind variable.
    create or replace PROCEDURE GET_FIRSTNAME(E_ID IN EMP.EMPNO%TYPE, F_NAME OUT EMP.ENAME%TYPE)
    IS
      O VARCHAR2(20);
      O2 VARCHAR2(21);
    BEGIN
      O := 'FR%';
    SELECT ENAME INTO F_NAME FROM EMP WHERE EMPNO = E_ID and ENAME like O;
    O2 := F_NAME || '2';
    DBMS_OUTPUT.PUT_LINE(F_NAME);
    END;
    O is bound in the query.
    To access bind variables from anonymous PL/SQL, first declare them in the calling environment. In SQL Plus that's
    VARIABLE O VARCHAR2(20);
    In Pro*C it's
    EXEC SQL BEGIN DECLARE SECTION;
      char[21] O
    EXEC SQL END DECLARE SECTION;
    Then reference it in anonymous PL/SQL with a colon as prefix:
    BEGIN
    SELECT FIRST_NAME INTO :O FROM EMPLOYEES WHERE EMPLOYEE_ID = E_ID;
    END;
    This only works for anonymous blocks (starting with BEGIN or DECLARE). As I said, PL/SQL procedures, functions and packages cannot see bind variables from the calling environment

  • Can i use a environment variable inside a *.sql file?

    Hello,
    I want to create a external table.
    So i am using the command
    create or replace directory abc as 'C:\folder'.... inside a sql file.
    Now i want the path "C:\folder" to be dynamic as i am using this path in many other places also inside the sql file.So i thought to create a environment variable and put this value there.I tried using as %PATH% but it gives error..... where %PATH%=C:\folder.
    Can i use a environment variable inside a *.sql file?
    But how to do that or is there any other way.
    Thanks
    Swapna
    Edited by: user11018268 on Feb 19, 2010 1:03 AM

    user11018268 wrote:
    Actually what i want is the path "C:\folder" is not fixed it can be anything which i may not know the user may decide it later. Not supported. A directory object refers to a specific physical location (directory/folder) on a file system. Not a path.
    You can work around it by (creating and) using a function (running under a super user schema with authid definer privs). The caller (e.g. schema scott ) calls it with a physical path. E.g. GetDirectoryObject( 'C:\folder\2010\feb\week4' ).
    This function determines if there is an existing directory object for the path. If not, it uses a wildcard search to determine if there are any directory objects for parents in the path (e.g. for C:\folder\2010\feb or C:\folder\2010 or C:\folder ).
    If it finds a directory object, it interrogates the data dictionary to determine if the caller, schema scott for example, has read/write access on that directory object. If it has, it creates a new directory object and grants the caller read/write access to it. The function then returns the name of the directory object to the caller.
    The caller thus do not deal directly with directory objects. The function returns the object name given a physical path as input. Also, only a single base directory needs to be created (e.g. for C:\folder ) and access granted to the schema on it. Any sub-directory in that base directory can now be dynamically accessed by the schema.

  • Calling one variable to other variable ( alphanumeric)

    Hi All,
    I have scenario where I am calling one variable to other variable in ODI.
    For example.
    Lets say I have two variable V_SET1 & V_SET2
    V_SET1 :
    Variable type : alphanumeric , Historize,
    Refreshing : SELECT #V_SET1 FROM DUAL to historize value.
    Now I am using V_SET1 in V_SET2
    V_SET2:
    Variable type : alphanumeric , Historize,
    Refreshing :
    select SOURCE_NAME from EXTRACT_PGSQL_DETAIL where OE_DETAILS = # V_SET1
    Both variables are inside scenario I am passing value of V_SET1 at run time as parameter 'TEST'
    V_SET1 is executed sucessfully & TEST is stored is historized
    BUT in V_SET2 V_SET1 value is getting passed in " quotes & i am geeting error of INVALID IDENTIFIER "TEST"
    select SOURCE_NAME from EXTRACT_PGSQL_DETAIL where OE_DETAILS = # V_SET1 ( "TEST") -- error inavlid identifier.
    How can I covert the value of TEST from "TEST" to 'TEST' in second Variable V_SET
    Edited by: neeraj_singh on Jun 24, 2011 3:15 AM

    Hi,
    Try this if not,
    select SOURCE_NAME from EXTRACT_PGSQL_DETAIL where OE_DETAILS = '#V_SET1'
    Thanks,
    Guru

  • Variables inside movie clips?? in Flash CS4 (AS3)

    Hi everyone,
    I was wondering if it is possible to have variables such as Int 's stored inside or together with a movie clip??
    Thank you!

    Yes, you can store them inside manually when you create the movieclip or you can assign a variable to a movieclip during run time without having created the variable previously.
    myMovieclip.newVariable = some value;

  • Calling a variable that's in a different method

    I have one class file with 1 main method and 2 other methods (lets call them A and B).
    I have two variables inside method A, called max and min.
    I need to use these variables, max and min, in method B, but the compiler says it can't resolve the symbol for the two variables. Right now both my A and B methods are "public static void A(String[] args)". Is there an easy explanation as to how I can get method B to recognize the variables from method A? Thanks - Cpx

    I tried the private int max, min; but the compiler
    says a "non-static variable min cannot be referenced
    from a static context."Because main() is static and you cannot use non-static variables or call non-static methods from a static method (do you know what "static" means?).
    So how do you pass the variables between methods as
    arguments?Make the variables static.
    Jesper

  • Access Session variable inside Transaction

    Hi All,
    Is it possible to access session variables inside Transaction.
    Create session variable.
    Update session variable value
    acccess Session variable.
    (user session)
    Regards,
    Sachin

    Hi Sachin,
    Here is the snapshot:
    1. Take session variable in a local JS variable in HTML page.
    2. Create a transaction with a input type variable in Transaction Properties.
    3. Create a Xacute query and link the above transaction.
    4. Creata a iCommand applet on HTML page and link the query template:
    <PARAM NAME="QueryTemplate" VALUE=".../QueryName">
    Call the function in the below way in HTML:
    Applet.getQueryObject().setParam(1,vaiable)
    So, the session variable will go to TRX (BLT) and perform the operations as per your need..
    You can pass it to other TRX by the same way.
    To fetch the value: Create output type variable in TRX 2. Create Xacute query.
    Get the value with : Applet.getValue(1,1)
    Hope it is useful.
    Best Regards,
    Kedar

  • Loading a game inside a movieclip (AS2)

    Hello.
    I have a problem loading a game inside a movieclip (i´m using AS2)
    I have a main timeline with 6 buttons, and each button calls for an external SWF, wich loads inside an empty movie clip.
    Everything works ok, but when the game loads inside the movieclip, it won´t respond.
    The game SWF loads ok inside the movieclip, but it doesn´t respond to commands.
    If i execute the game.swf, it plays ok....but when loaded into the movieclip, it shows but you can´t play because the commands or buttons won´t respond.
    Is there a way to load this kind of swf inside a movieclip and make it work?.
    What i´m doing is:
    The button has this action:
    on (press) {
    loadMovie("game6.swf", "cargador");
    "Cargador" is the name i gave to the empy movieclip.
    I´ll appreciate any help i can get. Thanx a lot for your time.

    Hi Ned. Thanx for your reply.
    All the files are in the same folder, and all games are just 1 swf file (no php, xml, external .as or subfolders).
    About the other recomendation of using _lockroot... where should i place it? i have 3 frames (1, 2 and 3) with a stop action, and in another layer on frame 2, all the actionscript.
    If i place the code on the frame with all the actionscript, this should be at the beginning of the code, or can i place it at any line? Or is it easier to place it in one of the other frames where i placed the stop action?
    Thanx again for your reply.

Maybe you are looking for

  • Can I get rid of the TOC button on the playbar?

    My project is set up to have a TOC and for most of my project I use a TOC button with widget to open the TOC. I am also using the Playback control Pearl for a portion of my project. When in this section where the playback control is active if I choos

  • Auto Update of 64 Bit Flash 11 on Vista Turns Zombie

    Early this morning there was an update of Flash 11 on my Vista Home Premium system.  In this case, it was Flash 11, 64-Bit Plugin.  Everything went fine and it completed successfully.  However, Flash has disappeared from my system - kind of.  It's th

  • Not to copy  Price from PR to PO for text based purchases

    Hello Experts, We have a scenario, in which the PO will be created using a load file (LSMW - BAPI) with reference to a Purchase Requisition. All are text based purchases and no material master exists. I want the price from the load file to be taken a

  • Pivot table: Building Calculations

    Hi, i've following problem. Actually I have a pivot table with 4 columns (say A,B,C,D). Example Region| A | B | C | D Berlin |7 | 4 | 1 | 4 Bonn |3 | 2 | 1 | 3 Total |10| 6 |2 |7 Each column item has as rule of aggregation SUM. Now my customer wants

  • Toshiba Data Projector TDP-TW100 Wireless Utility

    Hi All, Is there anyone here who could provide me a link to download the Toshiba Data Projector (model: TDP-TW100) Wireless Utility software? We lost the CD that came with the projector and I've been looking for the software from the internet with no