Skip navigation
Currently Being Moderated

Want to access FileReference class add on properties and methods of CS4 in CS3

Apr 7, 2009 8:32 AM

great new look of Forum

 

 

 

Hi All,

 

     I have an urgent task to implement in my project code. I can't able to access the new properties and methods which are present in FileReference Class. For load() ,save() methods needs runtime version of Flash Player 10. I need to include the flash player 10 in CS3 publish settings Version. Otherwise you can suggest how i can able to access the FileReference class new properties and methods without CS4.

 

Previously I checked this same for Flash 8 with Flash Player 9. I mean i can compile my Flash 8 code in Flash Player 9 previously. So is it also possible with Flash CS3??

 

 

 
Replies
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 7, 2009 8:36 AM   in reply to Varun Upadhyay

    the best you can do is run an update of your flash cs3 and see if that gives the capacity to publish for fp 10.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 9, 2009 7:06 AM   in reply to Varun Upadhyay

    Well, you *could* turn off strict mode and compile the swf using the FP10 FileReference methods.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 9, 2009 7:29 AM   in reply to Varun Upadhyay

    Or you could do something like this:

     

    // a Button component instance on the stage
    myButton.addEventListener(MouseEvent.CLICK, onButtonClick);

    var loader:Loader = addChild(new Loader()) as Loader;

    var file:FileReference;
    var fileFilters:Array =
    [
    new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg;*.jpeg;*.gif;*.png")
    ];

    function onButtonClick(event:MouseEvent)
    {
    file = new FileReference();
    file.addEventListener(Event.SELECT, selectHandler);
    file.addEventListener(Event.COMPLETE, completeHandler);
    file.browse(fileFilters);
    }


    function selectHandler(event:Event):void {
    var f:FileReference = FileReference(event.target);
    var loadFunc:Function = null;
    try
    {
      loadFunc = f["load"];
    }
    catch(e){}

    if(loadFunc != null)
    {
      loadFunc();
    }
    }
    function completeHandler(event:Event):void {
    var f:FileReference = FileReference(event.target);
    var d:ByteArray=null;
    try
    {
      d = f["data"];
    }
    catch(e){}
    if(d != null){loader.loadBytes(d);}

    }

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 9, 2009 8:07 AM   in reply to Raymond Basque

    and you'll want to manually change your html file to require fp 10.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2009 5:30 AM   in reply to Varun Upadhyay

    It appears that the swf using FileReference must be marked version 10. Here's a quick hack to force CS3 to do so:

     

    Navigate to the Flash program player configuration folder. i.e. <drive>:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Players and copy FlashLite3_0.xml to FlashPlayer10.xml.

     

    Open the FlashPlayer10.xml and make these changes:

     

    <players>
      <player id="Flash Player 10" version="10">
      <name>Flash Player 10</name>

      <feature name="mobileAuthoringIntegration"  supported="false" />

    </players>

     

    You can leave the rest of the xml as is. Restart Flash.

     

    In Publish Settings, select Flash Player 10, and recompile.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points