I figured out why the Flex example from my last post was loading sporadically. It had to do with the domain you were on when you clicked the link to it.
The problem
When I created the MXML file, I used a URL with the subdomain "www" in the HTTPService definition.
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<mx:HTTPService id="feedRequest" url="http://www.iknowkungfoo.com/blog/rss.cfm?mode=full" useProxy="false" showBusyCursor="true" />
1<mx:HTTPService id="feedRequest" url="http://www.iknowkungfoo.com/blog/rss.cfm?mode=full" useProxy="false" showBusyCursor="true" />
When I created the link to the SWF file in my last post, I used a relative path to the file.
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<a class="outbound" target="_blank" href="/examples/flex/blog_reader/BlogReader.swf">
1<a class="outbound" target="_blank" href="/examples/flex/blog_reader/BlogReader.swf">
So if you visited my site via the root domain, the link would be
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
http://iknowkungfoo.com/examples/flex/blog_reader/BlogReader.swf
1http://iknowkungfoo.com/examples/flex/blog_reader/BlogReader.swf
BlogCFC is setup to use the subdomain "www" as part of all the link it creates. Because of that, you could get the link as
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
http://www.iknowkungfoo.com/examples/flex/blog_reader/BlogReader.swf
1http://www.iknowkungfoo.com/examples/flex/blog_reader/BlogReader.swf
The SWF treats iknowkungfoo.com and www.iknowkungfoo.com as two separate domains and that is a security issue.
This is the actual error message that popped up:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at ::DirectHTTPMessageResponder/securityErrorHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
1[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"]
2 at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
3 at mx.rpc::Responder/fault()
4 at mx.rpc::AsyncRequest/fault()
5 at ::DirectHTTPMessageResponder/securityErrorHandler()
6 at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
7 at flash.events::EventDispatcher/dispatchEvent()
8 at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
Remote Data Security
From the Flex livedocs:
For security reasons, applications running in Flash Player on a client computer can only access remote data sources if one of the following conditions is met:
- Your application's compiled SWF file is in the same domain as the remote data source.
- You use a proxy and your SWF file is on the same server as the proxy.
- A crossdomain.xml (cross-domain policy) file is installed on the web server hosting the data source.
Oops.
The solution
Rather than mess around with a crossdomain.xml file right now, I opted to update the link to use the subdomain to satisfy the 1st requirement listed.
So now, if you have Flash Player 9, you can see the BlogReader.swf example here. :)