Function scope problem

Hi all,
I am using a class-based system for all my actionscript, but
am having trouble getting the following code to work properly, and
I am pretty certain it is a scope issue.
public function
setNavButtons(prevStart:Number,prevEnd:Number,nextStart:Number,nextEnd:Number){
var owner = this;
if (prevStart != undefined){
mcPropertiesNav.btnBack.onRelease = function():Void{
owner.reloadView(prevStart,prevEnd);
if (nextStart != undefined){
mcPropertiesNav.btnNext.onRelease = function():Void{
owner.reloadView(nextStart,NextEnd);
I've traced it out and know that when I use the reloadView
method, the prevStart and prevEnd parameters are being passed in as
undefined. Does anyone know how I would reference these variables
within the onRelease functions?
Thanks in advance
Robert

In the code you are posting a scope problem can't be
pinpointed. The arguments you are providing are local to the
function so there is no problem there. We might be able to help if
you post the complete class.

Similar Messages

  • Scope problem

    here is the function:
    public void readVector(File file)
    AddressBook addressBook = new AddressBook();
    try
    String string, token1 ="", token2 ="", token3 ="", token4 ="",
    token5 ="", token6 ="";
    FileInputStream fis1 = new FileInputStream(file);
    BufferedReader in = new BufferedReader(new FileReader(file));
    StringTokenizer st;
    while((string = in.readLine()) != null )
    st = new StringTokenizer(string);
    token1 = (st.hasMoreTokens())?st.nextToken():"";
    token2 = (st.hasMoreTokens())?st.nextToken():"";
    token3 = (st.hasMoreTokens())?st.nextToken():"";
    token4 = (st.hasMoreTokens())?st.nextToken():"";
    token5 = (st.hasMoreTokens())?st.nextToken():"";
    token6 = (st.hasMoreTokens())?st.nextToken():"";
    Contact c = new Contact(token1, token2, token3, token4, token5, token6);
    addressBook.addContact(c);
    catch(Exception ex)//catch exception and print stacktrace if try fails
    ex.printStackTrace();
    problem- some how I need to return the addresBook to another class, I can't do this because of a scope problem. Also if a solution is possible how would I call teh function in my other class.
    if this function returns an addressbook
    the prototype would be:
    AddressBook readVector(File file);
    how would I call this functino from another class to obtain the addressbok.

    I dont know what you mean by scope problem. Maybe you wanna elaborate on that a bit more. However, returning AddressBook should be straightforward. You can actually do it in two slightly different ways.
    1. You can define your readVector() method to be static:
    public static AddressBook readVector(whatever arguments) {
    ....your code here...
    Assuming you defined this method in class "foo", you can call this method using foo.readVector(arguments). In your calling function, you will probably have something like:
    AddressBook addressbk = foo.readVector(arguments);
    2. If you dont want to make your readVector() static, you will have to instantiate the class which contains this method. Again assuming class "foo" contains a definition like:
    public AddressBook readVector(args) {
    ....your code...
    In your calling method you will do the following:
    foo foo_obj = new foo();
    AddressBook addrbk = foo_obj.readVector(arguments);
    Of course, in either case your foo class has to be visible to the calling method. If your foo class is part of a different package, you will need to import it in the calling class.

  • Scop problem

    Hi ,
    I having a problem communicating with loaded swf inside main
    file.
    Im using that script to have a transition between external
    swf :
    http://www.kirupa.com/developer/mx2004/transitions.htm
    most of it working fine but im having problem communicating
    with variable:
    Stage.swf:
    The main movie start to play and on its last frame it has the
    following action:
    this._lockroot=true
    //loading the first movie after the animation finish
    _root.currMovie = "main";
    _root.MC_Container.loadMovie(_root.currMovie+".swf");
    stop();
    portfolio.swf
    Than I press on the portfolio button and I get another main
    portfolio swf that has external files loeaded as well.its dividing
    the portfolio into categories , each category loading external
    file.
    First frame:
    this._lockroot=true
    _root.currMovie = "portfolio_3d";
    _root.MC_Container.loadMovie("portfolio_3d.swf");
    midframe=10;
    stop();
    buttons :
    on (release) {
    if (_root.currMovie == undefined) {
    _root.currMovie = "portfolio_print";
    _root.MC_Container.loadMovie("portfolio_print.swf");
    } else if (_root.currMovie != "portfolio_print") {
    if (_root.MC_Container._currentframe >=
    _root.MC_Container.midframe) {
    _level.currMovie = "portfolio_print";
    _root.MC_Container.play();
    portfolio_3d.swf
    the external file that loaded into the portfolio file is for
    example : portfolio_3d.swf ,
    the first frame action:
    this._lockroot=true
    midframe=10;
    middle frame has a stop(); command
    the last frame loading the next after the current movie
    finish:
    _root.MC_Container.loadMovie(_root.currMovie+".swf")
    the problem is that in the portfolio page, when I click the
    sub categries(3d,print,etc) , I get always the same movie. It seems
    like the variable doesn’t see the movie in the lowest level.
    It seems like a scop problem
    my url :
    www.shaygaghe.co.il
    thanks for your time ,
    Shay Gaghe

    what is the script that you have on the buttons on the bottom
    of the page that are supposed to load the new content? I think it
    may have something to do with your lockroot.

  • Variable scope problem?

    I am not quite sure if this is a scope problem at all, but it looks like one....
    Here is the problem:
    I have a class in which I define a variable x as folowing:
    public class XX
    public var x:Integer;
    In my fx script file I give it a value:
    var t: XX {
    x: 10
    and it seems that it is initialized... however when I try to use the variable inside the class XX, it cannot be done.
    for example I what try to do is
    public var yy = YY {
    for (i in [1..x]){
    ...do something...
    and the cycle is executed only once!
    Is this due to my inexperience in javafx or it is a standard behavior?

    Is this due to my inexperience in javafx or it is a standard behavior? Both? :-)
    The classical way to compute a class variable from those initialized at construction time is to do that in an init (or postinit) block.
    It isn't really a problem of scope, rather of order of initialization.

  • Event function scope

    hi there, when I define an event function like:
    i = 2;
    sound = new Sound();
    sound.onComplete = function () {
    // event function scope
    what kinds of variables can it access within the event
    function?
    thanks,
    - moonrie

    all variables defined at the time the onComplete executes.
    the default scope will be the timeline unless you use the word
    "this" which will reference the sound instance.
    (but you need to define the onComplete() method because the
    sound class has no such method.) there is an onSoundComplete()
    method

  • JSF 2.0: View Scope Problem

    Hey,
    I 'm having trouble using the JSF 2.0 view scope. My application is a search page displaying some search parameters and a list of results. The search parameters are backed by a session scope bean, the results a backed by a request scoped bean and there is some kind of controller bean in request scope, too. Searching and displaying the results works fine.
    The second step was some kind of details page to display when clicking on one result element. I have another controller bean for this goal, but when pressing the link the requested action is not performed. I remembered similar problems I had in the past where I put the bean containing the result list into view scope.
    But after putting the results bean into view scope searching is not working anymore. You click the search button, the search action is performed. But after successfully storing the results a new results bean is instantiated. An empty one of course.
    Now I 'm not sure anymore if I understand the view scope: I have a single page, I search something and the results are displayed on the same page. I cannot believe that request scoped results work fine and view scoped results do not.
    Can anyone help me?
    Thanks,
    Stephan

    I found the problem and a solution :-) The missing piece of the puzzle was the id attribute for the form tag. After some debugging of the JSF JavaScript I found the solution.
    The JavaScript function response(request, context) is invoked to handle the server response. Inside this function the doUpdate(element, context) is invoked.
    The doUpdate() function is doing the modification of the DOM. The function doUpdate() is two times invoked for a response. The first time the html elements are updated.
    The second time the view state hidden field is updated or created but only under the following condition:
    Comment in the JavaScript source code of the jsf.js
    //Now set the view state from the server into the DOM
    //but only for the form that submitted the request.If the forms of the both side haven't the same id the form can't be found on the second page.
    In the following way it is working:
    page1.xhtml
    <h:form id="myform">
            <h:commandLink value="Go to page 2" action="page2">
                <f:ajax render="@all" execute="@all"/>
            </h:commandLink>
    </h:form>
    .....page2.xhtml
    <h:form id="myform">
                <h:commandLink value="Go to page 1" action="page1">
                    <f:ajax render="@all" execute="@all"/>
                </h:commandLink>
    </h:form>So always set an explicit id for each JSF tag.

  • A pesky callback/scope problem?

    Hello! I am having quite a time dealing with getting data passed around correctly and hope someone will be able to shed some light on the situation. Here is my setup... I have an AS3 project communicating with an FMSv4 which is in turn communicating with a remoting server. The mockup is like so - I am doing it from memory and not copy and paste so ignore any actual programming problems... it is the data scope issue I am trying to resolve :|
    // AS3
    var rsp:Responder = new Responder(r_success, r_failure);
    connection.call("fms_function", rsp);
    function r_success(obj:Object)
         trace("it worked "+ obj);
    function r_failure(obj:Object)
         trace("it failed");
    // FMS - main.asc - netconnection etc has been correctly defined.
    Client.prototype.fms_function = function()
         mygateway.call("remote_function", remoting_handler());
         function remoting_handler()
              this.onResult(data)
              {trace("result received");
                   return(data);          // ( 1 )
              this.onStatus(data)
                   trace("whoops");
    Okay, so that is the setup... as I said before please disregard possible errors in the syntax.. my code traces out correctly showing flow as expected and gets the data from the remoting server correctly. When the client calls the fms_function on the FMS it traces "it worked null", showing the data has not been returned through the method called in my main.asc. My problem is trying to get the data retrieved from the remoting server to return back through fms_function to the client function that called it, at point ( 1 ) above. I have nested it as above hoping the scope would resolve back to fms_function, however this fails. I have tried passing fms_function as a parameter into remoting_handler, but my attempts to pass remoting_handler(this) by reference, for example, failed. I have also tried not using a nested handler, but the data does not get returned through the fms_function method to the client. Using client.call and passing it back that way is not an option. How am I able to get the data from the remoting server to return to the client via fms_function? Any help would be appreciated. I have been trying for quite some time and have come up with a bunch of ways to not resolve my problem.

    That is a good question... the reason I am trying to avoid using Client.call() is because the client is doing a sequenced configuration routine comprised of nested calls to the fms. The success handler of each call will contain the next call item in the sequence and a failure or incorrect data will cancel the configuration sequence. Using Client.call() will force me to set up client-side methods for each step in the sequence and effectively destroy the nesting. Because of this, the best approach, I thought, was to get the FMS to just pass the data back through the client-side calling function... unless there is a better option?

  • Edge/jQuery Function Scope: need advice

    Hi all ...
    I'm having difficulty with my Adobe Edge Animate code finesse, and I could use some advice. I'm more of a coder than an Edge/Flash guy, so I'm having trouble understanding the scope of variables and where I can use variables and anonymous functions on the global scope.
    I wrote a Tic-Tac-Toe game in Edge Animate, and I'd like many of my functions to be scoped globally so that I can just call them on a click action and play back the timeline once the function returns a response.
    Here's a typical onclick action:
             thisSym = sym.getSymbol("b1");
             var thisWinner = checkChoice(1, thisSym);
              // problematic code
             if (thisWinner === 1) {
              sym.getSymbol("winBox").$("theText").html("X WINS!");
              sym.play(2500);
             } else if (thisWinner === 2) {
              sym.getSymbol("winBox").$("theText").html("O WINS!");
              sym.play(2500);
    Note that b1 is a square on the Tic-Tac-Toe grid and checkChoice is a function I wrote in Full Code view to handle checking whether the clicked box returns a winner.
    Currently, when I return a winner (1 for "X", 2 for "O") you'll note that I can go to a specific area on the timeline, dynamically update the text to say "X Wins" or "O Wins" depending on whomever wins, and then sym.play(2500) to go to the main timeline.
    Here's the problem: I want to abstract the portion of this click action that comes after my comment //problematic code. What's stopping me? The ability to control the stage timeline from outside of the stage scope in the code. I can *do* all the logic and get console.log to print whatever I want, but I can't get the stage to move to 2500.
    Any thoughts or advice? A good article on using custom functions in Edge Animate would be extremely helpful.
    Thanks!
    William

    Joel,
    Thanks again for your help. This is the full code as I wrote the Edge Animate Tic-Tac-Toe game (direct ZIP link):
    http://scriptingmedia.org/wp-content/uploads/2014/09/aea-tictactoe.zip
    The game absolutely works, but it works without playing by Edge's variable scope rules. How would you rewrite the global code to conform to Edge Animate? When I try to put any of this code in creationComplete or compositionReady the code fails completely.
    If you look at "Full Code" you'll see the global variables to control gameplay (including the functions to check for winners and to toggle choices, still reporting to console.log). The gameBoard array values are removed as a board piece is picked. xChoices and oChoices store these, and the array is compared against the winners. The code works well but I feel as though implementing this in Edge could be a bit easier.
    //wm
    var xChoices = [];
    var oChoices = [];
    var gameBoard = [0,1,2,3,4,5,6,7,8];
    var winners = [
      [0,1,2],[3,4,5],[6,7,8],
      [0,3,6],[1,4,7],[2,5,8],
      [0,4,8],[2,4,6]
    var turn = 0; //turn placeholder, manipulated by modulo
    var youWin;
    var checkChoice = function (theValue) {
             var thisChoice = $.inArray(theValue, gameBoard);
             console.log("Checking: " + theValue + " against " + thisChoice + " in " + gameBoard);
      console.log("Turn #: " + turn);
             if (thisChoice > -1) {
      if (turn % 2 === 0) {
      xChoices.push(theValue);
      xChoices.sort();
      console.log(theValue + " X " + turn + " xChoices " + xChoices);
      thisSym.play(1000);
      } else if (turn % 2 === 1) {
      oChoices.push(theValue);
      oChoices.sort();
      console.log(theValue + " O " + turn + " oChoices " + oChoices);
      thisSym.play(2000);
      } else {
      console.log(turn);
      gameBoard.splice(thisChoice, 1);
      if (turn > 3) {
      if (turn % 2 === 0) {
      var theWinner = checkWinners(xChoices, winners);
      } else if (turn % 2 === 1) {
      var theWinner = checkWinners(oChoices, winners);
      turn++;
      return theWinner;
    var checkWinners = function (arrA, arrB) {
      var counter = 0;
      if (turn > 8 ) {
      console.log("It's a tie!");
      } else {
      console.log("Checking for win...");
      for (var i = 0; i < arrB.length; i++) {
      for (var j = 0; j < arrB[i].length; j++) {
      for (var k = 0; k < arrA.length; k++) {
      if ($.inArray(arrA[k], arrB[i]) > -1) {
      if (arrA[k] === arrB[i][j]) {
      counter++;
      console.log(arrA[k] + " " + arrB[i] + " " + counter);
      if (turn % 2 === 0 && counter > 2) {
      console.log("X WINS");
      return 1;
      } else if (turn % 2 === 1 && counter > 2) {
      console.log("O WINS");
      return 2;
      counter = 0;

  • Datatable: reuqest scope problem

    Hi everyone
    Im using A textfield where the user can input a searchstring. After he submits, a datatable is shown (dynamically generated) with the search results.
    My problem is, after the user submits, the request bean is set to null again, so if i want to get the next page (paging function) also the datatable object in the bean is null again and thus cannot get the next rows.
    I know i can avoid this problem by setting the bean scope to session, but actually im looking for a better solution. Can anyone help me? Im using JSF RI.
    Thanks for your help.

    One way of doing it is answered by BalusC
    Another way of doing it is by using *<a4j:keepAlive>* tag. For more information regarding this tag please visit the following web site :
    [http://livedemo.exadel.com/richfaces-demo/richfaces/keepAlive.jsf?c=keepAlive|http://livedemo.exadel.com/richfaces-demo/richfaces/keepAlive.jsf?c=keepAlive]

  • [SOLVED] Function Keys Problem On Dell Inspiron N5010

    Yesterday I bought a new laptop (Dell Inspiron N5010) and immediately installed Arch Linux on it. But when I launched the installation framework, I needed to use fdisk to partition my drive manually and to open another tty, ctrl + alt + f2 or up to f7, none of them worked. When I use f4 or f5 for example, it changes the brightness of the screen cause these keys have icons on them which represent the brightness control. So I quitted, took care of that fdisk issue and got back, installed Arch Linux successfully. When launched in GNOME 3, nothing was changed. It still uses f1, f2, ... and so on as "just function keys" without using "Fn" key. It's fine somehow cause my system automatically detected those keys, I can use every single function of my keyboard. But without using Fn key, I can't actually use any fx key for my own use. For example, I can't use Tilda anymore cause when I use only f1, it tries to open monitor control stuff.
    So... any ideas?
    Edit: It seems that this problem is all about Arch Linux. A friend of mine has the same laptop and he has just tried Mint Debian RC and function keys worked properly. So, there's a problem and it seems it's related to Arch Linux (or maybe Xorg version, somehow?).
    Last edited by Jeaquares (2011-05-18 13:07:06)

    xdunlapx wrote:The function key on my dell laptop was set to the F keys, meaning you have to hit the function key and then an F key to activate the F key. I switched it in the bios so I don't have to hit the function key to activate the F keys. So I would have had to hit Fn+Ctrl-Alt-F1 for example to get to TTY 1. Now since i switched it off in the bios All I have to do is hit Ctrl-Alt-F1 to get to the terminal. But in order to turn off wifi from the F key (for example) I have to hit Fn+F2. It's switched.
    I can't tell you how this was helpful. I've never noticed that there was an option in BIOS's Advanced menu for this. I updated it as "Function Key" and it solved my problem, thanks.

  • Remote Function Module problem

    Hi Experts,
    I have written a Se38 progarm to execute a remote function module, so as to send some data out of the system. The receiving system is an XI system. Pls see below the code and the load at the XI end, I donno why and what mistake am I doing in the se38 program part, as a result of which, only part of the data is getting send to XI.
    REPORT ZRFC_ADAPTER.
    Data: it_final1 type standard table of zrfc_str with header line .
    it_final1-NAME = 'ARNAB'.
    it_final1-ADDRESS = 'ADDRESS'.
    it_final1-EMAIL = 'EMAIL'.
    it_final1-ID = 'ID'.
    CALL FUNCTION 'ZRFC_XI'
    IN BACKGROUND TASK DESTINATION
    'R32XIRFC'
    EXPORTING
    username = sy-uname
    tables
    it_final = it_final1 .
    break-point.
    COMMIT WORK.
    Clear it_final1.
    I have seen in debugging mode, after removing the "
    IN BACKGROUND TASK DESTINATION
    'R32XIRFC'", that the internal table " it_final1 " is working fine......
    The structure used in remote Function Module is
    IT_FINAL LIKE ZRFC_STR -- in tables parameter. and the structure of ZRFC_STR is as follows!
    NAME ZNAME CHAR 14
    ADDRESS ZADDRESS CHAR 40
    TELEPHONE ZTEL CHAR 20
    EMAIL ZEMAIL CHAR 40
    ID ZID CHAR 10
    Note that , apart from a COMMIT WORK statement, there is no other coding done in the SOURCE CODE part of the remote Function Module.
    The load in XI is showing as
    <?xml version="1.0" encoding="UTF-8" ?>
    <rfc:ZRFC_XI xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    <USERNAME>RETAILDEV</USERNAME>
    <IT_FINAL>
    <item>
    <NAME>ARNAB</NAME>
    <ADDRESS>EMAIL</ADDRESS>
    <EMAIL />
    <ID />
    </item>
    </IT_FINAL>
    </rfc:ZRFC_XI>
    Note that EMAIL is actually a content of field EMAIL and not ADDRESS. But I donno why, it is behaving like this,,
    Pls note, this RFC has been imported completely in integration repository of XI, so we dont have to worry about any settings change or activities, left pending in XI.
    I am very sure, something is missing in the se38 code, pls suggest!!
    Regards,
    Arnab .

    Hi Arnab,
    I am having really doubt that there is problem in field mapping.
    COuld you please check the following.
    In the FM structure contains 5 fields as follows,
    NAME ZNAME CHAR 14
    ADDRESS ZADDRESS CHAR 40
    TELEPHONE ZTEL CHAR 20
    EMAIL ZEMAIL CHAR 40
    ID ZID CHAR 10
    In the Internal Table it has got 4 fields. Check the Mapping properly
    and data on each field.
    t_final1-NAME = 'ARNAB'.
    it_final1-ADDRESS = 'ADDRESS'.
    it_final1-EMAIL = 'EMAIL'.
    it_final1-ID = 'ID'.
    Thanks & Regards,
    Nagaraj Kalbavi

  • Decode function issue / problem ..

    Dear Sir / Madam,
    Thanks for your understanding.
    Right now I am facing a unique problem.
    I am using decode function in a select statement. The columns are dynamic some columns are of type number and some are varchar datatypes. I want to apply decode function for every column irrespective of datatype.
    What i am finding difficult is if the column is a number datatype , the decode funciton is working good but if the column datatype is varchar or char datatype then i am getting ..the error ..
    report error:
    ORA-01722: invalid number
    here's the decode function..
    decode (CHAI.EVNDRIVE,
    -800000000000000,'.A',
    -700000000000000, '.B',
    -600000000000000 ,'.C',
    -500000000000000 , '.D',
    -400000000000000 , '.E',
    -300000000000000 , '.F',
    -200000000000000, '.G',
    -100000000000000 , '.H',
    -1000000000, '.R' ,CHAI.EVNDRIVE ) EVNDRIVE
    how to use the above decode function irrespective of datatype..
    pls let me know how to over come this kind of scenario.
    is their a way to find whether the column datatype is number or char , so that i can check the column datatype before the decode funciton is applied ..
    thanks ..
    kumar

    You can try ,
    This is a "cheap and dirty" solution,
    but it should work (if CHAI.EVNDRIVE is varchar2):
    decode (CHAI.EVNDRIVE,
    '-800000000000000','.A',
    '-700000000000000', '.B',
    '-600000000000000' ,'.C',
    '-500000000000000' , '.D',
    '-400000000000000' , '.E',
    '-300000000000000' , '.F',
    '-200000000000000', '.G',
    '-100000000000000' , '.H',
    '-1000000000', '.R' ,CHAI.EVNDRIVE ) EVNDRIVELev

  • Having Truble Reading and Echoing Using PHP in HTML. Possible Variable Scope Problem?

    Hey guys,
       Thanks for your always knowledgable help! Today I am working with displaying text from a text file in an HTML table using PHP. I can't get the data to display properly, I think it has something to do with the scope of the variables, but I am not sure. Here is the code I am struggeling with:
    <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 array $price is filled properly (I tested by echoing each bit line by line) but by the time we get into the HTML it seems the array is empty or it is not liking how I am calling it. Does the scope of a PHP variable end with the closing "?>" tag? Am I missing something? Bellow 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 test server here: christianstest.info/phptest/readwritetesting/readtest.php
    thanks guys!

    MurraySummers wrote:
    Try changing this -
    fclose($menu);
    to this -
    fclose($menu);
    echo "<pre>";exit(print_r($price));
    and see what you get.
    Wow, what a great little peice of testing code, thanks! That showed me the problem right away! Is there any way to test your php line by line in Dreamweaver CS6? I am used to computer programing in Visual Studio and Eclipse where they have an option of running code line by line and seing how variables populate and change with each line of code execution. Or is thier a program that can do this for PHP?

  • Beans scope problem

    Hi
    I have a bean that stores the name of the user after they have logged in. It is supposed to be in session scope
    <jsp:useBean id="userInfo" class="beans.UserInfo" scope="session"/>But it appears to have been placed in application scope. It doesn't timeout and all subsequent users appear to be logged on as the first user. This is not good.
    Any suggestions? I'll post the code once I've made a minimal version of the problem.
    Thanks
    Richard

    Here's the code
    the bean: UserInfo.class
    package beans;
    public class UserInfo implements java.io.Serializable  {
      private static boolean loggedIn=false;
      private static String user="";
      public UserInfo() { }
      public static void setLoggedIn(boolean b){loggedIn=b;}
      public static void setUser(String b){user=b;}
      public static boolean isLoggedIn(){return loggedIn;}
      public static String getUser(){return user;}
    }main jsp page test.jsp
    <jsp:useBean id="userInfo" class="beans.UserInfo" scope="session"/>
    <jsp:include page="header.jsp" flush="true">
       <jsp:param name="title" value="Test" />
    </jsp:include>
    <%
      boolean login=Boolean.valueOf(request.getParameter("login")).booleanValue();
      if(login){
          userInfo.setLoggedIn(true);
          userInfo.setUser("strUsr");
    %> 
    <p><b>mainpage says</b>
    <%if (userInfo.isLoggedIn()) {%> <%=userInfo.getUser()%> logged in
             <%}else {%>not logged in
                <%}%>
    </body>
    </html>The included file header.jsp
    <jsp:useBean id="userInfo" class="beans.UserInfo" scope="session"/>
    <html>
    <head>
    <title><%=request.getParameter("title")%></title>
    </head>
    <body>
    <p><b>header says</b>
    <%if (userInfo.isLoggedIn()) {%> <%=userInfo.getUser()%> logged in
             <%}else {%>not logged in
                <%}%>load test.jsp?login=true in a browser
    load test.jsp in another browser - should not appear logged in - but does at least with my system (tomcat 5.5.9 on windows xp)
    Any suggestions,
    Richard

  • IE 6 & 7 display problem (perhaps function swap problem?)

    Hi,
    I'm hoping someone can help me with this as I have scanned blog after blog and forum after forum to no avail.
    I have the job of cleaning up another developer's code which does not display properly. The problem is that all is well in the world (or on this web site) except for pages that use function swap(). These pages do not display properly in IE 6 and IE7. They do display properly in IE 8, Firefox and Safari. The other pages of the site display fine in all browsers.
    The header displays and then the rest of the page is displaced off to the right rather than below the header as if it is flowing out of the container somehow.
    This is one of the pages that does not display properly in IE6 and IE7. Any help with this would be greatly appreciated.
    http://traciisaly.com/work.html

    You have some invalid code there that may be causing it.
    With your chosen doctype, you must close paragraph elements with </p> - and do not include paragraphs within paragraphs (line 99, for instance) or tables within paragraphs (twice on your page).
    In main.css, body{}, delete zoom: 1 ;
    And in .footer{}, change
    border: 0 px;
    to
    border: 0px;
    And in .header{} add height: 46px;
    I think that'll get you in the ballpark.
    Mark A. Boyd
    Keep-On-Learnin' :-)
    This message was processed and edited by Jive.
    It shall not be considered an accurate representation of my words.
    It might not even have been intended as a reply to your message.

Maybe you are looking for

  • Workarounds in Numbers 3.0?

    Dear Fellow Numbers 3.0 Users, In Numbers 3.0, some features have been lost that were in Numbers 2.3. However,  I have seen some creative ideas in this forum for ways to work around the loss of features yet maintaining the functionality. Example 1: h

  • IPod Classic - AutoSync stops copying music midway, but does not freeze.

    I have a brand new 160 GB Classic. When I connect it to my Powerbook, it begins the normal process of auto-syncing my library. I have a total of just over 5000 songs; When it gets to about 3200, it stops, and says Sync is complete. I press "Sync" aga

  • Service working fine in Gateway but not in browser

    Hi All, I have a gateway service which is working fine in Development system but after transporting to Quality system, it is not working on browser. It is running perfectly in Quality gateway system but on browser it's throwing error:             Mod

  • Material Ledger - Not Distributed when use MR22

    Dear All I do follow step and i have a problem which need your help 1. Create a Mew Materail, price determination: 3 - Single/Multi level 2. GR with Mvt 561. 3. Using MR22 to update valuae for that material. 4. Run CKMLCP --> I have 2 question 1. Whe

  • I create simple session bean in jdeveloper and it has a problem in lookup

    the code of bean import java.util.*; import javax.naming.Context; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; import javax.naming.*; public class CartClient { public static void main(String[] args) { try { Context initi