×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    3

    Exclamation Load online XML problem: Device vs. Device Central

    Hi,

    I am currently facing some problems loading an online XML file. The strange thing is,
    that when I test the project in Adobe Device Central, the XML file DOES get downloaded & parsed,
    but when I run the swf on my device, it doesn't.

    In the onLoad handler of the XML object, the success-parameter returns "false", even though my device has asked me for a network connection.

    -> The publish settings are set to "Access Network only" by the way!

    the code:

    Code:
    import mx.utils.Delegate;
    
    var resultXML = new XML();
    resultXML.ignoreWhite = true;
    resultXML.onLoad = Delegate.create(this, locationFileLoaded);
    resultXML.load("http://twitter.com/statuses/user_timeline/16983611.rss");
    
    
    //resulthandler
    function locationFileLoaded(success:Boolean):Void{
    	if(success){
    		fscommand2("StartVibrate",800,10,1);
    	}
    }

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Load online XML problem: Device vs. Device Central

    Quote Originally Posted by davyhoskens View Post
    Hi,

    I am currently facing some problems loading an online XML file. The strange thing is,
    that when I test the project in Adobe Device Central, the XML file DOES get downloaded & parsed,
    but when I run the swf on my device, it doesn't.

    In the onLoad handler of the XML object, the success-parameter returns "false", even though my device has asked me for a network connection.

    -> The publish settings are set to "Access Network only" by the way!

    the code:

    Code:
    import mx.utils.Delegate;
    
    var resultXML = new XML();
    resultXML.ignoreWhite = true;
    resultXML.onLoad = Delegate.create(this, locationFileLoaded);
    resultXML.load("http://twitter.com/statuses/user_timeline/16983611.rss");
    
    
    //resulthandler
    function locationFileLoaded(success:Boolean):Void{
    	if(success){
    		fscommand2("StartVibrate",800,10,1);
    	}
    }
    What about crossdomain.xml file , DO u have this file on the server ?? If not, than might be this is the issue . Moreover, i advise u to go through these articles :
    Cross Domain File On Flash Lite 3
    and good hints :
    XML and Flash Lite Nightmare
    Hope these articles help u ..

    Best Regards,
    SajiSoft

  3. #3
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Load online XML problem: Device vs. Device Central

    The problem is the crossdomain policy, which restricts applications to using the API or web UI from Twitter.

    A quick cheat would be to create a PHP proxy on your own web server and use that.

    Alternatively you will need to use the API, for which they use basic authentication, this requires the ability to base64 encode the username and password as well as use XML.addRequestHeader API. Unfortunately that API is not working in Flash Lite.

    I suggest a proxy approach using the API.


    Mark
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  4. #4
    Registered User
    Join Date
    Feb 2009
    Posts
    3

    Re: Load online XML problem: Device vs. Device Central

    Hi, thanks for the response guys.

    But neither of the answers were helpfull. The crossdomain xml wasn't the problem, since I used the twitter rss/xml only as an example in this code. I am using a php proxy on my own server to load the actual xml file (so not a twitterfeed), to avoid the crossdomain problems, and extract the necessary data on serverside, instead of in the client FlashLite application...

    Doing some various tests, has showed me that compiling the same project in Flash CS3, produces an application that works,
    and compiling it in Flash CS4, gave me these troubles...

    So I know what to do now, which is continue in Flash CS3 =)

    Anyway, thanks for the response!


    edit: this didn't seem to be the problem after all. Aaaaargh...
    edit2: finally we realised the problem... The device we were testing on, is shipped with FL3, instead of FL2 like we thought... Moving the swf to the Trusted folder, solved the problem... TY guys
    Last edited by davyhoskens; 2009-04-24 at 21:32.

  5. #5
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Load online XML problem: Device vs. Device Central

    If you are using a single SWF file on the device then I recommend setting "Network Access only" in the publish settings. Once you've done that you should use the allowDomain("www.yourdomain.com") in the root of your fla. Then you won't need the trusted folder.

    The outputs between CS3 and CS4 are identical, so that was never going to be a solution :-)

    Mark
    www.flashmobileblog.com
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  6. #6
    Registered User
    Join Date
    Feb 2009
    Posts
    3

    Re: Load online XML problem: Device vs. Device Central

    Quote Originally Posted by markadoherty View Post
    If you are using a single SWF file on the device then I recommend setting "Network Access only" in the publish settings. Once you've done that you should use the allowDomain("www.yourdomain.com") in the root of your fla. Then you won't need the trusted folder.
    It was the first thing I tried, setting the "network access only" in the publish settings, and using the allowDomain function. On this Adobe page, I found that since I am _also_ using an xml on the device itself, the Trusted folder was needed.

    Quote Originally Posted by Adobe page
    If your swf accesses both local and remote data then forget about the publish settings because you can't set both local and remote access for a swf. What you will need to do is install your application into a folder called 'trusted' within the Flash Lite player directory. This will allow your swf to load data from any local or remote destination.
    Quote Originally Posted by markadoherty View Post
    The outputs between CS3 and CS4 are identical, so that was never going to be a solution :-)
    I realise this now On a friday afternoon, you would blame anything if stuff doesn't work

  7. #7
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Load online XML problem: Device vs. Device Central

    Ah, so in this case you will need the trusted folder. With Flash Lite 3.1 we have eased the security model to enable you to use local files and networking with ease. Feel free to check it out..

    http://labs.adobe.com/technologies/distributableplayer/


    Mark
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  8. #8
    Registered User
    Join Date
    Sep 2010
    Posts
    15

    Re: Load online XML problem: Device vs. Device Central

    Hi,

    Could you please explain clearly how to do "a proxy approach using the API"?

    Thanks.

Similar Threads

  1. Replies: 12
    Last Post: 2010-03-21, 19:25
  2. TRK problem: no connection to device
    By Ishibo San in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 8
    Last Post: 2009-08-20, 14:44
  3. Timer problem in device
    By Zilppuri in forum Symbian
    Replies: 1
    Last Post: 2009-03-02, 18:46
  4. RDA device selection problem
    By serg3d in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-10-26, 18:05
  5. Carbide vs 2.0 online registration problem
    By tonmoy_symbian in forum Symbian
    Replies: 0
    Last Post: 2006-07-27, 02:47

Posting Permissions

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