scope of variables?

I'm looking for any discussion on the scope of variables in Captivate. I searched these forums and the help site but have not come up with something useful.

According to the information I have encountered so far, it seems that Captivate has no local variables, which means that no matter what variable I declare will be global in this project.

Is this correct?

Thank you

Pete

Indeed, object names must be unique.

Tags: Adobe Captivate

Similar Questions

  • Features and scope of variables

    I use this code:

    var getdata:LoadVars = new LoadVars();

    GetData.Load ("datatoflash.php");
    getdata.onLoad = function() {}
    var graphData:Array = new Array (this.rating1, this.rating2, this.rating3, this.rating4, this.rating5);
    };
    trace (graphData)

    I understand the scope of variables. But I want to check something, I learned. When the trace is made, there the Guthrie listed as indefinite. This is because it has been declared within the function. Is it all still get the function table and use them on the other where, in my film? Even if the Board is filled inside the function?

    The track is called before the onLoad never happen as it takes time for a file to load. If you did not ensure that the data is loaded to a party outside the onLoad, so this isn't a good idea to use it. In order to demonstrate that he is working, have:

    Stop();
    var getdata:LoadVars = new LoadVars();
    getdata.onLoad = function() {}
    graphData = new Array (this.rating1, this.rating2, this.rating3, this.rating4, this.rating5);
    nextFrame();
    }

    And on the next framework: trace (graphData);

  • Scope of variables: Application.cfm vs Application.cfc - very confusing

    Hi all

    ColdFusion newbie here, please bear with me :)

    I am currently responsible for the upgrade of a huge project of ColdFusion 5 (more than 1,000 pages of CF) for ColdFusion 8, I tried to refactor old code in CFCS, but ran into a problem with the scope of variables, or lack thereof.

    In the old application, there is a single Application.cfm in which a bunch of global variables are defined, without scope, as:
    < CFSCRIPT >
    ...
    PrimaryDataSource = 'TestDB '.
    ...
    < / CFSCRIPT >

    It seems that variables defined as this can be viewed very well in all CFM pages using #PrimaryDataSource #, but not in one of my new pages of CFCS.

    What should I do for that these variables global scopeless available for CFCS? Also, what actually means if global variables are defined without any scope?

    I'm really new to ColdFusion, so I would be very grateful if someone could throw a light here!
    Thanks in advance.

    Billy

    n3p3nth3 wrote:
    > Hi all,
    >
    > ColdFusion newbie here, please bear with me :)
    >
    > I am currently responsible for the upgrade of a huge project of ColdFusion 5 (more than 1000 CF
    (> pages) for ColdFusion 8, I tried to refactor old code in CFCS, but
    > ran into a problem with the scope of variables, or lack thereof.
    >
    > There an Application.cfm in the old application, where a bunch of global
    > variables are defined, without scope, such as:
    >
    > ...
    > PrimaryDataSource = "TestDB".
    > ...
    >

    >
    > It seems that variables defined as this is accessible very well in all the CFM
    > pages using #PrimaryDataSource #, but not in one of my new CFC pages.
    >
    > What should I do for that these variables global scopeless available in the
    > SWC? In addition, which actually means if global variables are set
    > without any scope?
    >
    > I'm really new to ColdFusion, so I would be very grateful if someone could throw a
    > turn on here!
    > Thanks in advance.
    >
    > Billy
    >

    They are not global variables. Local variables in the variables
    scope. On one of your current pages, PrimaryDataSource would be the same
    as variables. PrimaryDataSource.

    How it works currently, is that Application.cfm is an automatic
    included file. That is, for every single request, this file is
    automatically included at the beginning of the request and all these
    local variables are defined and exist only for the duration of this request.

    When you start to refactor the code in the CFC, you'll have to
    get a better handle on how to deal with these types of broad application
    variables. There are a few choices.

    One, you can create them as truly global variables is in the
    application or session brought rather than local and temporary variables
    scope. You use depends on whether the value of a variable is the
    even for all users [app] or may be unique to each user [session].

    Second, you can set these variables within CFC itself as one
    variable local "variables" scope inside the CFC. These variables will be
    live as long as an instance of the CFC lives. So if the CFC
    has persisted in session or application scope, then the data of "variables".
    inside she will persist.

    It is a great subject and a response email will not cover
    all the ins and outs of it. You are looking at a huge task and will want to
    to do a lot of reading. I suggest starting with the ColdFusion
    documentation. It has good chapters that cover all these details
    about the various scopes of variables and other chapters which cover
    Components. After ColdFusion documentation, there are now three
    volume "ColdFusion Web Application Construction Kit" by Ben Forta et al.
    Finally, there is a vast internet blogs, discussion lists and
    Tutorials that cover all these topics in lower and more details.

  • Difference of scope of variables

    Hello
    I do business with global variables and noticed this statement in it (from Zerathul post):
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
     
    Package created.
     
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * v_statevar;
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    v_statevar is global, but what is the difference when declare us in spec package no body, I know sound world as well
    but is the different scope or what?
    SQL> create or replace package mypkg is
    v_statevar number := 5; -- this means my package has a state <<-- here now
      2    procedure myproc;
      3  end mypkg;
      4  / 
     
    Package created.
     
    SQL>
    SQL> create or replace package body mypkg is
      2    
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * v_statevar;
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    Concerning
    GregG

    GregG says:
    v_statevar is global, but what is the difference when declare us in spec package no body, I know sound world as well
    but is the different scope or what?

    Things that are in the package body, but not in package specifications are available only for the code in the package body.

    Things which are in the specifications of the package are available to be used by anyone who has privileges on this package (eg. other packages in the same pattern, with users execute privs on this package).

    Indeed, it is a Global Private vs Public Global variable.

  • Scope of variables in the package or interface level

    Hello

    Can we define the scope of the ODI project at the level of the interface or package variables
    because in my project im using a last refresh rundate variable will change the value of the variable at the time of execution of each package.

    Thanxs
    Malezieux

    You can create it as 'No persistent' and then its value exist by session ODI.

    In this way, several sessions may keep an independent value to the same variable.

  • The strangeness of the scope of variables?

    I'm having a problem with a script component, and I think it might be a bug.  I reproduced the problem with this simplified version:

    If {(true)
    int Packers = 1;
    {
    Packers = 5;
    patExecContext.setProcessDataIntValue ("/ process_data/@nTest", Packers);
    }
    }

    I think that my variable Packers of process should be out in the 5, but I get 1. The same problem occurs with ropes.

    Can someone reproduce cela and let me know if I'm losing my mind here?  Thank you.

    Jared

    Hi Jared,

    I can reproduce the behavior so that your mind is ok.

    The custom Script is a BeanShell implementation and on the top of my head I don't know what version of BeanShell is. Apparently the scope has changed in BeanShell (see http://www.beanshell.org/manual/syntax.html).

    This works...

    Boolean test = true;

    Packers int;

    If {(test)

    Packers = 1;

    {

    Packers = 5;

    patExecContext.setProcessDataIntValue ("/ process_data/@nTest", Packers);

    }

    }

    Steve

  • Problem of the scope of variables

    I'm having trouble understanding variable scope in the following situation. See dynamically, go to my site and click on Librio. Then click on the first book of the left (the years-down).

    The code reads an XML file that includes a summary of the book, and also the comments it received. For each review, a circle appears. These buttons are created dynamically. I'm moving the XML node that is appropriate to the function onRelease, but nothing helped. Any idea? (The code below has commented)

    Thank you for answer and locate me the area that failed. Your solution was not well resolve the issue. The variable 'i' was long forgotten. Given that I named the buttons with a number at the end, this is recover the index I want. Knowing that the beginning of the name is still the same and there will be no more than 9 clients as possible, it is easy to retrieve information about an order of substr. The number is located on the index '9' and is a length of characters:

  • question about the scope of variables and memory

    I searched the Adobe documentation for an overview, but apparently, I'm not in the right place.

    Here is an example of simplified code:

    < AS >

    loadedImages:Array = new Array();

    function createImageData(imageNumber:Number):void
    {
    var imageData:BitmapData = new BitmapData (width, height);

    Switch (imageNumber)
    {
    case 1:
    imageData.draw (loader1.content);
    loadedImages [imageNumber] = imageData;
    break;

    case 2:
    imageData.draw (loader2.content);
    loadedImages [imageNumber] = imageData;
    break;
    }
    }

    < virtue >

    ImageData defined inside the function createImageData(), I know that I can not access any outside level of the function block.  But what about memory?  ImageData still exist once the code has "left" the createImageData() function?

    For example, if the function above is called twice (once with imageNumber = 1, once with imageNumber = 2), what I remember?

    -BitmapData objects stored in loadedImages [1] and loadedImages [2] and 1 BitmapData object named imageData

    -BitmapData objects stored in loadedImages [1] and loadedImages [2] and 2 BitmapData named imageData objects

    -BitmapData objects stored in loadedImages [1] and loadedImages [2] and nothing else

    Is there a way to see the 'elements' in memory, not just the quantity?

    If you call twice createImageData, for imageNumber = 1 and imageNumber = 2, there will be only 2 persistent objects to the Bitmap in memory, and they will be made by the loadedImages table. The imageData variable is just the first to receive the pointer to the allocated memory and past him on the elements of the array until it's life is over. Only when you delete the table, you will release the objects for the GC.

  • Legacy, causing loss of the scope of variables?

    Hi all

    I am working on a class right now, "Block" that has several private variables (call)
    _Color,
    _x,
    FLF,
    _parent...

    I have a second class (BlockGenerator range block). In the constructor for BlockGenerator, I call the block using super (parent, x, y) and then I put some of the reactive power inherited from the block class. I'm trying to compile in strict mode, but it is causing the following error message:

    1119: access of the property possibly _color not defined through a reference with static type src.game:BlockGenerator.

    the error is reported on the following line in the BlockGenerator constructor:
    This ._color = new BlockColor (BlockColor.PLACE_HOLDER);

    I've attached some more sample code. Please let me know if anyone has an insight as to why my class BlockGenerator cannot see inside vars inherited from the Block class.

    Thank you
    Nomadic design

    Sometimes you get so wrapped up in the complexity of what you are doing that ignore you completely what is obvious.

    Thank you
    Nomadic design

  • Problems with the scope of variables or reference (AS2)

    Hello!

    The code simple below maps onRelease functions to 8 buttons.
    The goal is to load the image into a single central imagePanel whenever a button is clicked.

    There are 8 instances of the same MC on the stage (called g0 to g7), each containing a button (btnShow)

    The function 'downloadImage()' load the image when the onRelease event is triggered.
    Each image file path is taken from the _global.paintings Array (the url property).

    The problem:
    It looks like this, during the transfer, a link for the "removal" of the 'I' variable, instead of its VALUE.
    So, at runtime, the 'I' is equal to 8 (value at the end of the loop for EACH function of downloadImage), instead of the value incremented (0 to 7)...

    Leading to each button of the same image, rather than the corresponding image loading (end of the url in _global.paintings property [0] to [7])

    Well, not easy to explain properly, I hope you understand what I mean...

    Thank you very much for your help, I am quite lost here!
    See you soon
    Luca


    =======

    Try this:

    function formatGal() {}

    for (var i: Number = 0; i<8; i++)="">
    . _root ["g" + i] btnShow.myIndex = i;
    _root ["g" + i].btnShow.onRelease = function() {}
    downloadImage (_global.paintings [this.myIndex] .url);
    trace (this.myIndex);
    }
    }
    }

    --
    Dave-
    Developer leader
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.Adobe.com/communities/experts/

  • Scope with Variables

    Just a very basic question I have yet to go through all the stuff contained in the manuals, but not JavaScript have such a thing? IM eager to start to try to convert some of my AppleScript JavaScript scripts as a learning exercise and have not encountered anything yet. Also while Im here is the underscore character '_' special to the Script to expand? I used this character in the function names when using AppleScript JavaScript scripts without problem but the Script to extend the red mark as if he won't. TVM

    As far as I know, the underscrore is a valid character and should have no problem in a Mark function name. I gave it a try in various functions to the breast and prefixing with no problems.

  • question of the scope of variables

    Hi guys,.

    Select book_key
    books
    where exists (select book_key from the sale)

    If we have the above query, it means that the book_key in sales is independent of the book_key in the books? As far as I see it, all what we are doing is saying that if a book_key exists in the table sales, then we want to return the books book_key. In other words, the book_key of books doesn't have to exist in sales.

    It seems completely different from

    Select book_key
    books
    where book_key in (select book_key from the sale)

    because in this case, we want to only return the books book_key, if it exists also in sales.

    Am I wrong?

    Thank you

    OracleGuy777 wrote:
    Hi guys,.

    Select book_key
    books
    where exists (select book_key from the sale)

    If we have the above query, it means that the book_key in sales is independent of the book_key in the books? As far as I see it, all what we are doing is saying that if a book_key exists in the table sales, then we want to return the books book_key. In other words, the book_key of books doesn't have to exist in sales.

    You're right, except that it is saying "If * a * line exists in the sales table": book_key may be NULL for each line in the sale, and the main query will always return each book_key books.

    EXISTS subqueries are almost always correllated to the main request.
    The following Gets the same results as the query you posted using IN:

    SELECT  book_key
    FROM    books  m   -- m for main
    WHERE   EXISTS ( SELECT  NULL   -- The column "selected" makes absolutely no difference
                     FROM    sales
                     WHERE   book_key = m.book_key
                   );
    
  • Seen Truble reading and echoing using PHP in HTML. Variable scope problem possible?

    Hey guys,.

    Thanks for your help always well informed! Today, I work with the text to a text file in a table HTML with PHP. I can't get the data to display correctly, I think it has something to do with the scope of variables, but I'm not sure. Here's the code I'm struggeling with that:

    <table width="357" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td width="165">Pizza 1</td>
        <td width="186"><? echo  $price['0']; ?></td>
      </tr>
      <tr>
        <td>Burger 1</td>
        <td><? echo $price['1']; ?></td>
      </tr>
      <tr>
        <td>Drink 1</td>
        <td><? echo $price['2']; ?></td>
      </tr>
    </table>
    

    In the above PHP (not shown), the $price array is properly filled (I tested in echoing every bit line-by-line), but at the moment where we enter the HTML code, it seems that the table is empty or is not love how I am the appellant. Made in the scope of a PHP variable with the closing end '? ">" tag? Am I missing something? Below is the full code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    body {
        background-color: #333;
        color: #FFF;
    }
    </style>
    </head>
    
    <body>
    <?php
    $menu=fopen("prices.txt","r") or exit("Unable to open file!");
    $price=array();
    $priceposition=null;
    $tempstring;
    
    //This loop does all of the READING and populating of variables
    while(!feof($menu))
      {
        //Check to see if this is the first pass, if not add one to the array possition
        if ($priceposition==null){
            $priceposition=0;
            }
        else{ 
        $priceposition++;
        }
        
        //populate the temparary string
        $tempstring = fgets($menu);
        
        //Populate the array if the temporary string is not a comment
        if(substr($tempstring,0,2) != "//"){
            $price['$priceposition']= $tempstring;
            echo $price['$priceposition'];
        }
      }
      //End of reading loop
      
      
    fclose($menu);
    ?>
    <table width="357" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td width="165">Pizza 1</td>
        <td width="186"><? echo  $price['0']; ?></td>
      </tr>
      <tr>
        <td>Burger 1</td>
        <td><? echo $price['1']; ?></td>
      </tr>
      <tr>
        <td>Drink 1</td>
        <td><? echo $price['2']; ?></td>
      </tr>
    </table>
    </body>
    </html>
    

    and you can run the code on my server to test here: christianstest.info/phptest/readwritetesting/readtest.php

    Thank you guys!

    Try to change this-

    fclose ($menu);

    on this subject.

    fclose ($menu);

    ECHO '.

    « ; exit(print_r($price)) ;

    et voir ce que vous obtenez.

  • Wearing "Scope Variables" to onError(). Is this Possible?

    I'm trying to access the scope of Variables (< cfdump var = "#variables #" >) inside the OnError() in Application.cfc for debugging and record the reasons. Something like this:

    < cffunction name = returnType "onError" = "Sub" output = "true" >
    < name cfargument = "exception" required = "true" >
    < cfdump var = "#variables #" >
    < / cffunction >

    With the good old Application.cfm and < cferror > I was able to access scope Variable, just like the URL or Session scope. But OnError() was a function, it seems, do not have access to the Variables scope. Is it possible to
    wearing scope variables to OnError(), when she triggered? Or is it completely not possible?

    Thanks in advance for your brain power!
    -Sam

    Well, it's kinda a structural change, but if you run your application via an onRequest() event handler, using, then the entire application runs within the scope of the memory of Application.cfc, so stuff of scope variable of your request will be in the same scope of variables as exposed to onError().

    --

    Adam

  • Variable scope

    I do my first foray in the AS and XML and am having a problem with the scope of variables.  What I'm trying to do is to create a global variable ("destinationURL", below) and assign a value to an XML file.

    The first trace() below returns "URL = [blank string"; the second trace() returns expected, a URL residing in the XML file.  Clearly, I have a kind of problem of framing.  How can I get the event handler to set the value of the variable global "destinationURL" so I can access it outside the event handler function?

    var xmlDoc:XML = new XML();
    var loader: URLLoader = new URLLoader();
    var req:URLRequest = new URLRequest ("urls.xml");
    var destinationURL:String = "";

    Loader.Load (req);

    loader.addEventListener (Event.COMPLETE, completeHandler);

    trace ("URL =" + destinationURL);

    function completeHandler(evt:Event):void {}
    xmlDoc = XML (evt.target.data);
    destinationURL=xmlDoc.url[0].@name;
    trace (destinationURL);
    }

    Thank you-

    DH

    I'll say it once more... it is immaterial that the trace is towards the end. It runs _avant_ the completeHandler runs. Do tests a bit... a trace("1"). and then a trace ("2"); in your onComplete... you will see 1 traces before 2.

    If you want to prevent your buttons to access the variable until the xml code is loaded, then don't add event listeners until it is loaded.

    Refer to the code I've shown - you can add listeners to button in the doMore() If you wanted to.

Maybe you are looking for