Accessing  variables from one layer.

Hi all,
I am new to falsh so please help. I have defined some
variable at one layer say click origin and destination and i want
to access that varibale on click event of a button.
how to access that variable on another layer.
Thanks in advance.

'layers' are not referred to and cannot be referred to in
action-script.
have a look here

Similar Messages

  • How can I pass variables from one project to another using Javascript?

    Hi all, I am trying to do this: let learners take one course and finish a quiz. Then based on their quiz scores, they will be sent to other differenct courses.
    However, I wish keep track on their previous quiz scores as well as many other variables.
    I found this nice widge of upload/download variables by CPguru (http://www.cpguru.com/2011/05/18/save-and-load-data-widget-for-adobe-captivate-4-and-adobe -captivate-5/). However, this widget works by storing variables from one project in local computer and then upload it to another project.
    My targeted learners may not always use the same computer though, so using this widget seems not work.
    All these courses resided in a local-made LMS which I don't have access to their code. Therefore, passing variables to PHP html files seems not work.
    Based on my limited programing knowledge, I assume that using Javascript to pass variables may be the only possible way.
    Can someone instruct me how to do this?
    Thank you very much.

    If you create two MIDlet in a midlet suite, it will display as you mentioned means you can't change the display style.

  • How to pass a variable from one class to another class?

    Hi,
    Is it possible to pass a variable from one class to another? For e.g., I need the value of int a for calculation purpose in method doB() but I get an error <identifier> expected. What does the error mean? I know, it's a very, very simple question but once I learn this, I promise to remember it forever. Thank you.
    class A {
      int a;
      int doA() {
          a = a + 1;
          return a;
    class B {
      int b;
      A r = new A();
      r.a;  // error: <identifier> expected. What does that mean ?
      int doB() {
         int c = b/a;  // error: operator / cannot be applied to a
    }Thank you!

    elaine_g wrote:
    I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
    class B {
      int b;
      A r = new A();
      r.a;  //syntax error
    }Why? Class definition restricts what you can define within a class to a few things:
    class X {
        Y y = new Y(); //defining a field -- okay
        public X() { //defining a constructor -- okay
        void f() { //defining a method -- okay
    }... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
    This is also illegal syntax:
    int doB() {
          A r = new A();
          r.a;  // error: not a statement
    }Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that.

  • Reading a variable from one method to another method

    I am pretty new to Java and object code, so please understand if you think I should know the answer to this.
    I wish to pass a variable from one method to another within one servet. I have a doPost method:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              HttpSession session = request.getSession();
             String userID = (String)session.getAttribute("userID");
             String title = request.getParameter("title");
            PrintWriter out = response.getWriter();
            out.println("userID is ..."+userID);
    } and wish to pass the variable userID to:
      public static void writeToDB(String title) {
             try{
                  String connectionURL = "jdbc:mysql://localhost/cms_college";
                  Connection connection=null;     
                 Class.forName("com.mysql.jdbc.Driver");
                 connection = DriverManager.getConnection(connectionURL, "root", "");
                 Statement st = connection.createStatement();         
                   st.executeUpdate ("INSERT INTO cmsarticles (title, userID) VALUES('"+title+"','"+userID+"')");
             catch(Exception e){
                   System.out.println("Exception is ;"+e);
        }because, at the moment the userID cannot be resolved in the writeToDB method. Thanking you in anticipation.

    Thanks for responding.
    If I replace
    public static void writeToDB(String title)with
    public static void writeToDB(String title, String userID)It throws up an error in the following method
    public void processFileItem(FileItem item) {
              // Can access all sorts of useful info. using FileItem methods
              if (item.isFormField()) {
                   //Map<String, String> formParameters = new LinkedHashMap<String, String>();
                   //String filename = item.getFieldName();
                   //String title = item.getString();
                   //System.out.println("received filename is ... " + filename );
                   //formParameters.put(title, filename);
                   } else {
                      // Is an uploaded file, so get name & store on local filesystem
                      String uploadedFileName = new File(item.getName()).getName();            
                      File savedFile = new File("c:/uploads/"+uploadedFileName);
                      long sizeInBytes = item.getSize();
                      System.out.println("uploadedFileName is " + uploadedFileName);
                      String title = uploadedFileName;
                      System.out.println("size in bytes is " + sizeInBytes);
                      writeToDB(title);
                      try {
                        item.write(savedFile);// write uploaded file to local storage
                      } catch (Exception e) {
                        // Problem while writing the file to local storage
              }      saying there are not enough arguments in writeToDB(title);
    and if I put in an extra argumenet writeToDB(title,String userID);
    again it does not recognise userID

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • Copy variable from one thread to another

    My program requires user to input a java file which contains the run() method.
    In the input file, user can declare variables and use those variables inside the run method. User also need to enter the number of threads to be spawned.
    The problem is how can I construct some method like "copy" which can copy the variable from one thread to another in my program? I can't do that since I don't know the name of the variables that the user inputted.
    I've tried this:
    class helloworld extends thread{
    void run(){
    String a="hello";
    String b="world";
    copy(0,1,a,b)
    class myProgram {
    Class c = Class.forName(fileName);         // file name of user's file     
    Thread t[] = new Thread[p];             // p is number of threads
         for (int i=0; i<p; i++){             // create threads      
                   t[i] = (Thread) c.newInstance();  
                   t.start();
    public void copy(int sourThread, int destThread, String s1, String s2){
    t[sourThread].s1=t[destThread].s2
    But it doesn't work. It said "cannot resolve symbol s1 and s2".
    please help. urgent. Thanks a lot in advance.

    You need to seriously reconsider what you're allowing the user to do. The short answer to your problem is to use a shared, synchronized associative array.
    However, since the user can specify any number of threads, you will have to resolve deadlocks, and the fact that you're asking this question suggests you will have problems doing so until you have read up on threads and shared variables in more detail. (I don't mean to be dismissive. Deadlocks and shared variables have to be customized to the application, i.e., you have to figure out just when each thread will need access to the variable, what kind of access, and when.)
    In the meantime, take a step back and take a look at the big picture.
    From what you've said, I would guess a common example of your application is that I want to be able to read file "foo.dat", uppercase each letter in the file, and write it out to "fooXXX.dat" where XXX reflects the thread number. And specify any number of threads I want.
    Threads would not be the best way to accomplish this. Do this serially.
    Alternatively, I could interpret your problem as in you need to create a main() function that's capable of reading someone else's dot-class file, clone the object and start it. In which case, why do you want to share variables? If the user did his job correctly, then his file will already contain shared variables (or copy them as appropriate). All you have to do is clone the object via the new keyword, then call start() in it.
    You cannot share something when you don't know what you're sharing.
    The third option is that you're doing this as an academic exercise (i.e., homework). Granted, yes, your professor may ask you to do things illogically just to prove they can be done. Unfortunately, we're not supposed to help you in that case. People who read this forum generally try to find logical and efficient ways of doing things.

  • How do I copy text from one layer to  another?

    I have Googled this but not a single answer seems to work.
    I am using Photoshop CS4 on OS X 10.6.7.
    OK, so  I  have a layer that  has some text in it.  I would like to  be able to  simply copy that  text  from one layer  to  another, but this seems to  be impossible as the Edit Paste menu item is grayed out after I have copied it in to the clipboard.  I can paste it into  the SAME layer, but not into another layer.
    This is how I am trying to  do  this.
    In the layer  with the text, click on the "T" icon to  the left.
    Click on the text, in the layer that I  want to  copy. 
    I select the text (either  by  clicking and dragging or pressing Command-A).
    Next I press Command-C.
    Then I  click on the layer In the Layer Panel) where I want to  paste the text.
    Pressing Command-V is impossible because the Edit-Paste menu option is grayed out!!!!
    WHY??????
    Perhaps more importantly, HOW do I copy text  from one layer to  another?

    First thing you can simply right click on the Text Layer and choose Duplicate Layer.  But that will create a new Text Lay
    er identical to the one you have.
    To answer your question in your case....  Create the Text Layer.   Make a New Layer.  Or have the layer you want to paste into visible.
    Highlight the text layer in the Layer Palette and Ctrl+Click (Win) Cmd+Click(Mac) so that you see marching ants walking around your text.
    Edit>Copy.
    Then highlight your Layer you want to paste into and hit Edit>Paste or Cmd+V / Ctrl+V.

  • How do I copy and paste vector art from one layer to another, keeping all of its attributes?

    When I copy a vector shape from one layer to another, the shape picks up the color attributes of an existing shape in the second layer (or sometimes only the outline of the shape appears). What to I do to avoid this from happening (I just just want to paste the shape in its original form and color)?

    OK - I guess this is a little more difficult than I imagined...
    Merge Layers rasterizes all the vector shapes - I want all the shapes to stay as vectors in the second (pasted) layer.
    Merge Shapes changes the color of the copied vector shape - I don't want to change the color
    Shape Layer via Copy [Ctrl] +[J] copies the layer containing the vector shape, but doesn't paste it into the second layer
    Any other ideas? Or, is it possible that PhotoShop doesn't support varied colored vector shapes on the same layer? I am coming from an InDesign background, and there was no issue having many different (colored) vector objects on the same layer.

  • Is it possible to pass a variable from one animation to another?

    I have multiple animations on the same page. I need to pass a variable from one to the other.
    Animation One has this:
    sym.setVariable("myVarOne", 1);
    Animation Two has this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getVariable("myVarOne");
    Seems like it should work, but kinda hard to tell. I put in:
    console.log("myVarOneInTwo = " + myVarOneInTwo);
    But I get: Javascript error in event handler! Event Type = timeline
    So it seems that it doesn't like getting a variable from another animation.
    Is there a way to pull a variable from one animation into another?

    Sorry also had to fix this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getVariable("myVar One");
    To this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getStage().getVariable("myVar One");

  • Moving Variable from one class to another.

    I need to get a Variable from one class to another how would I do this?

    Well this is a very tipical scehario for every enterprise application. You always create logger classes that generate log files for your application, as that is the only way to track errors in your system when its in the production enviorment.
    Just create a simple class that acts as the Logger, and have a method in it that accepts a variable of the type that you are are trying to pass; most commonly a String; but can be overloaded to accept constom classes. e.g.
    class Logger
      public void log(String message)
        writeToFile("< " + new Date() + " > " + message);
      public void log(CustomClass queueEvent)
        log("queue message was: " + queueEvent.getMessage() + " at: " + queueEven.getEventTime());
    }Hope this makes things clearer
    Regards
    Omer

  • AppleScript - Get links from one layer

    I need to make a list of linked files from one InDesign layer only but can't figure out how.
    This is my base that works just fine but gives me a list of all linked files in my document.
    set layFilesLinksList to every link of document 1
    I have tried this
    set linksList to every link of document 1 whose active layer is "Images"
    set linksList to every link of layer "Images" of document 1
    Any other suggestions?

    Thanks!
    We are a bit on the way, if i run your script as stand alone i get one of many images in the layer "Images"
    But when implementing this code in my bigger script i get nothing.
    This works as before, i get every link in my document.
    on createMiniature()
      tell application "Adobe InDesign CS5"
      set user interaction level of script preferences to never interact
      activate
      set myLinks to every link of document 1
      -- Images from one layer only workaround --
      tell active document
      if exists layer "Images" then set layerImages to layer "Images"
      set grphicBoxs to all graphics of layerImages
      set myLinks to {}
      repeat with i in grphicBoxs
      set iLink to item link of i
      set pathLink to file path of iLink
      set end of myLinks to pathLink
      end repeat
      return myLinks
      end tell
      -- End Images from one layer only workaround --
      repeat with thisFile in myLinks
      set ruler origin of view preferences of document 1 to spread origin
      set zero point of document 1 to {0, 0}
      set zeroX to 0
      set zeroY to ((page height of document preferences of document 1) + 5)
      set pageHeight to ((page height of document preferences of document 1))
      set pageWidth to ((page width of document preferences of document 1))
      set maxHeight to 13
      set theScale to maxHeight / pageHeight
      set imageXPos to ((item 2 of geometric bounds of parent of parent of thisFile))
      set imageYPos to ((item 1 of geometric bounds of parent of parent of thisFile))
      set imageXPos2 to ((item 4 of geometric bounds of parent of parent of thisFile))
      set imageYPos2 to ((item 3 of geometric bounds of parent of parent of thisFile))
      set imageWidth to imageXPos2 - imageXPos
      set imageHeight to imageYPos2 - imageYPos
      set theName to name of thisFile
      set filePath to ((file path of thisFile))
      set theImgPath to quoted form of POSIX path of filePath
      set imageStatus to ""
      set imageStatus to do shell script ("/usr/bin/exiftool -xmp:Instructions -b " & theImgPath)
      if imageStatus = "" then
      set imageStatus to "Paper"
      end if
      set newBox to (make new rectangle of document 1 with properties {geometric bounds:{zeroY + imageYPos * theScale, zeroX + imageXPos * theScale, (zeroY + (imageYPos + imageHeight) * theScale), zeroX + (imageXPos + imageWidth) * theScale}, stroke weight:0.2, stroke color:"Black", fill color:imageStatus, active layer:StatusLayer})
      set opacity of blending settings of fill transparency settings of newBox to 60
      end repeat
      set the properties of layer StatusLayer of document 1 to {visible:false}
      end tell
    end createMiniature
    Changing the script to this gives me a blank result with no images
    on createMiniature()
      tell application "Adobe InDesign CS5"
      set user interaction level of script preferences to never interact
      --activate
      --set myLinks to every link of document 1
      -- Images from one layer only workaround --
      tell active document
      if exists layer "Images" then set layerImages to layer "Images"
      set grphicBoxs to all graphics of layerImages
      set myLinks to {}
      repeat with i in grphicBoxs
      set iLink to item link of i
      set pathLink to file path of iLink
      set end of myLinks to pathLink
      end repeat
      return myLinks
      end tell
      -- End Images from one layer only workaround --
      repeat with thisFile in myLinks
      set ruler origin of view preferences of document 1 to spread origin
      set zero point of document 1 to {0, 0}
      set zeroX to 0
      set zeroY to ((page height of document preferences of document 1) + 5)
      set pageHeight to ((page height of document preferences of document 1))
      set pageWidth to ((page width of document preferences of document 1))
      set maxHeight to 13
      set theScale to maxHeight / pageHeight
      set imageXPos to ((item 2 of geometric bounds of parent of parent of thisFile))
      set imageYPos to ((item 1 of geometric bounds of parent of parent of thisFile))
      set imageXPos2 to ((item 4 of geometric bounds of parent of parent of thisFile))
      set imageYPos2 to ((item 3 of geometric bounds of parent of parent of thisFile))
      set imageWidth to imageXPos2 - imageXPos
      set imageHeight to imageYPos2 - imageYPos
      set theName to name of thisFile
      set filePath to ((file path of thisFile))
      set theImgPath to quoted form of POSIX path of filePath
      set imageStatus to ""
      set imageStatus to do shell script ("/usr/bin/exiftool -xmp:Instructions -b " & theImgPath)
      if imageStatus = "" then
      set imageStatus to "Paper"
      end if
      set newBox to (make new rectangle of document 1 with properties {geometric bounds:{zeroY + imageYPos * theScale, zeroX + imageXPos * theScale, (zeroY + (imageYPos + imageHeight) * theScale), zeroX + (imageXPos + imageWidth) * theScale}, stroke weight:0.2, stroke color:"Black", fill color:imageStatus, active layer:StatusLayer})
      set opacity of blending settings of fill transparency settings of newBox to 60
      end repeat
      set the properties of layer StatusLayer of document 1 to {visible:false}
      end tell
    end createMiniature

  • Pass value from one layer to another.

    Hey,
    Is it possible to pass a value from one layer to another.
    I have a text that I'll get from layer 1 and I want to pass the value to a TextArea in layer 3.
    Is it possible, anyone?
    Thanks.

    I cannot be sure what you are calling a layer is what I know to be a layer--normally one does not go to layers, one goes to different frames.  If you look at the timeline, it consists of frames and possibly multiple layers.  Every layer has the same number of frames, and content in frame 1 of one layer is accessible by content in frame 1 of any other layer.  So if you have a textfield in layer 1, frame 1, and you have a textarea in frame 1, layer 2, you can use code to have the text in one of those assigned to the other.
    If you show a picture of what you are trying to describe it may help.

  • Passing variables from one swf to another

    I am facing problem to pass variable from one swf to another.
    I am using loadMovie to load another swf. how can I pass a variable
    value to another swf. Can anyone help me plz? It is somewhat
    urgent.
    thanx in advance.

    first of all:
    this is the Flash Media Server and your problem is not
    related to FMS....
    second thing related to the "somewhat urgent" :
    we, users on this forum, are not there to do your job... so
    calm down otherwise no people will answer your question. This forum
    is a free support forum that community of Flash developer use to
    learn tricks and to solve problems.
    Possibles solutions:
    If the two swf are seperate you can use LocalConnection to
    establish a connection between different swf.
    If you load a second swf into the first one you can interact
    like a standard movieClip(only if there from the same domain or if
    you a policy file on the other server)
    You can use SetVariable(via Javascript) to modify a root
    variable on the other swf and check with an _root.onEnterFrame to
    see if the variable had changed in the second swf.
    * MovieClipLoader will do a better job, in your specify case,
    than the loadMovie. Use the onLoadInit event to see when the swf is
    really totaly loaded into the first one otherwise you will have
    timing issues.
    My final answer(lol) is the solution 2 with the
    notice(*)

  • Passing variables from one jsp to another

    Hi All,
    I've searched thru the forum and can't find an answer to a prob I'm having, trying to pass a variable from one jsp to another.
    in file searchBar.jsp i have
    <%
    String archiveSearch = "off";
    %>
    and
    <%
    if (userUtils != null && userUtils.getSearch().equals("on"))
    %>
    <a href="/webLayout/webSideBar.jsp?searchState=<%=archiveSearch%>onclick="archiveSearch = "on""></a>
    and in file webSideBar.jsp
    <%
    String searchState = "off";
    String archiveSearch = (String)request.getParameter("searchState");
    %>
    basically it will give me a variable archiveSearch set to on in webSideBar when the user clicks on the search button, but as it is it's not passing the variable from the searchBar.jsp to the webSideBar.jsp and I think it looks ok !!!! but it's not
    Help

    Looks good to me as well.
    Couple of suggestions
    1 - view source on searchbar.jsp - see what the generated source code for that link is
    2 - Look at the url used to generate webSideBar.jsp. If its not in the address bar, right click the webSideBar page and choose properties.
    Check to see what parameter was passed.
    Are these pages in a frameset? Do you have to specify a target frame for your link?

  • Is it possible to copy groups/paths from one layer and paste to other multiple layers?

    Note Layer > Duplicate will not work in this regard, because I want to copy one group of paths/elements from one layer to other existing layers, not to a new layer.
    I have not found a command for this, nor have I found any scripts. Note I'm using CS3 but have been thinking about an upgrade.
    Thanks in advance.

    I actually use the Release to Layer (Sequence) function frequently to build my animated steps, for example when animating some text in a way that Premiere won't handle. This releases all the intermediary objects in a transition to new layers, but the background image still needs to be manually pasted into each newly created layer.
    I have read about "Paste to all Artboards," but that feature was not included in CS3. I believe it was released in CS5. Perhaps I need to get an upgrade. Thank you for your kind replies.
    I am a Mac-based CAD user going back to the mid-1990s, and it's interesting how many of the helpful, time-saving features we took for granted in those drawing programs are either not included in Illustrator products or are just being added in recent releases. I would still be using programs such as PowerDraw/PowerCADD if they hadn't gone out of business. Even with some of the expansion packs I've used, Illustrator doesn't hold a candle to PowerCADD.

Maybe you are looking for

  • How can I know the purchase date of my notebook?

    Hello guys I bought a Toshiba notebook from Extra Company @ Jeddah, Saudia Arabia & I want to know how can I know the Purchase Date Of it because I missed the payment bill & when I register my notebook Toshiba web site it asks me about the Purchase D

  • Error messages when syncing

    First I don't know if I have a nano or shuffle. Have just updated to itunes9 but am now getting error messages when syncing. Messages are -120 and -124. After I keep clicking to get out of them itunes then tells me that I need to restore and then tel

  • Swap utilization %

    Hi, I am running 2 database instances of Oracle 11g on Solaris 10 (SPARC T-5120). At the OS level it seems that the swap is not being used at all, but at the OEM, it shows the "Swap Utlization %" is about 80% bash-3.00$ swap -l swapfile dev swaplo bl

  • Message interface active in repository not selectable in directory

    Forgive me as aI know I have seen this answered somewhere I just can't find it again! I have a message interface in the repository that I cannot choose when creating a sender agrement. I know these have to be added to a list somewhere whn they come f

  • Sql hints in jpa

    How can i pass in sql hints to oracle database using ebj3 jpa? Any examples would be great. I can't find any example searching the web or this forum. I guess, using native query, might solve this problem, but any facility in ejb query language?