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??
i want to use basically FileRefrence Class with load method of Flash CS4 with AS3. but it is not possible to work with this in CS3
i want to use code like below.
var file:FileReference = new FileReference()
file.load()
This will basically load file from system directly. but its not possibel in CS3.. in that case i have to upload the file in Server then download again from server to show the client. i mean File as Image. So if you think that there is another method then let me know. Because thats will take too much time in CS3 but not in CS4.
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);}
}
Thanks a lot for the help Raymond Basque... but i am not able to get the image in flash. i am getting ReferenceError: Error #1069 error, while selecting file in Flash Player 10. and Browser which have Flash Player 10.
Now i have Attched File.swf and Sam.swf file with this... Sam.swf has the same code as Raymond given. And File.swf is loaded by Internet which is developed in CS4 by some one. If we will open File.swf file in Player 10 then it will work and load Image in stage but not in Player 9.
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.
North America
Europe, Middle East and Africa
Asia Pacific