PDA

View Full Version : AS3 and JSFL


as3_novice
09-08-2008, 05:18 AM
I trying to create a simple SWF Window that allows you to browse for a file and then populate a text field with the file path. Here is the code I'm using. Can't seem to access the value "str" is supposed to be returned.

browse_btn.addEventListener(MouseEvent.MOUSE_UP,on Browse);
function onBrowse(evt:MouseEvent):String
{
var str = "fl.browseForFileURL('select', 'Select File');";
return MMExecute(str);
}


I have also attached my .fla

senocular
09-08-2008, 03:30 PM
Where are you assigning the MMExecute result to your text field .text property?

as3_novice
09-08-2008, 06:47 PM
I tried giving my text field an instance name and assigning the value of (str) to it, but I got errors about "undefined property of str". I heard that an event handler cannot return a value in AS3. If this is true, I'll have to try something different.

senocular
09-08-2008, 07:22 PM
what you want is to change your return to textFieldInstanceName.text =

as3_novice
09-09-2008, 01:34 AM
Thanks a million, that worked!!!