11 Replies Latest reply on Aug 7, 2008 8:24 AM by Newsgroup_User

    Problem when publishing Flex application on Server

    katychapman85 Level 1
      Hi,

      I got my application working on the localhost however now that I've put it onto the server I'm having a few problems. The URL for my application is:

      http://homepages.shu.ac.uk/~kchapma5/MakeItUp_Flex/src/MakeItUp.html

      Once you've selected a palette and the colours menu comes up, sometimes not all the colour images are displayed even though it's all the same image. Would someone be able to have a look at it for me to see if they know what's causing the problem?

      Thanks
      Katy
        • 1. Re: Problem when publishing Flex application on Server
          Level 7
          I got an error that seems to say your XML is not well formed. Do you not
          get that when you run the piece? Then there's an error that a repeater is
          not executing, but I suspect that's just because its XML isn't working.

          "katychapman85" <webforumsuser@macromedia.com> wrote in message
          news:g7d193$g41$1@forums.macromedia.com...
          > Hi,
          >
          > I got my application working on the localhost however now that I've put it
          > onto the server I'm having a few problems. The URL for my application is:
          >
          > http://homepages.shu.ac.uk/~kchapma5/MakeItUp_Flex/src/MakeItUp.html
          >
          > Once you've selected a palette and the colours menu comes up, sometimes
          > not
          > all the colour images are displayed even though it's all the same image.
          > Would
          > someone be able to have a look at it for me to see if they know what's
          > causing
          > the problem?
          >
          > Thanks
          > Katy
          >


          • 2. Re: Problem when publishing Flex application on Server
            katychapman85 Level 1
            I did get that when I used the debugger however I can't see anything wrong with my XML, this is the XML file for the colours:

            <?php
            header ("Content-type: text/xml");
            echo '<?xml version = "1.0"?>';
            $mysql = mysql_connect('ivy.shu.ac.uk:3306', 'kchapma5', 'flexible');

            mysql_select_db('kchapma5_db1');

            $ColourScheme = $_GET['Scheme'];
            $SelectedValue = $_GET['Value'];

            $Return = "<Colours>";

            if($ColourScheme == "EyeColourFamily")
            {
            $Query = "Select a.MakeUpColourNo, Colour, ColourNo From makeupcolours a, makeupcolour_colourfamily b, makeupcolour_bodypart c Where b.ColourFamilyNo = $SelectedValue And a.MakeUpColourNo = b.MakeUpColourNo And c.BodyPartNo = 1 And c.MakeUpColourNo = a.MakeUpColourNo";
            $Result = mysql_query($Query);

            while ($Row = mysql_fetch_object($Result))
            {
            $Return .= "<Colour ColourNo='0x".$Row->ColourNo."' Colour='".$Row->Colour."' MakeUpColourNo='".$Row->MakeUpColourNo."' PictureSrc='EyeShadowSmall'/>";
            }
            }

            if ($ColourScheme == "EyeColour")
            {
            $Query = "Select a.MakeUpColourNo, Colour, ColourNo From makeupcolours a, eyecolour_eyemakeup b Where b.EyeColourNo = $SelectedValue And a.MakeUpColourNo = b.MakeUpColourNo";
            $Result = mysql_query($Query);

            while ($Row = mysql_fetch_object($Result))
            {
            $Return .= "<Colour ColourNo='0x" .$Row->ColourNo. "' Colour='" .$Row->Colour. "' MakeUpColourNo='" .$Row->MakeUpColourNo. "' PictureSrc='EyeShadowSmall'/>";
            }
            }

            if ($ColourScheme == "LipsColourFamily")
            {
            $Query = "Select a.MakeUpColourNo, Colour, ColourNo From makeupcolours a, makeupcolour_colourfamily b, makeupcolour_bodypart c Where b.ColourFamilyNo = $SelectedValue And a.MakeUpColourNo = b.MakeUpColourNo And c.BodyPartNo = 2 And c.MakeUpColourNo = a.MakeUpColourNo";
            $Result = mysql_query($Query);

            while ($Row = mysql_fetch_object($Result))
            {
            $Return .= "<Colour ColourNo='0x" .$Row->ColourNo. "' Colour='" .$Row->Colour. "' MakeUpColourNo='" .$Row->MakeUpColourNo. "' PictureSrc='LipglossSmall'/>";
            }
            }

            if ($ColourScheme == "LipsSkinTone")
            {
            $Query = "Select a.MakeUpColourNo, Colour, ColourNo From makeupcolours a, skintone_makeup b, makeupcolour_bodypart c Where b.SkinToneNo = $SelectedValue And a.MakeUpColourNo = b.MakeUpColourNo And c.BodyPartNo = 2 And c.MakeUpColourNo = a.MakeUpColourNo";
            $Result = mysql_query($Query);

            while ($Row = mysql_fetch_object($Result))
            {
            $Return .= "<Colour ColourNo='0x" .$Row->ColourNo. "' Colour='" .$Row->Colour. "' MakeUpColourNo='" .$Row->MakeUpColourNo. "' PictureSrc='LipglossSmall'/>";
            }
            }

            if ($ColourScheme == "CheeksColourFamily")
            {
            $Query = "Select a.MakeUpColourNo, Colour, ColourNo From makeupcolours a, makeupcolour_colourfamily b, makeupcolour_bodypart c Where b.ColourFamilyNo = $SelectedValue And a.MakeUpColourNo = b.MakeUpColourNo And c.BodyPartNo = 3 And c.MakeUpColourNo = a.MakeUpColourNo";
            $Result = mysql_query($Query);

            while ($Row = mysql_fetch_object($Result))
            {
            $Return .= "<Colour ColourNo='0x" .$Row->ColourNo. "' Colour='" .$Row->Colour. "' MakeUpColourNo='" .$Row->MakeUpColourNo. "' PictureSrc='BlusherSmall'/>";
            }
            }

            if ($ColourScheme == "CheeksSkinTone")
            {
            $Query = "Select a.MakeUpColourNo, Colour, ColourNo From makeupcolours a, skintone_makeup b, makeupcolour_bodypart c Where b.SkinToneNo = $SelectedValue And a.MakeUpColourNo = b.MakeUpColourNo And c.BodyPartNo = 3 And c.MakeUpColourNo = a.MakeUpColourNo";
            $Result = mysql_query($Query);

            while ($Row = mysql_fetch_object($Result))
            {
            $Return .= "<Colour ColourNo='0x" .$Row->ColourNo. "' Colour='" .$Row->Colour. "' MakeUpColourNo='" .$Row->MakeUpColourNo. "' PictureSrc='BlusherSmall'/>";
            }
            }

            $Return .= "</Colours>";

            mysql_free_result($Result);
            print ($Return);
            ?>

            And this is the link to demonstrate an example of what is being retrieved:

            http://homepages.shu.ac.uk/~kchapma5/MakeItUp_Flex/src/Colours.php?Scheme=EyeColourFamily& Value=8

            It all looks ok to me, can you see anything wrong?

            Thanks for your help
            Katy
            • 3. Re: Problem when publishing Flex application on Server
              katychapman85 Level 1
              Just noticed that I had Colour as an attribute name as well as a tag name so I've changed the colour attribute to ColourName, but it's still saying the XML is not well formed. Any ideas?

              Thanks
              Katy
              • 4. Re: Problem when publishing Flex application on Server
                katychapman85 Level 1
                After having another look at the application the message about the XML not being well formed appears after a palette has been selected and not after a colour family has been selected from the drop down list. Which immplies it means that the XML I retrieve to populate the drop down list is not well formed. However, I've looked thorugh the XML file and I can't see anything wrong with it. Here is a link for an example output:

                http://homepages.shu.ac.uk/~kchapma5/MakeItUp_Flex/src/MenuOptions.php?Menu=1

                The weird thing is though, is that it only shows up the first time you click on a palette. Then if you select a colour family not all the colour images display. But if you then go back to palettes and select another palette, the message does not display again and everything appears to work ok.

                I just can't figure out what's wrong with it.

                The repeater message I believe is referring to the CoOrdinating Colours box, however I'm not sure why as if you click continue it works fine.
                • 5. Re: Problem when publishing Flex application on Server
                  Level 7

                  "katychapman85" <webforumsuser@macromedia.com> wrote in message
                  news:g7egul$5vi$1@forums.macromedia.com...
                  > After having another look at the application the message about the XML not
                  > being well formed appears after a palette has been selected and not after
                  > a
                  > colour family has been selected from the drop down list. Which immplies it
                  > means that the XML I retrieve to populate the drop down list is not well
                  > formed. However, I've looked thorugh the XML file and I can't see anything
                  > wrong with it. Here is a link for an example output:
                  >
                  > http://homepages.shu.ac.uk/~kchapma5/MakeItUp_Flex/src/MenuOptions.php?Menu=1
                  >
                  > The weird thing is though, is that it only shows up the first time you
                  > click
                  > on a palette. Then if you select a colour family not all the colour images
                  > display. But if you then go back to palettes and select another palette,
                  > the
                  > message does not display again and everything appears to work ok.
                  >
                  > I just can't figure out what's wrong with it.
                  >
                  > The repeater message I believe is referring to the CoOrdinating Colours
                  > box,
                  > however I'm not sure why as if you click continue it works fine.

                  Can you point your file on your desktop to your server? That way you have
                  access to the debugger, and you can look to see what values the variables
                  actually contain.


                  • 6. Re: Problem when publishing Flex application on Server
                    katychapman85 Level 1
                    How'd you mean? My files are on the server at the moment the URL I gave you is where they're hosted. I'm not quite sure what you mean, sorry if I'm being dumb, I'm still very new to all of this.

                    Thanks
                    Katy
                    • 7. Re: Problem when publishing Flex application on Server
                      Level 7

                      "katychapman85" <webforumsuser@macromedia.com> wrote in message
                      news:g7epli$f4j$1@forums.macromedia.com...
                      > How'd you mean? My files are on the server at the moment the URL I gave
                      > you is
                      > where they're hosted. I'm not quite sure what you mean, sorry if I'm being
                      > dumb, I'm still very new to all of this.

                      Open up Flex builder, and make sure your project is open. Find the part of
                      your project, probably an HTTPRequest, that points to your php page. This
                      is probably a relative path, which will point to localhost. Give it an
                      absolute path, pointing to your server.

                      It looks like you can't put a breakpoint on this, since the error seems to
                      be generated from your MXML. That means that probably when the debugger
                      breaks for you, you might not see anything useful. But try anyway. Hit the
                      little bug icon next to the run icon in Flex Builder and then look around in
                      the variables window to see what you can see once it breaks for you.

                      HTH;

                      Amy


                      • 8. Re: Problem when publishing Flex application on Server
                        katychapman85 Level 1
                        I just used fiddler a debugging tool to see what was wrong and when the error message comes up about the XML it shows that the url that has been sent to the server is this:

                        http://homepages.shu.ac.uk/~kchapma5/MakeItUp_Flex/src/MenuOptions.php?Menu=0

                        Which is why I'm getiing an XML error 0 is not suppose to be sent as the Menu number. However this is the function that is called:

                        public function GetOptions():void{
                        var Menu:int;
                        var selectedRadioValue:String = document.ColoursMenuRadioButtons.selectedValue;
                        if (selectedRadioValue == "EyeColourFamily")
                        {
                        Menu = 1;
                        document.Instruction1.text = "1. Select a colour family from the list above.";
                        }
                        else if (selectedRadioValue == "EyeColour")
                        {
                        Menu = 2;
                        document.Instruction1.text = "1. Select an eye colour from the list above.";
                        }
                        else if (selectedRadioValue == "LipsColourFamily")
                        {
                        Menu = 3;
                        document.Instruction1.text = "1. Select a colour family from the list above.";
                        }
                        else if (selectedRadioValue == "LipsSkinTone" || selectedRadioValue == "CheeksSkinTone")
                        {
                        Menu = 4;
                        document.Instruction1.text = "1. Select a skin tone from the list above.";
                        }
                        else if (selectedRadioValue == "CheeksColourFamily")
                        {
                        Menu = 5;
                        document.Instruction1.text = "1. Select a colour family from the list above.";
                        }

                        document.Instruction2.text = "2. Click on a colour to view more colour information.";
                        document.Instruction3.text = "3. Drag and drop colours into your palette.";
                        document.MenuOptions.url = "MenuOptions.php?Menu=";
                        document.MenuOptions.url += Menu;
                        document.MenuOptions.send();

                        document.ColoursList.visible = false;
                        document.ColoursList.includeInLayout = false;
                        document.Instructions.visible = true;
                        document.Instructions.includeInLayout = true;
                        }

                        Is there any reason why 0 is being sent to the server and the Menu variable isn't being set or the HTTPService request is being sent before the variable is set?

                        Thanks
                        Katy
                        • 9. Re: Problem when publishing Flex application on Server
                          Level 7

                          "katychapman85" <webforumsuser@macromedia.com> wrote in message
                          news:g7eu05$jif$1@forums.macromedia.com...
                          >I just used fiddler a debugging tool to see what was wrong and when the
                          >error
                          > message comes up about the XML it shows that the url that has been sent to
                          > the
                          > server is this:
                          >
                          > http://homepages.shu.ac.uk/~kchapma5/MakeItUp_Flex/src/MenuOptions.php?Menu=0
                          >
                          > Which is why I'm getiing an XML error 0 is not suppose to be sent as the
                          > Menu
                          > number. However this is the function that is called:
                          >
                          > public function GetOptions():void{
                          > var Menu:int;
                          > var selectedRadioValue:String =
                          > document.ColoursMenuRadioButtons.selectedValue;
                          > if (selectedRadioValue == "EyeColourFamily")
                          > {
                          > Menu = 1;
                          > document.Instruction1.text = "1. Select a colour family from the list
                          > above.";
                          > }
                          > else if (selectedRadioValue == "EyeColour")
                          > {
                          > Menu = 2;
                          > document.Instruction1.text = "1. Select an eye colour from the list
                          > above.";
                          > }
                          > else if (selectedRadioValue == "LipsColourFamily")
                          > {
                          > Menu = 3;
                          > document.Instruction1.text = "1. Select a colour family from the list
                          > above.";
                          > }
                          > else if (selectedRadioValue == "LipsSkinTone" || selectedRadioValue ==
                          > "CheeksSkinTone")
                          > {
                          > Menu = 4;
                          > document.Instruction1.text = "1. Select a skin tone from the list
                          > above.";
                          > }
                          > else if (selectedRadioValue == "CheeksColourFamily")
                          > {
                          > Menu = 5;
                          > document.Instruction1.text = "1. Select a colour family from the list
                          > above.";
                          > }
                          >
                          > document.Instruction2.text = "2. Click on a colour to view more colour
                          > information.";
                          > document.Instruction3.text = "3. Drag and drop colours into your
                          > palette.";
                          > document.MenuOptions.url = "MenuOptions.php?Menu=";
                          > document.MenuOptions.url += Menu;
                          > document.MenuOptions.send();
                          >
                          > document.ColoursList.visible = false;
                          > document.ColoursList.includeInLayout = false;
                          > document.Instructions.visible = true;
                          > document.Instructions.includeInLayout = true;
                          > }
                          >
                          > Is there any reason why 0 is being sent to the server and the Menu
                          > variable
                          > isn't being set or the HTTPService request is being sent before the
                          > variable is
                          > set?

                          I'm not sure what circumstances this would be called under, but you don't
                          have anything to catch if selectedRadioValue isn't one of your options. You
                          could try something like this:

                          if (Menu>0){
                          document.MenuOptions.url = "MenuOptions.php?Menu=";
                          document.MenuOptions.url += Menu;
                          document.MenuOptions.send();
                          }

                          You might want to move to a switch/case structure so you can really _see_
                          what is going on. That default label also makes it really obvious that this
                          is what you want to happen when there is no match.

                          HTH;

                          Amy


                          • 10. Re: Problem when publishing Flex application on Server
                            katychapman85 Level 1
                            Hi Amy,

                            I've changed my if statement a bit which has fixed the XML error. Still not entirely sure why I'm getting the repeater error as that executes fine if you click continue, so I'm not too bothered about that one.

                            However, the images are still not loading correctly. On the Fiddler debugger it shows the small image being retrieved from the server, then some of the other images are using the cached version of the image but the ones that don't appear have an icon next to their requests in the debugger which means "Respons was a request for client credentials". Do you know what this means or how I can correct it? As obviously I need all the images to load, I just don't know why they''re not all using the cache.

                            Thanks
                            Katy
                            • 11. Re: Problem when publishing Flex application on Server
                              Level 7

                              "katychapman85" <webforumsuser@macromedia.com> wrote in message
                              news:g7f2rq$ovl$1@forums.macromedia.com...
                              > Hi Amy,
                              >
                              > I've changed my if statement a bit which has fixed the XML error. Still
                              > not
                              > entirely sure why I'm getting the repeater error as that executes fine if
                              > you
                              > click continue, so I'm not too bothered about that one.
                              >
                              > However, the images are still not loading correctly. On the Fiddler
                              > debugger
                              > it shows the small image being retrieved from the server, then some of the
                              > other images are using the cached version of the image but the ones that
                              > don't
                              > appear have an icon next to their requests in the debugger which means
                              > "Respons
                              > was a request for client credentials". Do you know what this means or how
                              > I can
                              > correct it? As obviously I need all the images to load, I just don't know
                              > why
                              > they''re not all using the cache.

                              http://tinyurl.com/2a4oju