Variables in different timelines

If I define a variable in the main timeline, can I modify its
value in another timeline (i.e. inside a movieclip timeline)? If,
so how do I call on this variable from within a movieclip's
timeline?
Thanks.

You get a reference to the clip the variable is in, and then
access it with
dot notation. Example, if you're in root, and you want to set
the value of
the variable 'myName', within the movieClip 'pic' you could
do:
pic.myName = "someName";
Or, if you were in pic, and you want to set a var on the main
timeline you
could do:
this._parent.myVariable = someValue;
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

Similar Messages

  • Help with menus and variables in different classes.

    1) how do I change variables in different classes? My situation..
    I have a few tabbed panels/planes, that ask for different user inputs. I want the last tabbed panel/plane to have the inputs on 1 plane. Is that confusing?
    Code:
            JTabbedPane tp = new JTabbedPane();
            tp.addTab ("Kitchen", new KitchenPanel());
            tp.addTab ("Living Room", new LivingRoomPanel());
            tp.addTab ("Master Bedroom", new MasterBedPanel());
            tp.addTab ("Bedroom 1", new Bedroom1Panel());
            tp.addTab ("Bedroom 2", new Bedroom2Panel());
            tp.addTab ("Misc Use", new MiscPanel());
            tp.addTab ("Totals", new TotalsPanel());not the full thing obviously, but just so u see what im working with.
    2) How do popup menus work? I have a menu (File -> About | File -> How to Contact)
    I want The File->About menu item, to prompt a dialog
    The File -> How to to prompt a dialog
    Contact Menu(Not Item) to load a webpage
    thanks again for the help, and i hope its not to confusing
    Edited by: 2point2ek on May 25, 2009 9:51 PM

    It's better to think in terms of transferring data between object, rather than between classes.
    What you need is for the tab pane objects to have a reference to some common object to which the data is to be sent. This common object might be the total pane. It's generally better design to keep the data in separate objects from the presentation (in this case the totals pane), but at this stage that's probably just going to confuse you.
    The simplest way to get this reference in is to the pane objects is as a constructor argument, which the constructor of your pane objects saves in a field. As you create each pane you pass it a reference and it stores that reference for when it needs to save data.
    Then, when you click detect the action by which the user tells the program to store the data he's entered the pane class should call a method on the central data object, passing all the data from that pane. If there's a lot of it, wrap it up in an object (typically called a "data transfer object").
    The central data object would be responsible for dealing with this data, amending totals etc.. It might delegate responsibility for updating the display to a separate total pane object.

  • Order of workbook variables is different to order in query

    Hi Friends,
    I have a curious situation. When I open one of my workbooks then I see the order of my variables is different o the order of these variables in the underlying query.
    Does or did anyone have the same issue seen so far ?.
    To be honest, it worked before I made the following change in my query:
    - First I had my fiscal year variable in the global filter but the variable was at first position in the query and it was also in the workbook.
    - Then I removed the variable from global filter and added it back into characteristics. I moved it into first position of the variable order again.
    However, since then my workbook shows this variable at the end of list !!!!
    I already rremoved and moved the query back into the worbook but no positive change so far.
    Any ideas would be much appreciated.
    Thanks

    Hi,
    We also faced the same kind of issue some time back in our project and we simply recreated the workbook and it got resolved.
    I think some time workbook doesn't acquire query changes automatically, you can regenerate the workbook and check.
    Regards,
    Durgesh.

  • Initializing more than one variable of different types in for-loop

    I know it is possible to initialize two variables of the same type in a for-loop like this:
    for(int i=0, j=0;i<=word.length/2;i++){}
    However, I'm trying to initialize two variables of different type in the initialization of for-loop. And the IDE won't let me do it..
    for(int i=0, double j=0;i<=word.length/2;i++){}
    Is it even possible to do initialize two variables of different type?

    Well, just for fun, you can write very generalized for loop. you can do it in a complicated way though.
    But, for god sake, why would you do that?
                 boolean someboolean = true;
              for(Object i=new Integer(0),j=new Double(1);someboolean;i=(Integer)i+1){
                   j =(Double)j + 1;
                   if((Double)j>3)
                        someboolean = false;
                   System.out.println("i: "+i+" j: "+j+" someboolean:"+someboolean);
              }

  • How to access _global variables in different domain

    hi
    i am loading a swf in local and this has to be communicate the swf which was in the server(different domain). using the system.security.allowdomail i can access the variables, but i can't able to access _global variable.
    Pls tell how to access _global variable in different domain
    Thanks in advance
    @flash

    Ganesh,
    It should work the way you mentioned it. I don't see why it
    didn't unless there is a spelling mistake or something. If there
    is you should have a got an error message. :-)
    I actually don't recommend using globals at all, I would rather
    use a PL\SQL Package Specification to define Global Variable.
    These variables are valid for the duration of the Session and
    they are restricted to Char(255) limit. It reduces the number of
    mistakes when converting dates and Such. It also forces the
    developers to place all the globals in one place instead of
    multiple places. Read Feurstein's book on PL\SQL Programming for
    more details.
    Sunil
    MS Ganesh (guest) wrote:
    : Hi Steve,
    : I know how to assign values to global variables.
    : I did the following
    : Form Name : FIRST_FORM
    : :global.group_id := 'SUPERVISOR'
    : call_form('SECOND_FORM');
    : In Second Form
    : When New Form Instance
    : Message(:global.group_id);
    : No message is displayed.
    : Please explain to me the steps in detail.
    : Thanks in advance.
    : Bye
    : MS GANESH
    : Steve (guest) wrote:
    : : Just assign value to global variable i.e.
    : : :global.foo := 'anything'; or
    : : COPY('anything', 'global.foo');
    : : to remove global variable
    : : ERASE('global.foo');
    : : Note: global variables are always VARCHAR2(255);
    : : MS Ganesh (guest) wrote:
    : : : Dear OTN Members,
    : : : I would like to pass values between forms,
    : : : I know it is possible to do it by using Parameters.
    : : : But I would like to know how to use global variables to
    : : : accomplish the same task.
    : : : Thanks in Advance.
    : : : Bye
    : : : MS Ganesh
    null

  • Sharing variable among different file

    How to set value to a variable from different file.I can not use interface because interface make everything as final.Is there any other way to set number of variables from more than one file?

    I guess you want to declare the variable in one class and change the value of the variable in another class. If I am correct, try the following
    public class First {
            public int a = 10;
    //TODO
    public class Second {
         private First firstObject = null;
         public void changeValue() {
               if(firstObject == null) {
                   firstObject = new First();
                   firstObject.a = 30;
    }

  • Access Variable on Main Timeline from Package

    I have set a variable on the root level timeline.  I have a movieclip that calls a package and within that package I want to call or access the main timline variable.  I have tried MovieClip(root) currentLabelName or just calling currentLabelName and none of that works.  Is there another way to be able to access it?

    I agree with dmennenoh that it's probably best not to mix the two, but let's start out assuming you do mix the two, and also the following
    Your instance is called assessment5Q
    You have a frame script on the same frame with the label you want to get.
    Your frame script might look like:
    assessment5Q.loadQuestions(currentFrameLabel);
    Your Assessment5Q Class would have a method that looks like:
    public function loadQuestions(label:String):void {
        //do your current load here
    Now that your Class is set up to work from a framescript, it will work from a Document Class without modification. However, it sounds like your instance doesn't exist on frame 1 of the main timeline, so you need to make sure you don't try to reference your instance before it exists. So we're going to make use of a getter/setter pair, which will allow Flash to create your instance on the timeline per usual, but when the setter is triggered you can then do things with the new instance. Your main document code would include code something like this:
    protected var _assessment5Q;
    public function get assessment5Q():Assessment5Q {
         return _assessment5Q;
    public function set assessment5Q(value:Assessment5Q):void {
         If (_assessment5Q != value) {
              _assessment5Q=value;
              If (_assessment5Q) {
                   _assessment5Q.loadQuestions(currentFrameLabel);
    Note that even this better way is not a way I'd recommend if you expect your project to take longer than a couple of days to develop or be maintained over more than a couple of weeks. It's not good practice to have a single Class that has the responsibility for both getting the data and displaying it. If you only have a single question format, you may be able to get away with having a Class that loads the questions and makes questions from it. Then you can pass the loaded questions into your View as above (instead of using a method that takes a string, you can use a method that takes an array of questions).
    It just so happens that I build Assessments as the vast majority of the work I do, and I have it broken down where there is a Class that has some number of Classes inside it that know how to build individual question types. That Class gets XML handed to it (from a different Class that just handles loading XML) and then it figures out which child Class knows how to build each question type and hands a snippet of XML to the appropriate child. Once all the questions are created, a set of questions will be handed into a View that can show between 1 and 9 questions. It does this by having individual question views on stage that, again, know about displaying specific types of questions. I'm not saying that you need to go whole hog into creating such a scalable design as I have. I'm just suggesting that your product is more likely to stand the test of time if you break things into smaller pieces that then cooperate. That way if the bigger pieces aren't quite right, you can put the smaller pieces together in a different way.

  • How can I associate unique information/ variables with different instances of attachMovie when creat

    I'm creating an interactive animation of an experiment, whereby the user has to detect if there is an oil well lying beneath the surface by selecting and drilling a series of coordination points on a map.
    I've done the first stage by setting up a background image containing a grid of 20 x 20 coordinate points, eg columns 1 - 20 and rows A - T. Over the top of this, I've created a dynamic array of clickable objects (open circles) and the centre of each one is  placed over a coordinate point, so when you mouseover a coordinate point, eg C3,  an open circle becomes visible and when you rollout, it becomes invisible again.
    However, I'm stuck on the next stage. I need to be able to assign unique variables to one or more clickable objects (open circles). Is it possible to do that? For example:
    a)give grid point coordinates to each object (open circle), so for example if someone rolls over the C3 coordinate, the open circle (object) associated with that coordinate, a message will display: "Click on the grid point to drill at C3"
    b)assign a variable to one or more objects, so that when an open circle is clicked, the animation associated with that coordination point will be triggered. There will be different animations, depending upon which object (point is clicked)
    There are other variables that will need to be setup, but if I know how to assign variables to one or more objects, I can probably figure out the rest.
    Here's a copy of my code so far:-
    //set up grid for solid array
    spacing = 5.75;
    cols = 20; // number of columns in grid
    rows = 20; // number of rows in grid
    leftMargin = 154;
    topMargin = 169;
    depth = 100; // starting point for depth
    for (i=1; i<=rows; i++) {                                                                                                        
    for (j=1; j<=cols; j++) {                                                                                                         
    current = attachMovie("openCircle_mc", "openCircle_mc"+i+"_"+j, depth++);
    current._x = leftMargin + ((i-1) * (spacing + current._width));
    current._y = topMargin + ((j-1) * (spacing + current._height));
    //open circle initially invisible, visible on rollOver
    current._alpha = 0;
    current.onRollOver = function() {
               this._alpha = 100;
    current.onRollOut = function() {
               this._alpha = 0;
    Below is the background and a rolled over instance of the 'openCircle' object at 'C3'.
    I'd very much appreciate some help. Thanks very much.
    Pippa

    you can assign properties (and methods) to movieclips:
    //set up grid for solid array
    spacing = 5.75;
    cols = 20; // number of columns in grid
    rows = 20; // number of rows in grid
    leftMargin = 154;
    topMargin = 169;
    depth = 100; // starting point for depth
    for (i=1; i<=rows; i++) {                                                                                                         
    for (j=1; j<=cols; j++) {                                                                                                          
    current = attachMovie("openCircle_mc", "openCircle_mc"+i+"_"+j, depth++);
    current._x = leftMargin + ((i-1) * (spacing + current._width));
    current._y = topMargin + ((j-1) * (spacing + current._height));
    current.row=i;
    current.col=j;
    current.oil = Math.floor(Math.random()*1.1);  // about 1/10 objects have oil=1, 9/10 oil=0
    //open circle initially invisible, visible on rollOver
    current._alpha = 0;
    current.onRelease=function(){
    trace(this.row+" "+this.col+" "+this.oil);
    current.onRollOver = function() {
               this._alpha = 100;
    current.onRollOut = function() {
               this._alpha = 0;

  • Using variables in different methods

    So I have to write a program that plays a game of craps for you. Here's the code:
    import java.util.*;
         class Craps{
             public static void main(String[] args)
               bet();
               dice();
               winnings();
            static void bet(){
               double bet;
                Scanner sc = new Scanner(System.in);
               System.out.println("How much money would you like to bet?");
                  if(sc.hasNextDouble())
                   bet = sc.nextDouble();
            public static void dice() {
                 int die1, die2, total;
                     die1 = (int)(Math.random() * 6) + 1;
                     die2 = (int)(Math.random() * 6) + 1;
                     total = die1 + die2;
              static void winnings(){
               while(total != 2 || total != 12 || total != 7 || total !=11 ){
                    total = points;
                    double winnings = points * bet;
                    System.out.println("You win $" +winnings);
                    return bet();
                 if(total = 2 || 12){
                     System.out.println("You lose, bet again.");
                     return bet();
                 if(total = 7  || 11){
                    System.out.println("You win $" +bet);
                    return bet();
       }I'm probably doing a few things wrong here, but it won't even compile because I can't figure out how to get the different methods to use the same variables.
    PS the point of the assignment is to do it with a bunch of methods, so while I could probably rewrite them without them, it would defeat the purpose.

    My compiler doesn't like it. Heres what my code is like now.
    import java.util.*;
         class Craps{
             public static void main(String[] args)
               static double bet;
               static int die1, die2, total;
               bet();
               dice();
               winnings();
            public static void bet(){
                Scanner sc = new Scanner(System.in);
               System.out.println("How much money would you like to bet?");
                  if(sc.hasNextDouble())
                   bet = sc.nextDouble();
            public static void dice() {
                     die1 = (int)(Math.random() * 6) + 1;
                     die2 = (int)(Math.random() * 6) + 1;
                     total = die1 + die2;
            public static void winnings(){
               while(total != 2 || total != 12 || total != 7 || total !=11 ){
                    total = points;
                    double winnings = points * bet;
                    System.out.println("You win $" +winnings);
                    return bet();
                 if(total = 2 || 12){
                     System.out.println("You lose, bet again.");
                     return bet();
                 if(total = 7  || 11){
                    System.out.println("You win $" +bet);
                    return bet();
       }And when i try and compile it this is what it says:
    craps.java:7: illegal start of expression
               static double bet;
               ^
    craps.java:8: illegal start of expression
               static int die1, die2, total;
               ^
    2 errors

  • Variable acting differently in differnt reports

    Hi All,
    i Have a problem with a Variable.
    i have used a standard variable for Fiscal year (Manual Entry/ Default).
    i have used the same variable in 2 reports, in Free Chanracteristics and restricted with variable in Default values of Quer Designer.
    Report 1
    Am Executing a report, in the selection prameter Screen i select 2008 for Fiscal year.
    After executing, the report displays the data, now if i change the fiscal year value in filter to 2009 the report does not shown any data, at the same time if i use 2 filter values say 2007 & 2008 it shows data only for the year selected in the prameter screen before executing.
    Report 2
    If i execute this report with 2008 as fiscal year and change the fiscal year value in the filter pane to 2009 i can see the report for 2009 and when i select 2 years 2008,2007/2009 the report displays aggregated data for 2 years.
    i have used same variable for both the reports but the reports are behaving completely different.
    Can anyone suggest me what might be the problem
    Regards
    Jasmine

    Hi Tobias,
    Report 1 is restricted with fiscal year variable, due to which the values were not aggregating for different years. so once the restriction for the key figures is removed will the report be behaving as report 2?
    will this change cause any problems in the  report execution. report is already being used by users, in case i change the query and if it does'nt work that would be leading to more problems.
    Do you have any idea about the effects,
    I've assigned points for your helpful answer.
    Thank you,
    jasmine

  • BEx Analyzer exit variable behaves differently from RSRT

    Hello experts
    I have an exit variable on a number of queries which is being filled out at I_STEP 1 with different values depending on which query is executed. This is a requirement for a number of reasons and cannot be changed. The user then has a different variable which is user input ready so he can select from one of the values I supply them. This variable is in the proposed values section of the query so it should only list the variables allowed for the user to select.
    For example on query A, I want the exit variable to give the values 1,2 and 3. The user, on variable screen can select in the input-ready variable on of those values. In query B the same happens except the exit variable has values 3, 4 and 5.
    If the user accesses one of these queries everything works fine. The problem happens when the user accesses query A, closes it and then accesses query B. In this situation he sees values 1,2,3,4 and 5 as available instead of only 3,4 and 5. It seems that the system shows him variables 1 and 2 despite the fact that he can't access them. This only happens in analyzer but not if I use RSRT. Is it a bug in Analyzer? I've tried debugging from RSRT the code to check if I forgot to clear something but I cannot find anything wrong but then again the problem does not happen in RSRT.
    What can I try to do to solve this?
    Thanks for your help.

    I've done some further researching and discovered the following:
    1 - My exit variable is working fine. It gets the correct values.
    2 - The user-input variable is not being filtered correctly. It looks like it does not show only the values allowed in the exit variable.
    Is this right? I thought if I had a set of values in the filter of the query, they would automatically restrict user input variables that the query may use in the proposed values.

  • How to merge XML-Data of two variables of different namespace?

    Hi all,
    I am facing a problem manipulating XML data in a BPEL process. As I didn't get any response on my question in the BPEL forum, I decided to post it again in this forum. I am not very familiar with using XML up to this moment, so please don't blame me if this turns out to be a stupid question.
    I have to combine information coming from 2 different sources (1st delivered by BPEL-client input "FileInfo", 2nd delivered by a ftp-adapter "FileData") for passing it to another service.
    So there are 3 XSDs (2 in, 1 out), each with a different namespace. As every structure is composed of several elements, I don't want to copy them one by one. But when copying a whole node including child elements, the target structure yields empty nodes, because the target child elements maintain the source namespace!
    Using 2 XSLT's works well for each input, but in combination, the last transformation deletes the information of the first one.
    So, the only way to merge the data I figured out by now, is to use a XSLT for each input, transforming it into 2 separate Variables belonging to the same namespace and then copying the complete nodes of the two variables into the target (which of course belongs to the common namespace as well).
    Although there is an inconsistent indexing of the namespaces (see example), happily all data can be accessed.
      <CommonData>
        <CommonData xmlns="http://TargetNamespace.com/CommonData">
          <FileInfo xmlns="http://TargetNamespace.com/CommonData">
            <Name>testfile2.txt</Name>
            <Size/>
            <DateReceived>2009-02-10T17:15:46+01:00</DateReceived>
          </FileInfo>
          <FileData xmlns:ns0="http://TargetNamespace.com/CommonData">
            <ns0:KOPF>
              <ns0:Id>1</ns0:Id>
              <ns0:Value>1</ns0:Value>
              <ns0:Text>Hier könnten Ihre Daten stehen -</ns0:Text>
            </ns0:KOPF>
            <ns0:POSI>
              <ns0:Id>1</ns0:Id>
              <ns0:Position>1</ns0:Position>
              <ns0:Value>1</ns0:Value>
              <ns0:Text>eins ----</ns0:Text>
            </ns0:POSI>
            <ns0:POSI>
              <ns0:Id>2</ns0:Id>
              <ns0:Position>2</ns0:Position>
              <ns0:Value>2</ns0:Value>
              <ns0:Text>zwei ----</ns0:Text>
            </ns0:POSI>
          </FileData>
        </CommonData>
      </CommonData>Now for the question:
    Is this really the only way to merge variables? As it took 4 operations to achieve this, it seems to be too complicated, and therefore too inperformant to me.
    BTW: In real life there would be up to 9999 positions with much more payload (in total up to several MBs) to be processed!
    Having full control of the namespaces in this case, I could think of using one namespace for all XSDs too. But would this be a better solution? Is there a golden rule on using namespaces relating to design issues?
    Any comments appreciated,
    cheers, Marco

    Well, if you only want to change namespace (no other changes) I would use a single generic XSL that changes the namespace for any XML document into a given target namespace, keeping the rest. That will require two transformation calls, but only one XSL. I'm afraid I don't have an example available, but if you google perhaps you can find it, I have seen it somewhere.
    Normally when you have different namespaces the contents differ as well, though, and what you really want is a merge function. There is a way to pass two documents into a single XSL and that is to use parameters. You pass one source document the normal way and assign the other converted to a string to a paramter. You must use an assign with processXSLT in BPEL, not a transform activity. The processXSLT really takes three arguments and the third contains the parameters. Now to the difficulty - in the transformation you need to change the string into a nodeset (an XML document). In the current XPath version used by the platform there is no nodeSet function, but it is possible to write one in Java. If you have it you can select from both documents while building the third. I don't have an example handy and yes it is a bit messy as well, but much of the work only has to be done once and can be reused in other processes.

  • How to pass local variables between different sequence files?

    Actually i want to pass the data (local variable) from my process model file to a client file. The client file only has the callbacks and those callbacks require some parameters as input which is available in local variables of my process model sequence file. I do not want to use Station Globals.
    Please tell me any other way by which i can pass that data.

    Which Locals do you want from the model.  Every sequence has it's own Locals and there are a bunch of sequences in every process model.  Do you want the entry point's Locals?  A callback's Locals?  Just one of the sequence's Locals?  Some Models have way more entry points than others.  What if your sequence file is ran with a different entry point?
    One option is to create your own callback in the model and pass the data to it as parameters.  Then add that callback to your client sequence file and get it out of the parameters.
    If you simply want the entry point's locals and you are in your Main Sequence then you could use RunState.Caller.Locals.VariableName.  This assumes you will use the same entry point every time you run that sequence file.  Or assumes that every entry point you run has the same Local variable name.
    Maybe there is an API method that exposes what you are looking for.  What is your goal?
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Show InstanceName In different Timeline

    I Had a main timeline, timeline2, and timeline3.
    In timeline2, I had 2 buttons in frame1 and a Movieclip In Frame2.
    In timeline3, I added 1 component, label.
    The movieclip will display beside the 2 different button when clicked.
    But how do i make the component, label (with the button instance name) appear with the label when button is click

    It is not clear what you mean when you use the word "timeline" in describing what you have designed.  If you show a screenshot it might help make that clearer.  Also, if you show the code you are using that could help as well.  If you happen to get error messages with what you are trying to do, then you need to include those as well.

  • Accessing variables of different projects

    I have created a general "java application project" and a "Web Application project"
    How can i access a variable of the "java application" from the "web Application"
    java application -> it has Game1.java (contains the main() method)
    Assume it has a variable - btn1;
    i.e:
    public JButton btn2;
    I need to access it(variable btn2) from a class in the "web application".
    How can i do it.????
    "java application" and a "Web Application" are not in the same folder.
    "java application" -> C:\java\javaapplication
    "Web Application" -> C:\java\webapplication
    Message was edited by:
    jugp

    I think the OP is wondering how to access the data in 2 or more different applications. If the applications are running in an applet you can access them through the applet object or by simply referencing static values in your code...
    int myValue = myOtherApp.staticIntValue;
    If this isn't the case you have to either use the file system or sockets to "talk" between applications.
    ST

Maybe you are looking for