Flex 3 - HTTPService problem (ithink?)rbz. Jul 4, 2009 5:41 AM
Hey!
firstly; i'm usualy a forum ninja and never need to post, but im really struggling with this bit of code i wonder if anyone could help?.
Basically, when it loads it gets the data from an XML file and loads it into a list, (it doesn't use XMLCollections or Arrays or anything).
That works fine,
When i delete the selected item it removes it from the XML fine (does this by sending a POST request to a PHP file),
The problem is that when i send a reqeuest to refresh the XML, (call the init() ) method again, it doesnt update. At all. unless i press it a few times.
(im guessing its the Cache of the HTTPService, i've tried almost everything to disable, once i close the browser and reload it the correct items are shown)
i've attacthed the entire file below. please take a look and if you could help, it would be much appriciated - ive been stuck with this for hours.
also; Rename MySnorklets.txt to MySnorklets.mxml, the file is added through a parent using popupwindow.
Thanks, Rob.
- MySnorklets.txt 2.3 K
1. Re: Flex 3 - HTTPService problem (ithink?)leybniz Jul 4, 2009 5:51 AM (in response to rbz.)
your post lacks most valuable info, which browser are you using?
2. Re: Flex 3 - HTTPService problem (ithink?)rbz. Jul 4, 2009 5:56 AM (in response to leybniz)
Sorry!
Internet explorer 7.
Vista Ultimate
is there anything else?
3. Re: Flex 3 - HTTPService problem (ithink?)leybniz Jul 4, 2009 6:01 AM (in response to rbz.)
since your attachment still in queue.. I can only guess, but I think it's a browser/or whatever problem,
as far as I know HTTPService doesn't have any cache at all, when Flash Player runs inside IE 7 as ActiveX it utilizes IE methods for URL retrieving directly, so the only problem I see is IE Cache, randomize your URL requests to avoid such effects further.
If you feel this message answers your question or helps, please mark it respectively
4. Re: Flex 3 - HTTPService problem (ithink?)rbz. Jul 4, 2009 8:29 AM (in response to leybniz)
yeah, i've been sniffing around, but how about converting it to an XMLCollection so i could remove it easily like that?
this is the contents of the file.
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
[Bindable]
private var xData:XML;
[Bindable]
private var username:String;
public function init():void
{
username = "rob";
xmlService.send();
}
public function resultHandler(event:ResultEvent):void
{
xData = event.result as XML;
}
public function wat(event:ResultEvent):void
{
init();
}
public function DeleteSnorklet():void
{
var UsernameSD:String = username;
var IDSD:String = idSnorklet.text;
this.Delete.send({username: UsernameSD, id: IDSD});
}
]]>
</mx:Script>
<mx:HTTPService
<mx:HTTPService
<mx:List
<mx:Label
<mx:Label
<mx:Text
<mx:Image
<mx:Label
<mx:Label
<mx:Button
</mx:TitleWindow>
5. Re: Flex 3 - HTTPService problem (ithink?)leybniz Jul 4, 2009 8:41 AM (in response to rbz.)1 person found this helpful
public function init():void {
username = "rob";
// randomize url to avoid caching
xmlService.url = '{username}/itemlist.xml?rnd=' + new Date().getMilliseconds().toString();
xmlService.send();
}
Easily and XMLCollection are not synonyms
If you feel this message answers your question or helps, please mark it respectively
6. Re: Flex 3 - HTTPService problem (ithink?)rbz. Jul 4, 2009 8:53 AM (in response to leybniz)
Ah i see!
yeah this is getting somewhere that was helpfull.
However its still not removing the item from the list :\?
7. Re: Flex 3 - HTTPService problem (ithink?)rbz. Jul 4, 2009 10:41 AM (in response to rbz.)
bump o-o
8. Re: Flex 3 - HTTPService problem (ithink?)rbz. Jul 4, 2009 12:30 PM (in response to rbz.)
Alright, i managed to fix it myself.
i put it in an ArrayCollection and did it that way, then i removed it from the ArrayCollection whilst sending the post.
But many thanks Alexander Mazuruk anyway!
(this helped alot:)
Message was edited by: rbz.