SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 35 of 35
  1. #26
    SitePoint Enthusiast Anthony_c's Avatar
    Join Date
    May 2008
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On with the personal attacks again, are we? Not only is that a sign of insecurity, but it doesn't make you come off as any better, nor does it actually offer helpful advice, the very reason sitepoint exists. My favorite is your usage of "newbie", very mature.

    And you talk and go on and on, but you never show one snippet of code. Take gRobert's suggestion and put or or shut up, rather than trying as hard as you can to come off as some sort of dominant force here, which really just makes you look childish.

    mod_rewrite has a negligible effect on server performance, especially if it goes into httpd.conf. You're obviously not going for performance here, as you're not caching the XML output. Not caching the document probably has a greater impact. If performance was actually that important, you'd be using a caching proxy in front.
    Putting it in httpd.conf? Better to put it in the virtual host directive for this site. And the entire web server has a cache for the php engine, so the document will naturally cache as it remains the same, and my hosting provider uses a squid proxy front end for the cluster of servers anyway, so that just adds to it, eliminating the worries of performance.

    mod_rewrite sends a 302 when redirecting (not rewriting), unless you explicitly tell it to send a permanent redirect. 302 is not really the right status code for a temporary redirect, but browsers have been using it for years.
    We are not redirecting here, we are getting php output to flash. And I see you read the wikipedia article about HTTP I linked to, good for you!

  2. #27
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about a sample xml document? Just so I can recreate it using flash on my end.


  3. #28
    SitePoint Enthusiast Anthony_c's Avatar
    Join Date
    May 2008
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I provided an example earlier. See post #8 in this thread.

  4. #29
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well i've just recreated your code and got it working:

    http://eycdwebdesign.co.uk/test.swf
    http://eycdwebdesign.co.uk/portfolio.php

    Code actionscript:
    var xml:XML = new XML();
    xml.onLoad = function() {
        _root.temp.text = this.toString();
    };
    xml.load("portfolio.php");
    //yes, I tried changing it to .php here, keyword TRIED
    xml.ignoreWhite = true;
    stop;

    Code php:
    <?php
     
        header('content-type: text/xml');
        echo '<portfolio>
      <picture caption="picture 1" url="/path/to/images/pic1.jpg" />
      <picture caption="picture 2" url="/path/to/images/pic2.jpg" />
      <picture caption="picture 3" url="/path/to/images/pic3.jpg" />
      <picture caption="picture 4" url="/path/to/images/pic4.jpg" />
      <picture caption="picture 5" url="/path/to/images/pic5.jpg" />
    </portfolio>';
     
    ?>


  5. #30
    SitePoint Enthusiast Anthony_c's Avatar
    Join Date
    May 2008
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    weird, I swear when I tried it, it did not work, so I will give it another go with what you showed me. Might also try updating to CS3 now that I have Windows XP installed to a VM on my ubuntu partition in case it was a shortcoming in Flash 8.

  6. #31
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anthony_c View Post
    On with the personal attacks again, are we? Not only is that a sign of insecurity, but it doesn't make you come off as any better, nor does it actually offer helpful advice, the very reason sitepoint exists. My favorite is your usage of "newbie", very mature.
    You need to re-read what I said. I didn't call you "newbie" - I described what newbies do. It's you who assumed yourself was the newbie. I happen to post a lot of helpful advice around this forum, but I tend to do it more for people who aren't trying to push around their ego.

    Quote Originally Posted by Anthony_c View Post
    And you talk and go on and on, but you never show one snippet of code. Take gRobert's suggestion and put or or shut up, rather than trying as hard as you can to come off as some sort of dominant force here, which really just makes you look childish.
    I did, a long time ago. I already linked to that other page with the XML loading example to be helpful. Because you refused to read, that's your problem.

    Here's a copy of the code from the URL I linked:

    Code actionscript:
    myXML = new XML();
    myXML.ignoreWhite = true;
    myXML.onLoad = function() {
    	nodes = myXML.childNodes;
    	// ----------------------
    	// find first image
    	// ----------------------
    	if (topimage.length) {
    		for (var i = 0; i<nodes.length; i++) {
    			if (nodes[i].attributes.src == topimage) {
    				var insert = nodes.slice(0, i);
    				nodes.splice(0, i);
    				nodes = nodes.concat(insert);
    			}
    		}
    	}
    	_root.gotoAndStop(2);
    };
    if (_url.indexOf("http")>-1) {
    	myXML.load("gallery.php");
    } else {
    	myXML.load("gallery.xml");
    }

    As you see, loading XML from a .php file is very possible.

    I even noted that I tested it on the Windows Flash Player (and explicitly mentioned that). Adobe has been infamous for failing to support Linux with the newest Flash Player versions. That could have been a possible problem to consider. There are problems in Flash that only occur on Linux.

    Quote Originally Posted by Anthony_c View Post
    Putting it in httpd.conf? Better to put it in the virtual host directive for this site. And the entire web server has a cache for the php engine, so the document will naturally cache as it remains the same, and my hosting provider uses a squid proxy front end for the cluster of servers anyway, so that just adds to it, eliminating the worries of performance.
    You do know there's a difference between code being cached and data being cached. While the code may not be be re-interpreted, that doesn't mean that the directory isn't being re-read. Regardless, with a squid proxy, the mod_rewrite performance "issues" are irrelevant, and you were just making argument for the heck of it.

    Quote Originally Posted by Anthony_c View Post
    We are not redirecting here, we are getting php output to flash. And I see you read the wikipedia article about HTTP I linked to, good for you!
    I never said that we were trying to redirect. And where's the reply to my comment about the client not being involved in mod_rewrite? Were you wrong there?

    And I didn't need to read that article. I already knew from my knowledge =)

    ============

    You're the one (1) refusing to read my helpful link to an example, (2) trying to show your supposed "superiority," (3) and failing to reply to my corrections of your statements. For your information, other people read the posts around here, and many people find answers through searching. I wouldn't want them to get the wrong idea that mod_rewrite is evil, or a wrong idea about something else that you've mentioned.

  7. #32
    SitePoint Enthusiast Anthony_c's Avatar
    Join Date
    May 2008
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Well whatever, gRoberts actually posted helpful info rather than personally attack me and start arguments for the sake of it. It's resolved now, and I wish an admin would close this thread before the childish comments start up again.

    gRoberts:
    Thank you for actually helping me and posting code. I will try to load a php file in the flash app again, using some of the code you've showed me here. Sorry you had to play referee in this thread, .

    What should not have been an issue in the first place is now resolved. Thank you those who actually helped, the script is now practically perfected.

  8. #33
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, I provided helpful info. You just didn't want to listen. I was largely correcting you, not personally attacking you.

  9. #34
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dynamically loading data from PHP file will also increase load on server, as he says about 1GB bandwidth per page daily.

    So I still think there should be a static XML file created dynamically once per day / per week / on admin request, etc.

  10. #35
    SitePoint Enthusiast Anthony_c's Avatar
    Join Date
    May 2008
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Dynamically loading data from PHP file will also increase load on server, as he says about 1GB bandwidth per page daily
    Maybe, but it is not one server, it is a 5 server cluster with a squid proxy front, but if it gets too bad I will make it static.

    Hey, I provided helpful info.
    Enough from you, I find it hard to listen to attack-laced advice despite your claims. This is something we don't need on sitepoint. Reminds me of a childhood friend who's stepfather would, as you would say, give him "helpful advice", but my friend found it hard to take such advice with all the beatings that came with it. No this not illegal or quite that extreme, but the same concept applies here. I find these childish internet wars hilarious, and ridiculous that 2 grown men (although I wonder) carry on like this over something this trivial, but I worry of other users' responses to your attacks. But nonetheless I'm sure you'll quote me to death and get the last word but I don't care, I've actually got work to do which includes finishing this site.

    Again thanks for your help everyone else.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •