Drop scope problem

Hi there,
I'm making a quiz and am stuck with some drag and drop stuff.
I need to play a symbol when everything is dropped in the right place.
It need to get playing when everything is dropped on the multiple droppable area's, and not just one item.
This is my code.
yepnope({nope:['jquery-ui-1.10.3.custom.min.js'], complete: init});
function init(){
    sym.$('persfoto2').draggable({opacity:.5, revert:'invalid', scope:'publi'});
    sym.$('drukwerk').draggable({opacity:.5, revert:'invalid', scope:'publi'});
    sym.$('advertentie2').draggable({opacity:.5, revert:'invalid', scope:'publi'});
    sym.$('publiciteit_drop').droppable({
    scope:'publi',
    drop: function () {
    sym.getComposition().getStage().$('proberen').show(); }});
    sym.$('handjes').draggable({opacity:.5, revert:'invalid', scope:'office'});
    sym.$('scholen').draggable({opacity:.5, revert:'invalid', scope:'office'});
    sym.$('telefoon2').draggable({opacity:.5, revert:'invalid', scope:'office'});
    sym.$('planning').draggable({opacity:.5, revert:'invalid', scope:'office'});
    sym.$('office_drop').droppable(
    {scope:'office',
    drop: function() {
    sym.getComposition().getStage().$('proberen').show(); }});
I hope someone can help me out.
Thank you!

// using this line would make address shorter
objects = sym.getSymbol("opdracht_office")
// in this line we used shorter address
// we hide message symbol by code, its better and easier that turn it off
objects.$("message").hide();
// with this variable we can count dropped objects
x = 0;
yepnope({nope:['jquery-ui-1.10.3.custom.min.js'], complete: init});
function init(){
          objects.$('vervoer').draggable({opacity:.5, revert:'invalid', scope:'produ'});
          objects.$('hotel').draggable({opacity:.5, revert:'invalid', scope:'produ'});
          objects.$('budget').draggable({opacity:.5, revert:'invalid', scope:'produ'});
          objects.$('productie_drop').droppable(
          {scope:'produ'},
          {drop: function () {
          objects.getComposition().getStage().$('message').show(); }});
          objects.$('persfoto2').draggable({opacity:.5, revert:'invalid', scope:'publi'});
          objects.$('drukwerk').draggable({opacity:.5, revert:'invalid', scope:'publi'});
          objects.$('advertentie2').draggable({opacity:.5, revert:'invalid', scope:'publi'});
          objects.$('publiciteit_drop').droppable({
          scope:'publi'},
          {drop: function () {
          objects.getComposition().getStage().$('message').show(); }});
// its better to code clean
          // Office Draggable
          objects.$('handjes').draggable({
                                                                                                     opacity:.5,
                                                                                                     revert :'invalid',
                                                                                                     scope  :'office'
          objects.$('scholen').draggable({
                                                                                                     opacity:.5,
                                                                                                     revert :'invalid',
                                                                                                     scope  :'office'
          objects.$('telefoon2').draggable({
                                                                                                     opacity:.5,
                                                                                                     revert :'invalid',
                                                                                                     scope  :'office'
          objects.$('planning').draggable({
                                                                                                     opacity:.5,
                                                                                                     revert :'invalid',
                                                                                                     scope  :'office'
          // Office Dropable
          objects.$('office_drop').droppable({
                                                                                                                        scope:'office',
                                                                                                                        drop : dropHandler
          function dropHandler(event, ui){
    ui.draggable.draggable( 'disable' );
    x++;
    if ( x == 4){
                                                            objects.$('message').show()
                                                            $(this).droppable( 'disable' );
                                                   }//if
          }//function
}// init

Similar Messages

  • AirTunes with AirportExpress cut or drop out problems - my solution...

    I buyed 2 of the Airport Extreme one month ago (Firmware 6.3, Itunes 7.1.1), never got them working fine, till yesterday...
    I have A Zyxel ADSL WLAN Router Switch. WPA-PSK as I wanted a secure Network. Both of the AX were connected with static IPs. WLAN was always working fine, but I had many cut outs with airtunes. I wanted a solution with lossles streaming audio with the possibility to connect my Receiver digitally. That's why I bought my first Apple hardware, as I was always told, Apple=Plug'n play. Very frustrating!
    I tried other switches, Routers, WLAN adapters and cards, nothing worked. Airfoil does not support multiple speakers yet, so it's useless for me.
    In the FAQ of the Airtunes, Apple mentioned to use lower security, as some Computers probably do not have enough power to stream music flawlessly. But my Computers really do have enough power! I think the AX does not have enough power to do that. So I created another wireless network with one of my AX. I set the security to WEP-40bit key and joined this new Network with my other AX. Not the best solution, as I'm now connected to the Internet or to the AX to use Airtunes. Cables could fix that problem, but then I could use a wired system instead...
    I use Channel 11 for the AX WLAN (the only clean channel in my area), Multicast to 11, only G mode for Wireless and a 5 characters WEP-40 key and no WDS. Seems to work at the moment.
    I hope this will help others with the cut or drop out problem. If you have a working AirTunes system, please post your setup. Mostly I'm interested in a Setup with working WPA...

    Thanks, I hope I can help others with this annoying problem...
    Sorry, I forgot to write about the RF Interference. Belive me, I spent hours and hours searching for a solution in the Internet and every checkbox the Admin utility offered me to try out... I'm working as a system engineer, and supporting computer systems since the early 90ties, so I'd say I have a bit knowledge about all the networking, WLAN, Audio... In school we had the Apple Mac I with the 12" monochrome monitor and appletalk for networking quite funny!
    But back to the RF interference: At the moment I activated it on both AX I own. I have a microwave, wireless phone and I'm living in a Area with many WLAN access points. I can choose between 6 networks!
    I'm the only one with a network higher than channel 6, so this area is clean at least.
    As my AirTunes do work at the moment, I'm not going to try if I could also deactivate it.
    Next step is to try if I can connect the AX Router to the internet. A connection to my ADSL router should do that, but up to now I had very strange behavior when plugging in a ethernet cable to the AX. If this will work, it will be my final solution, at the moment I only see it as a workaround...

  • 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.

  • 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.

  • Sudden Dropped Frames Problem with 720p24 material

    After sailing along for months with perfect operation from Final Cut Pro, editing 720p24 (I'm still running 5.0.4), I have encountered a mysterious hangup that I can't seem to solve. It probably began shortly after I was doing a test on a new project and mistakenly used a 44khz sound file rather than a 48khz. That project ran fine for a couple of days as I played with it, then abruptly began to drop frames at very particular points. I trashed the sound file and reimported it as a 48khz file and that seemed to fix things for a day or two. Then, to my utter horror, when I opened a very large ongoing project that I needed to tweak, I found that the dropped file problem has corrupted my entire FCP operation. I have tried changing various settings, such as unlimited RT, and trashed the preferences as well, but none of the straightforward cures seems to make a difference. I've also looked at all the suggestions in the Apple dropped frames article at [docs.info.apple.com]. I have never had a problem with dropped frames prior to this.
    My scratch disk is a raided SATA drive with plenty of space to spare. This setup has worked flawlessly since July. I have jumped around over the past 10 days from work on old SD projects to 720p24 projects and have been changing settings here and there to accomodate this. Nothing else seems to have been changed that may account for the glitch.
    I have not reinstalled the software.
    Anything that comes to mind as a logical next step would be most appreciated!

    Yes during panning or zooming I can see that frames are dropping in the stats panel.
    I'm encoding at 500kbps video + 48 audio, outputting only one stream.
    The content in the input monitor shows exactly what the cam is seeing, with the pan and/or zoom correctly displayed. On the output monitor side the action will freeze momentarily when frames are dropped. Then the display will skip to the point where no more frames are being dropped.
    The native frame rate for the cam is 29.97, but as an output, averaging in the dropped frames the rate may drop as low as 27 or 28fps according to the stats panel. The difference being the number of dropped frames.
    FMLE is installed on a Dell Studio 15 with 4 GB RAM, which I would think would be plenty adequete.
    Thanks for your response.
    Adninjastrator

  • Drop Float Problem

    Can someone help me with a drop float problem I am having in
    the old version of internet explorer? Please see this website:
    http://003a17b.netsolhost.com/kwdwebsite/index.html
    The green navigation bar should be lined up with the green
    bar in the logo (at the top). IE 6.0 is dropping it down lower. Can
    anyone help resolve this issue? Thanks!

    [email protected] posted in macromedia.dreamweaver
    > Can someone help me with a drop float problem I am
    having in the
    > old version of internet explorer? Please see this
    website:
    >
    http://003a17b.netsolhost.com/kwdwebsite/index.html
    > The green navigation bar should be lined up with the
    green bar in
    > the logo (at
    > the top). IE 6.0 is dropping it down lower. Can anyone
    help
    > resolve this issue? Thanks!
    (My IE6 box finally went to pasture, so I'll look into
    installing
    multiple IEs on one of my boxes this week)
    I would concentrate on creating valid code before trying to
    deal with
    cross-browser compatibility. You'll often find that that is
    all it
    takes.
    Enter your URL here:
    http://validator.w3.org
    For instance, you have several redundant, illegal instances
    of
    <link href="css/KWD.css" rel="stylesheet"
    type="text/css">
    inside the body element.
    It looks as if that might be part of a library item? If so,
    take it
    out.
    Reply back if that doesn't do it for you.
    Sidenote:
    Your excessive use of META keywords may be considered Meta
    tag stuffing
    or spamdexing and may not be as useful as you hope. Likewise
    for the
    double META Description where the second seems excessive. No
    links to
    back it up at the moment, but you might want to look into it.
    Mark A. Boyd
    Keep-On-Learnin' :)

  • 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.

  • Time Capsule internet drop-out problem.... Solved (for now....?)

    I am new here, but i would like to share my experiences with a problem a lot of people seem to have here aswell.
    I got home last week after being abroad for work for two days, and noticed i couldn't get on the internet again. My system uses an iMac, TC and an internet modem i got from my ISP, which is a Motorola modem.
    Hooked the TC up to the modem via ethernet and this has been working without a glich for about 2 years now. I first noticed the problem on my iPhone which was unable to get on the internet. Connected to the network just fine, but no internet. Very strange, as i had a solid green light on my TC.
    Checked the internet on my iMac, and i found the same problem. Did a reset on the TC and the modem, and things seemed to be ok again. But.... after about 20mins. internet was not working any more again. By now i was getting rather frustrated, because in the AirPort Utility it said everything was working the way it should, including a solid green light on the TC.
    Been going over everything i could think off. Soft reset, hard reset, going back to factory settings, resetting the modem. Just resetting the modem, just resetting the TC, resetting both at te same time. Nothing seemed to work, the problem kept coming back! Downgraded the software on the TC, upgraded again. Nothing.
    Strange thing was, i hooked up my computer via ethernet directly to the cable-modem and internet was just fine, so no problem there, which was confirmed when i called my ISP (which is great... as long as there is no problem)
    After 3 days i finally called Apple, and they were ok to help me. For free just for once (next time i will have to pay 49euros!!) and told him about my problem. He gave me all suggestions i already tried, except changing channels on the TC.
    After the call i tried doing that, going from channel 1 to 6, but still... after 20 - 30 mins. internet would drop.
    But.... i put it on channel 7 and for now it is working great again. (no loss of internet for about 36hours!!)
    This seems to be THE solution for my problem. Apparently, one of my neighbours put up a device which was interfering with the signal of my TC, which caused all my problems!
    For now i am really happy everything is back, up and running and i thought i just let you all know about my problems, and solution, because this forum has been a great help!
    And... before i forget.... i am running firmware 7.3.2 now... because i read a lot of problems about 7.4.1 and things are running great for me now !!
    Hope this little story can help someone else..... try change the channels TC is working on !!
    Good luck to you all!
    Greetz, Peter
    (the Netherlands)

    I am new here, but i would like to share my experiences with a problem a lot of people seem to have here aswell.
    I got home last week after being abroad for work for two days, and noticed i couldn't get on the internet again. My system uses an iMac, TC and an internet modem i got from my ISP, which is a Motorola modem.
    Hooked the TC up to the modem via ethernet and this has been working without a glich for about 2 years now. I first noticed the problem on my iPhone which was unable to get on the internet. Connected to the network just fine, but no internet. Very strange, as i had a solid green light on my TC.
    Checked the internet on my iMac, and i found the same problem. Did a reset on the TC and the modem, and things seemed to be ok again. But.... after about 20mins. internet was not working any more again. By now i was getting rather frustrated, because in the AirPort Utility it said everything was working the way it should, including a solid green light on the TC.
    Been going over everything i could think off. Soft reset, hard reset, going back to factory settings, resetting the modem. Just resetting the modem, just resetting the TC, resetting both at te same time. Nothing seemed to work, the problem kept coming back! Downgraded the software on the TC, upgraded again. Nothing.
    Strange thing was, i hooked up my computer via ethernet directly to the cable-modem and internet was just fine, so no problem there, which was confirmed when i called my ISP (which is great... as long as there is no problem)
    After 3 days i finally called Apple, and they were ok to help me. For free just for once (next time i will have to pay 49euros!!) and told him about my problem. He gave me all suggestions i already tried, except changing channels on the TC.
    After the call i tried doing that, going from channel 1 to 6, but still... after 20 - 30 mins. internet would drop.
    But.... i put it on channel 7 and for now it is working great again. (no loss of internet for about 36hours!!)
    This seems to be THE solution for my problem. Apparently, one of my neighbours put up a device which was interfering with the signal of my TC, which caused all my problems!
    For now i am really happy everything is back, up and running and i thought i just let you all know about my problems, and solution, because this forum has been a great help!
    And... before i forget.... i am running firmware 7.3.2 now... because i read a lot of problems about 7.4.1 and things are running great for me now !!
    Hope this little story can help someone else..... try change the channels TC is working on !!
    Good luck to you all!
    Greetz, Peter
    (the Netherlands)

  • Using Bridge to Camera Raw to Open Image button also drop shadow problems

    I remember when I was working with RAW in PSE 8. I would be in Bridge looking at a pic and double click on it. PSE 8 would open in Camera RAW and I could play with the pic a bit, make some adjustments, then click on OPEN IMAGE. When I did that it would open in PSE and it would be in jpg format. With this PSE 9 and the updated Camera RAW 6.3, when I punch OPEN IMAGE I still have a picture labeled .CR2 which I think still means RAW. When I double click in Bridge the .CR2 pic shows as 8 bit depth. I can do a little more work on it and use SAVE AS. When I do that, the sample file name that shows is still in .CR2 format and I must change that to .jpg and then below change from PHOTOSHOP to JPEG to save my file as a jpg file. Is there something that I have to change in preferences to get it to open the image in jpg format when I hit the OPEN IMAGE button? Or, is this an "improvement" with RAW 6.3? Also, I seem to be having trouble adding a drop shadow (or any other effects) on jpeg pics. At least it doesn't show up on the screen after I apply it. I just recently updated to Camera RAW 6.3 and updated my Operating system on my iMac computer to OS 10.6.6. I emailed this request to my good friend with an identical setup on his iMac and he is having the same response when performing the above operations. Any ideas what the problem might be?

    Okay, previously you seem to have been using the bridge version of camera raw to edit your raw photos. That has many more options than the PSE version of the raw converter. (If you still have PSE 8, you can see the difference by using File>Open in the editor to open a raw photo for the PSE version of ACR, which works the same way in PSE 9.) In PSE's raw converter, you use the Open button, then save your photo in an image format in the editor. The Save button in ACR in PSE is only the DNG converter.
    Layer styles should work exactly the same way as in PSE 8. However, in any version of PSE a drop shadow, like a real shadow, needs someplace to fall, so unless there is empty space on the layer, it won't appear. Try creating text or drawing and simplifying a shape and adding a drop shadow. Does it appear then?
    Also remember that Jpegs won't let you save either layers or transparency when you resave the file.

  • Spry horizontal drop down problem in IE

    I would appreciate some help with a project I'm working on. My spry horizontal drop down menu looks best in Apple Safari on a Mac and looks worst in IE 8 on a PC. There are also some problems apparent in Firefox for both PC and Mac.
    The problem in IE is that the horizontal bar is not the correct height even though I have set the height in the css:
    ul.MenuBarHorizontal a
        display: block;
        cursor: pointer;
        color: #FFF;
        text-decoration: none;
        font-family: "Arial Narrow", Arial, Helvetica;
        font-size: 10pt;
        padding-top: 0.7em;
        padding-bottom: 0em;
        font-weight: normal;
        background-repeat: repeat-x;
        background-image: url(/2011images/gradientnav.jpg);
        height: 30px;
    The drop downs are the correct size, just the top menu bar that is not the right size.
    The menu bar is the correct height in Firefox and Safari, but in Firefox the menu bar is a few pixels higher than it should be.
    Here's the page I'm working on.
    http://westernstage.com/2011index.html

    This may help http://foundationphp.com/tutorials/sprymenu/customize1.php
    Also have a look here http://www.dwcourse.com/dreamweaver/ten-commandments-spry-menubars.php#one
    Gramps

  • 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?

  • Drop table problem

    How can i drop a table (Access) with JDBC like "test one"?
    My problem is, that the table have in the name a whitespace.
    thank's

    The Access convention for non-standard table or column names is to surround them with square brackets, like this:
    DROP TABLE [Bad Choice Of Name]

  • 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

  • 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.

Maybe you are looking for

  • MFP 177 wireless printing not work on win8.1

    Hi, Just bought a HP color Laserjet MFP177 4 in one printer. After installation (and many attempts) i am failng to print from my PC. However it did print the test page at the time of installation and scanning function is working fine. Please help

  • I cannot download music purchased from iTunes store to iPod

    All of a sudden when I connect my 2G Nano I get an error message that says, "Some of the items in the iTunes library were not copied to the iPod "your name iPod" Because your iPod software is too old. Go to the Summary in iPod preferences and click U

  • Blocking a Down payment for a particular vendor

    Hi Gurus, Can i block payments in form of Down payments to a particular vendor. All other bills that are due are eligible to be paid. I need this control to ensure that Payments for a particular vendor is always against an invoice and not downpayment

  • Oracle 11gR2 RAC: Running the script root.sh problem

    Folks, Hello. I am installing Oracle 11gR2 RAC using 2 Virtual Machines (rac1 and rac2 whose OS are Oracle Linux 5.6) in VMPlayer and according to the tutorial http://appsdbaworkshop.blogspot.com/2011/10/11gr2-rac-on-linux-56-using-vmware.html I have

  • My headphone jack is stuck in my ipod and broke off. What do I do to get it out?

    My ipod touch 4th Gen was working fine until I dropped it and the headphones broke off completely at the tip, so the jack is completely stuck, and I cant get it out with tweezers or anything. I might take it to the Apple store, but would they be able