Use variable in next scene

Hi,
I'm trying to use a variable captured in one scene, in the next scene of the game I'm making.
Here is the code I use to set the variable
var player;
player = inputbox.text;
On the next scene, I used trace(player) to test the output. Instead of outputting the name entered in the previous frame, it instead output "undefined"
I'm using a custom .as file which is shown below
package  {
import flash.display.MovieClip;
import flash.events.MouseEvent
public class PlayerName extends MovieClip {
public static var player
public function PlayerName() {
I don't really know ActionScript, and have been using things I have found on the internet. Any help would be appreciated.

By a stoke of luck I managed to get this working, without having to remove the scenes.
Instead of
var player;
player = inputbox.text;
and trace(player)
I had to use
var player;
PlayerName.player = inputbox.text;
and trace(PlayerName.player)
as I had set it as a local variable.

Similar Messages

  • Using Cue Points to advance to next scene

    I'm pretty new to AS3. I'm a designer trying to do it myself.
    What I'm trying to do is use a cue point at the end of my FLV (which is loaded using ui loader in my flvSWF) to go to the next scene in my mainSWF file.
    here's the code I'm using in my flvSWF:
    import fl.video.VideoEvent;
    import fl.video.MetadataEvent;
    IntroMovie.addEventListener(MetadataEvent.CUE_POINT, cp_listener); 
    function cp_listener(eventObject:MetadataEvent):void { 
    trace("Elapsed time in seconds: " + IntroMovie.playheadTime); 
    trace("Cue point name is: " + eventObject.info.name); 
    trace("Cue point type is: " + eventObject.info.type); 
    if (eventObject.info.name == "CueNextScene") {
    this.gotoAndPlay("desk");
    But of course it does not work. 
    A.  my traces don't show up. 
    B. Am I suppose to use this code in my mainSWF instead of the flvSWF
    C. An FYI  the IntroMovie is one of 4 random movies that gets played for the intro in mainSWF. The random script works fine.

    You can build out a menu by reading the cuePoints array in
    the NetStream.onMetadata handler, or by using the MetadataEvent
    with the FLVPlayback component (AS3). The simple thing for me to
    say is to refer to Chapter 9 of my new Flash Video book. :) (see
    link in my signature below.)

  • Using Variable Replacement Path with Hierarchies

    Hi,
    I have a requirement where I have two product hierarchies.
    In my report I want the user to be able to select which hierarchy they view at run time.
    I want them to be able to see this hierarchy as a tree,in order for me to do this I first must inlcude one variable to specify which hierarchy i am going to use, then the next Variable2 is populated by Variable1 and allows the users to expand on that hierarchy tree.
    E.g
    At Run Time
    Selection 1: User selects Product Hierarchy1
    Selection 2: Gets automatically populated based on selection 1 to show the product hierarchy tree for this variable.
    I have tried using replacement paths to do this but it does not allow this.
    Any ideaS?
    Thanks

    It finally worked, looks like the reason it was not working was a Query Designer exception issue whihc went with a re-start of Query Designer.
    All good

  • Using variable in NScript

    I'm trying to set SName to the username, then get the volumes
    restrictions based on the variable SName, which is set to the username.
    How do you use variables in NScript functions?
    here is the statement taht errors:
    Set restr = RestrictionsObj.Element (SName)
    If I use Set restr = RestrictionsObj.Element ("Specific UserName") it
    works.
    such as Set restr = RestrictionsObj.Element ("Student1") it works.
    On Error Resume Next
    Dim SName
    Set nwdir=CreateObject("UCX:NWDIR")
    'Enter the username and password
    nwdir.Login (".username.context", "password")
    Set volmgr = CreateObject ("UCX:VolumeMgr")
    Set volumes = volmgr.volumes
    Set volume = Volumes.Element("Docs")
    'Enter the NDS context
    nwdir.Fullname = "NDS:\\TREE\context"
    Set entries = nwdir.Entries
    Print "Total number of entries: "&Entries.Count
    Entries.Reset()
    While Entries.HasMoreElements()
    Set Entry = Entries.Next()
    Print Entry.ShortName
    Set SName = Entry.ShortName
    Print SName
    'Note: Name prints twice here just like it should
    If (Err.Number = 0) then
    Set RestrictionsObj = volume.GetSpaceRestriction ()
    If (Err.Number = 0) then
    Set restr = RestrictionsObj.Element (SName) 'Fails here
    If (Err.Number = 0) then
    Print "The restriction volume limit for " & restr.Name & " is
    " & restr.VolumeLimit
    Else
    Print("Failed to find restriction for the specified user " &
    Err.Description )
    Endif
    Else
    Print ("Failed to get restrictions object " &
    Err.Description)
    Endif
    Else
    Print ("Failed to find the volume " & Err.Description)
    Endif
    Wend
    sgdought

    sgdought,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Repost Function using Variable is not working

    Hello experts!  I am on BW-BPS 3.5.  I have set up a repost function using variables to change a characteristic value for Business Unit.
    1. I created 2 variables as Bus.Unit From and Bus.Unit To in the Planning Area. I am not using the variables in my planning level.
    2. I entered the variables in the parameter group New Values area for the From and To Values.
    3. My goal is when the user executes the Repost Function for a Variable Prompt should appear and have the user select the From Business Unit and To Business Unit.
    The Variables are set up as USERVALUE User-Defined Values, Restriction of Values required by user and I have tried with/without option of Input Allowed by User. 
    Can you tell me what I am doing wrong, I expected a variable prompt when executing the Repost Function but it does not work.
    Thank you,
    Teri

    Ravi, Thank you for your reply however I contiue to have errors or the execution does not repost (change any value) as noted below.
    1. I have 2 Variables in Planning area var1 (from) var2 (to) for the same charateristic which is Business Unit
    2. Business Unit is in the level,  on the selection tab to add the variable I can only add 1 variable, So I added var1 (from) to the level. 
    3. Parameter group for old and new values - I have Var1 (from), var2 (to)
    4. Report Function - are you referring to Reporting variables in BPS? I have set this up as suggested in the "How to Use Reporting Variable in BW-BPS" document.
    5. Enter plan data: I receive prompt for VAR1, mandatory. At this point there is no value in Var2.
    6. Execute Repost function - I receive an error to "Restrict Var2"
    7. If I set variable values and add a value for Var2 I receive an error "The generated data is not contained in the selection condition".
    Next I removed VAR1 from my planning level and turned on the option 'Selection in package' for Business Unit. This seems to work well.
    What do you recommend?
    Thank you,
    Teri

  • BPS ERROR I CREATE A NEW Manual Planning when a use variable in lead column

    Dear
    when a create a new manual planning have a message.
    Frist
    I create two variable one is Controlling Area other is Cost Element
    in planning area.
    next
    I a create a manual planning to make a report form.i create a
    manual planning layout category is key Figures and make Controlling
    Area and Cost Element as lead column in next continue setup lead
    columns tab.i set key figure and set Controlling Area and Cost Element
    to use variable above.and finish other tab.
    next
    i double click manual planning system give me a message
    The environment has changed; the layout can no longer be executed
    notes: i can insure Controlling Area and Cost Element is a single value
    and make sure both can mapping in cube
    by the way when i use fixed value this form will be run.
    Edited by: frank ju on Aug 6, 2009 11:13 AM

    Hi Everybody:
    I summarize the last post: In RoboHelp 7 for Word, the problem is that when I try to create a winhelp2000 project importing from a .hlp file of origin created previuosly, the import process makes error because it want to extract images that not exist on the .hlp file of origin. Thanks in advance for all the help that you can give me.
    Ismael.

  • Why use Variables in CR XI?

    Post Author: jonnohudski
    CA Forum: Formula
    I have just finished a week of Crystal Reports training with my Companies prefered training provider and had a question that the instructor (and his whole company apparently) could not answer.
    I simply asked why would someone use a Variable on a report, instead of a Function, which seems to do pretty much the same thing, only easier.
    Personally, I assumed there was some clever functionallity that could only be achieved by using variables and I just wanted a real world example.
    Can anyone suggest a reason for it? I have searched all the resources available to me and cannot find a reasonable answer.
    If you know and have a real world example, could you explain it?
    Cheers.
    John.

    Post Author: SKodidine
    CA Forum: Formula
    I hope they mentioned manual running totals and passing data between the main and sub reports.
    Variables hold data be it local, global or shared. Functions usually behind the scenes calculate and give you the result.
    Since you are new to CR, check out the sample reports to see how variables are used and how functions always do not fit the bill.
    Let's say for example, I have a report that lists all companies that we do business with, that have branch offices all over US/Canada.  The report only displays branches that have gross sales over $1m.  I use group selection formula to suppress all branch groups whose gross is less.  This translates to suppressed records in the report.  With suppressed records you cannot use Running Totals as it will tally the suppressed records as well.  In this case you will have to use a manual running total, which means using formulae i.e. variables to count each record that meets the conditions and tally.
    Sharing information between the main and subreports is another area where 'shared' variables are used extensively.
    Once you start working with CR you will gain better understanding about variables and functions.  Get cracking !!!

  • I need help with button coding to go to the next scene

    Hi! I have been using flash cs5 for a few years now and I've never been great with coding since i usually just do swf animations. However I am in the process of writing a story/book and I wanted to make a little guide for all of the dragons species in the story.
    Example: I had it so there is a title screen and a start button, you click the start button and you are taken to the next scene; which is a picture of a mist dragon I drew and then audio plays; describing mist dragons. in the corner there is a "next" button and when you click it, it takes you to the next species and the audio plays just like with the mist dragon.
    my major problem is my code is muffed up( I know it is totally incomplete, but this code is what I am comfortable working with, anybody know whaat the full code is?). I typed in what I could remember from class... could anybody help me?
    here is the code i remembered:
    Stop();
    btn1.addEventListener(MouseEvent.CLICK…
    function btn1Listener(e:MouseEvent):void {
    gotoAndStop(1, "mist dragon");

    use:
    Stop();
    btn1.addEventListener(MouseEvent.CLICK,btn1Listener);
    function btn1Listener(e:MouseEvent):void {
    gotoAndStop(1, "mist dragon"); //<- you may want gotoAndPlay(1,"mist dragon")

  • HT1657 I have rented a movie from Itunes, but when I try to watch it it pauses itself, then skips to the next scene...can anyone tell me why and as I have paid money for this shouldn't I at least be able to watch without any hiccups?

    I have rented a movie from Itunes, but when I try to watch it it pauses itself, then skips to the next scene...can anyone tell me why and as I have paid money for this shouldn't I at least be able to watch without any hiccups?

    You've tried restarting the film ? If it still skips then try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via Store > View My Account and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that film and use the 'Report a Problem' link and fill in details about the problem (iTunes support should reply within, I think, 24 to 48 hours).
    Some people have had a problem with the 'report a problem' link (it's been taking people to this site on a browser instead of showing a form in iTunes) - if it does that to you then try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page.

  • Using variables with lightboxes...

    Hi all,
    I am currently creating a scenario with two lightboxes. When you click a button the lightboxes will appear. When you click the 'x' button on both of the lightboxes, a button will appear, allowing the user to go onto the next slide. However, I have been unable to achieve this effect.
    I have been able to use variables across different slides, but not on the same slide. Any help would be appreciated. Thanks.

    Create a counter variable that you assign the value 0. Maybe it is even better to assign that value not in the definition but On Enter for the slide. For the moment you have two actions, those will have to be turned into conditional advanced actions with two decisions. Something like this:
    First decision 'Always'
    IF 1 is equal to 1      this is a mimicked standard action
       Show lightbox 1         
       Increment v_counter
    Second decision 'Checkit'
    IF v_counter is equal to 2
       Show Gr_Buttons
    I used a group, didn't want to type too much, you can group the 3 buttons.

  • Error-Receiver File Adapter using Variable substitution when file is empty

    XI Experts,
    We are on PI 7.0, SP14.
    We are using variable subtitution to get the filename from source message. This works fine as long as we have data in the payload for filename element. But we have a scenario where we don't have to create file when certain condition does not exists in source message so in the message payload filename element will not exists in such condition and file will be empty and we should not create file.
    Parameter in the communication channel for Handling empty message is "Ignore".
    Does anyone knows how to handle this scneario. We don't want to default any file name in the message mapping if source file name element does not exists.
    We are following getting error in the Adapter engine.
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: file: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: file
    Thanks
    MP

    You can implement this by writing the module to throw an exception or whatever method you want to execute.
    If you don't want to receive an error message then module is suitable for you.
    Gaurav Jain

  • Using variables to insert data in the table

    I want to insert datas in the table. I use constants,
    all the constants are stored properly in the table. But,
    when I use variables I get the error message
    "Too few parameters. expected 6".
    (I declared all the fields of the table as text only.)
    My program is "newt.jsp"
    <%@ page language="java" import="java.sql.*" %>
    <html>
    <head>
    <title>storing customer information in the database</title>
    </head>
    <body>
    <%
    String cno1 = request.getParameter("cno");
    String n1 = request.getParameter("n");
    String add11 = request.getParameter("add1");
    String add21 = request.getParameter("add2");
    String phone1 = request.getParameter("phone");
    String email1 = request.getParameter("email");
    Connection con = null;
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:customer"," "," ");
    Statement statement1 = con.createStatement();
    Statement statement2 = con.createStatement();
    statement2.executeUpdate("create table cust1 (cno varchar(20),n varchar(20),add1 varchar(20),add2 varchar(20),phone varchar(20),email varchar(20))");
    statement1.executeUpdate("insert into cust1 (cno,n,add1,add2,phone,email) values(cno1,n1,add11,add21,phone1,email1)");
    catch(SQLException sqle) {
    System.err.println(sqle.getMessage());
    catch(ClassNotFoundException cnfe) {
    System.err.println(cnfe.getMessage());
    catch(Exception e) {
    System.err.println(e.getMessage());
    finally {
         try {
         if(con!=null) {
              con.close();
    catch(SQLException sqle) {
    System.err.println(sqle.getMessage());
    %>
    <br><br>
    Mr./Ms. <%=n1 %> <br>
    Your datas have been stored.<br>
    </body>
    </html>
    Those who know answer please reply.
    My thanks in advance.

    I would expect your insert statement to be this:
    statement1.executeUpdate("insert into cust1 (cno,n,add1,add2,phone,email) values('"+cno1+"','"+n1+"','"+add11+"','"+add21+"','"+phone1+"','"+email1+"')");
    If you just create a string, it's not going to fill in variables into the string by magic.

  • Using variable with the same name as field name?

    I have a complex proc where I have variables with the same name as field name used on a query. something like this:
    SELECT a.id_table WHERE a.id_table = id_table
    where the last id_table is a parameter sent to the proc:
    declare procedure myproc(id_table int)
    Is there any way or notation to declare the variable inside the query as a variable or I have to use a different name?

    Well, variables are not the only thing you have to change if you want to switch to Oracle.
    Although I don't think it is good practice (to use variable name same as column name), here is one example how you can achieve it using EXECUTE IMMEDIATE and bind variable
    SQL> select deptno, count(1)
      2  from scott.emp
      3  group by deptno;
        DEPTNO   COUNT(1)
            30          6
            20          5
    10 3
    SQL> set serveroutput on
    SQL> declare
      2  deptno varchar2(10);
      3  i number;
      4  begin
      5  deptno:=10;
      6  execute immediate
      7  'select count(1) from scott.emp where deptno=:deptno' into i using deptno;
      8  dbms_output.put_line('OUT ---> '||i);
      9  end;
    10  /
    OUT ---> 3
    PL/SQL procedure successfully completed.
    SQL> Message was edited by:
    tekicora
    Message was edited by:
    tekicora

  • How to use variables with

    I need to get the number of lines in internal table, which would
    be easy, using DESCRIBE TABLE itab LINES lines. But the problem
    is, that I get the name of this internal table in the field of
    another internal table, so I have to use the name of internal
    table as variable, but I don't know how to use variables with
    DESCRIBE TABLE (or if this is possible).

    Hi,
    REPORT ZPRUEBA782 .
    define two tables with diferent structures.
    data: begin of table1 occurs 0,
    registro type i,
    end of table1.
    data: begin of table2 occurs 0,
    registro type i,
    repid like sy-repid,
    end of table2.
    data: rows type i.
    start-of-selection.
    fill them with data
    do 1000 times.
    table1-registro = sy-tabix.
    append table1.
    enddo.
    do 1757 times.
    table2-registro = sy-tabix.
    table2-repid = sy-repid.
    append table2.
    enddo.
    call a form that receives as input the table and returns the number
    of rows as output.
    perform howmanyrows tables table2 changing rows.
    break-point. "evaluate the number of rows
    perform howmanyrows tables table1 changing rows.
    break-point. "evaluate the number of rows
    end-of-selection.
    form howmanyrows tables itable changing rows.
    rows = 0.
    loop at itable.
    add 1 to rows.
    endloop.
    endform.
    You can try it if you don't find a better solution.
    Cheers,
    Chaitanya.

  • How to use variables in data slices?

    Hello,
    in BI-IP I have tried to use variables in a data slice.
    The user should fill these variables.
    How can one use and fill these variables?
    Thank you
    Daniel

    Hello Horst,
    data slice is a very strong system lock. It is normally not a good decission to allow users to control this part becuse it sould be in administration of a responsible person.
    If you allow users in the web to open or close data slices, this is like a "open period" funtion in financials: Think about what could happen, if anyone else than the responsible person could do that....
    This is my point of view.
    I would do it in anoter way: Create an User exit and fill a variable like desribed above. You read each line and make a decission whether the user might see this line or not (e. g. period open? yes or no?). The period and the status for the period could be maintained in a table or in a characteristic. table might be easier.
    regards
    Eckhard

Maybe you are looking for

  • How many folio can I share with a Id CS6 license ?

    Hi, as it's write in the Adobe In Design sale sheet you can : InDesign CS5 and CS5.5 customers can now: Create an unlimited number of .folio files in InDesign Preview them on Adobe Content Viewer  – including interactivity – to see how they will rend

  • WRVS4400N FTP Server Time-out Issue

    I recently installed a Linksys WRVS4400N wireless router.  After installing it, I began to experience an FTP connectivity issue.  (I use Macromedia Dreamweaver to do my web site file transfers.)   Although I can connect to my web servers and log in s

  • I need to resume TM backups on previous TM external

    I was using a 250GB external USB HD for my TM with great results. Recently, I got a 500GB and changed my TM prefs to start using the new external. That drive failed, so I want to resume using the old 250, but I DON'T want to reformat the old drive an

  • NW BPM not running

    hi, I have install EHP1 CE 7.1 , after I check the service , it show error that "NW BPM not running" , so I am wonder how can I start BPM service , is it start automatically or by hand? Edited by: dd ww on Nov 29, 2008 3:54 PM

  • I am unable to get small contact photos display while receiving or making calls!!

    I am unable to make out how to get a small display of the photo on the right hand top corner of the phone while receiving or making calls. I always get a larger display which is covered by the phone options. I have tried every possible option 1. Addi