0

I want to save XML File using Flex 4 SDK

var fr:FileReference=new FileReference();
fr.save( newXmlRow, 'D:/Sample.xml' );

Error Shows :

1061 "Call to possibly Undefined method save through a reference with static type flash.net:FileReference"
Constantiner
  • 14,231
  • 4
  • 27
  • 34
Kumar K
  • 1
  • 1
  • What is target Flash Player version in your project settings? – Constantiner Jun 02 '11 at 11:54
  • Im Using Adobe Flash Player 10 . – Kumar K Jun 02 '11 at 12:31
  • Another question: is this error compile time or runtime? – Constantiner Jun 02 '11 at 12:32
  • 1
    So go to the project properties `> Flex Compiler > Adobe Flash Player Options` and please write what version is pointed there. – Constantiner Jun 02 '11 at 12:36
  • The `FileReference.save()` method is available in those the Flash Player 10 and AIR 1.5 runtime versions. If you're really using the Flex 4 SDK, those versions should be targeted by default. Are you sure you're using the Flex 4 SDK? The default minimum Flash Player version specified in Flex 3 is 9 and not 10. –  Jun 02 '11 at 12:36
  • @ Constantiner :I selected "Use Minimum Versionrequireed by the Flex SDK" – Kumar K Jun 02 '11 at 12:38
  • @Matt:Currently i developed application in Web ..not in AIR – Kumar K Jun 02 '11 at 12:40
  • @Constantiner:Whether i have to change the Flash Player 10.0.0 in Adobe Flash Player options – Kumar K Jun 02 '11 at 12:51
  • I changed adobe player options to 10.0.0 , ITs doesn,t shows error in compile time ,,But in run time it shows Error: Error #2087: The FileReference.download() file name contains prohibited characters. – Kumar K Jun 02 '11 at 13:00
  • @Constantiner & @Matt : Thanks .I got It Using of Adobe Flash Builder 10.0.0 – Kumar K Jun 02 '11 at 14:00
  • @Kumar In regards to `Error #2087` the second parameter of `FileReference.save()` should be file name, not file path. Use `Sample.xml`. – Constantiner Jun 02 '11 at 14:22

2 Answers2

3

Hi Please change according to this, I am sure that you will definitely come out from this situation.

Right Click on the Project -> click on the properties -> Go to FLEX Compiler -> Change Required FLASH Player version to 10.0.0

enter image description here

After completing this click on the apply button and have fun...

Have a nice day...

Sagar Rawal
  • 1,442
  • 2
  • 12
  • 39
0

You have to use background process for upload file. Like create functon/webservice for upload file in c#.net. You can not direct save file in flex.

Manoj Savalia
  • 1,402
  • 3
  • 13
  • 36
  • I think you misunderstood the question. I don't think the asker is talking about saving an upload to a server. The question is asking why saving a file in Flex, which is client-side, isn't working. –  Jun 02 '11 at 12:19
  • Im Using Adobe Falsh Player 10 . – Kumar K Jun 02 '11 at 12:31