2 Replies Latest reply on Nov 9, 2010 12:35 PM by mikall1979

    Help dispatching event!!!

    mikall1979

      Hi all, I need your help!

       

      I have two buttons and a SWFloader object. The first button is labeled  "Load" and the second is "Transform".

       

      Now, when I click the "Load" button it loads an image in the SWFloader via a fileReference instance and when a click the button "Transform" a function transforms the image.

       

      The 2 pipelines are:

       

      1.

      Click Button -> event click -> function {fileReference.browse} -> event onFileSelect -> function {fileReference.load} -> event onFileComplete -> function {image.source = fileReference.data}

       

      2.

      Click Button -> event click -> function {Transform image}

       

      So far so good.

       

       

      Now I want only a button! The pipeline I have in mind is:

       

      Click Button -> event click -> function {fileReference.browse} -> event onFileSelect -> function {fileReference.load} -> event onFileComplete -> function {image.source = fileReference.data; function Transofm}

       

      et voilà! Nothing appears... I think because the image isn't completely loaded when I call Transform function. So I try with image.validateNow(); before ...

       

      {image.source = fileReference.data; image.validateNow(); function Transofm}nothing... I try to handle the Transform function as SWFloader complete event or creationComplete event, but nothig... it wants that I click the second button obligatorily!!!

       

      Please help me!