The problem is that the browser is caching the SWF. You need to use a different URL so the browser is fooled into thinking you've got new content. There is probably a more elegant way to do this, but:
works. That will tack on a new value each time you invoke the load function and supply a dummy request parameter.
That makes good sense. but, i don't seem to be able to append a query string to the load url when it is a relative path. I get a broken image picture when I do.
When I add the absolute web address, i.e. on localhost, I encounter sandbox security issues that don't seem to be resolved by the crossdomain.xml file, as "localhost" does not seem to be a valid domain.
Ah, yes, the URL trick will only work when using a web server. There are some tricky sandbox issues here. Are you running this from within Flex Builder 2? My guess is that you are not. Flex Builder apps are automatically run with a local-trusted sandbox which means they can do anything. If you put your files onto a web server I'd be surprised you are getting security problems as the main swf and the FoodTracker.swf are all being loaded from the same domain. When you use a web server for testing, go back to using a relative path. When the request is made, the Flash Player will use http://<domain> automatically just as if you were using a <img src="image.jpg"> tag in HTML where the image.jpg was in the same directory as the HTML file.
OK, yes, you are right, my last post was due to the fact that I was executing the parent swf in the standalone flash player and not within a browser. the change to running from the browser fixed the issue,
unfortunately, the query string method is not causing the refresh as anticipated.
any other ideas would be nice, but its not very important. thank you.
I just use (in the loaded swf)
Works every time (every time I've used it anyway), and just leaves the parsing of the querystring up to me, which is easy enough. Makes it braindead easy to pass in simple param data to swfs loaded with SWFLoader.