I am using a script with several steps, it will only need to download a file if it reaches a certain step in the process. While debugging I find it downloads the prefetch at the start of the action. How can I specify to download only once it reaches a certain step?
Actions in general only want to start when their downloads have already completed which is why except for the “download now” command (where the CLIENT actually downloads the file) you will always download the file before the action starts no matter what form of the download command you use.
Just be aware that the prefetch block will be evaluated before any of the actionscript executes. If this works for your use case, then this is the method you should use because it will still be able to download ahead of time using the relay infrastructure, but only download which ones are needed. This is nice because you won’t have a download somewhere in the middle of the actionscript execution that would hold up all action execution for the duration of the download.
In short, you should always use either a prefetch or a prefetch block. If you have a need that requires something more, then you should be certain it is the only option.