1 Reply Latest reply on Sep 7, 2007 6:55 AM by Tolk

    File Reference Fails to Call .upload()

    Tolk Level 1
      Ok this is going to take a small bit of explaining but stick with me:

      I have two layers in the timeline, one with no key frames (layerA) and the other with all key frame for every frame in the layer (layerB).
      In layerA I have the action script to declare a FileReference variable and I also declare and attach a listener object to the file reference.
      The listener object detects the .onSelect event for the FileRefernce (this event is produced when the .browse() function of the FileReference class is called - which opens up a file browser and allows you to select a file). When onSelect is called the listener object runs the FileReference .upload() function which parses the selected file to a php script that uploads the file onto my server.
      The .browse() function for the FileReference is called from a frame in layerB. This is where weird stuff starts happening.
      When I test the movie the first time I enter the keyframe which calls the .browse() function the whole upload routine works and the file is successfully uploaded. If i continue to the next keyframe (using navigation controls) and then navigate back and try to repeat the upload proccess then the file browser opens up correctly, i select the file and then nothing happens. I'm having problems identifying the problem, as far as I can see it's as if it never emits the onSelect event once the file is selected, which shouldn't be the case as the .browse function works and a file is selected succesfully. This would imply the php script isn't working which is just silly as it's a pretty simple script and it works the first time.
      Anyone got any ideas, if you need more info just ask!


      UPDATE:

      Just did some testing and i'm completely confused, it's something to with the onSelect event. For some reason it isn't called/ isn't detected by the listener object. This is just weird because it calls fine the first time you enter the frame but if you navigate back it isn't detected. I checked the listener object was still in the scope of that frame and it appears to be so i'm completely muddled. The listener object is there and listening, the event to produce the onSelect event is run but then never detected.