Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex: DeepCopy of FileReference
    text
    copied!<p>in my project, I let users pick pictures using the FileReference class. I then load these pictures into their .data properties, using the load() function. After this I perform some local manipulation and send them to the server.</p> <p>What I would like to do, is to be able to iterate over the picked FileReferences again, load them into .data properties, perform different manipulation and send them to the server once again. I know that I should be able to do this from user-invoked event, that is not an issue here.</p> <p>Problem is, once the FileReference is loaded for the first time, I can not unload it in any way, and I can not keep the data for all the pictures in the memory because these are huge.</p> <p>So I guess there is only one thing I can do, which is performing a DeepCopy on the FileReference... Then I could load the first version, scrap it and use the copy for the second 'run'.</p> <p>I tried to use ObjectUtil.copy, but when I access e.g. .name property of the copy, it fails with:</p> <pre><code>Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful. </code></pre> <p>at flash.net::FileReference/get name()</p> <p>the relevant snippet:</p> <pre><code>registerClassAlias("FileReference",FileReference); masterFileList.addItem(FileReference(ObjectUtil.copy(fr_load.fileList[i]))); trace(masterFileList[i].name) </code></pre> <p>Is it true that there are some protected properties of FileReference class that prevent it from being copied? If it is so, can I sidestep this somehow? Or is there any other solution to my overall problem?</p> <p>I appreciate any hints/ideas!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload