Bug in JSFL fl.findObjectInDocByType in Flash CS3
New CS3 JSFL library’s are broken which would have been great to have. I tried to use the new finObjectInDocByType and I even used the example provided in the livedocs and it crashes. Maybe this was not implemented for AS3? I hope this gets fixed soon we could do some rad stuff! Adobe use the bug system that you have for Flex for Flash too!
******BUG******
Concise problem statement:
fl.finObjectInDocByType crashes in the example given in live docs.
Steps to reproduce bug:
Create a JSFL script and place it in your commands directory like other jsfl code.
Copy and past the first example from livedocs for finObjectInDocByType
Create a flash as3 fla file and place a text field on the stage.
command -> script name
you will get an error stating: At line 64 of file “ObjectFindAndSelect.jsfl”: TypeError: nextSymbolItemObj has no properties.


This error can be resolved by following these simple steps:
1) Go to the following location:
C:\Documents and Settings\ocal settings\application data\adobe\flash cs3\en\configuration\javascript (windows xp):
2) Open “ObjectFindAndSelect.jsfl” file.
3) Copy and paste the following code at line number 29:
if (objTimeline == undefined) {
return
}
4) Close flash CS3 and restart again, things should work fine.
Just a point I forgot to mention:
Copy the JSFL file which uses “fl.findObjectInDocByType” command to the /Commands directory and then try running the command from the Commands menu.
Vincy, your tips are brilliant. Helped me to fix my “fr.Find in Flash” Search panel completely.
I’d add a bit to your second comment:
It seems the “ObjectFindAndSelect.jsfl” file is executed automatically each time you run your JSFL code from the Commands menu.
But, if you run, for example, a JSFL file from your Flash Panel, the “ObjectFindAndSelect.jsfl” is not run automatically, so its functions like fl.findObjectInDocByType won’t be visible from your code.
To workaround this, just run the needed file before running your code:
fl.runScript( fl.configURI + \”WindowSWF/fr.findTextFromPanel.jsfl\
And its functions will start working for your flashpanel.
Thanks,
Rost
I was wondering Rost, could you give me an example of how to fix the ObjectFindAndSelect.jsfl problem from the WindowSWF I am stuck on this and I’m unable to work out what to do from your comment.
My AS3 class that is linked up to the WindowSWF calls on a button click
MMExecute(”fl.runScript(fl.configURI + ‘Javascript/ObjectFindAndSelect.jsfl’);”)
MMExecute(”fl.runScript(’file:///C|/svn/Flash/jsfl/brandLanguageConfigTools.jsfl’, ’skinFile’,\”" + strToPass + “\”,\”" + cbFLA.selectedItem.label + “\”);”);
The 2nd MME has the fl.findByName call which causes the error, I also put the fl.runScript(ObjectFindAndSelect.jsfl) call inside the functions of that JSFL hoping that would get it working but no cookie
any help?
thanks