Hi all,
I still have ancient projects written in gobs of AS2. I came up against an issue with an old project that needs to be exported using Flash Player 8. The reason why is it's wrapped in a MDM Zinc application and Zinc does not allow AS2 projects to be exported with FP9 or FP10. So I'm stuck with AS2 and FP8.
Of course, this issue ONLY happens with AS2 and FP8. *cry*
Here's a code snippit that contains a CS5 FLA and 3 class files, all simplified down to the absolute bare minimum.
The issue is, the Selection class does not work at all with FP8 when classes are involved. More specifically, say one class creates an input text field and sets the Selection.setFocus() to that text field. If another class checks Selection.getCaratIndex() it will ALWAYS return -1 (not where the cursor is). In fact running a Selection.setSelection(#,#) doesn't produce a blinking cursor at all.
Here's the stripped down example:
http://www.filehorde.com/o/ExampleKeyboard.zip (10kb)
After running you must press the red button to focus the text field. Apparently in the IDE I can not do this via code for you. Flash itself must be selected before it can assign a focus. So that's the red button. The other two (amazingly artistic) gray buttons just send 'a' and 'b' to the text field.
I am tracing some code as it goes, just take note of 'carat'. It will always be -1 when it should not be.
If you run this under FP9 or FP10 it works perfectly fine. Of course I'm stuck using FP8...
Anyone come across this Selection class misbehaving in FP8? I see it's been around since AS1.0 and FP5.
A last note.. If I take it out of class context and just make a big frame script instead, this works fine with FP8. It has something to do with classes that makes the Selection class ride the fail boat.
I still have ancient projects written in gobs of AS2. I came up against an issue with an old project that needs to be exported using Flash Player 8. The reason why is it's wrapped in a MDM Zinc application and Zinc does not allow AS2 projects to be exported with FP9 or FP10. So I'm stuck with AS2 and FP8.
Of course, this issue ONLY happens with AS2 and FP8. *cry*
Here's a code snippit that contains a CS5 FLA and 3 class files, all simplified down to the absolute bare minimum.
The issue is, the Selection class does not work at all with FP8 when classes are involved. More specifically, say one class creates an input text field and sets the Selection.setFocus() to that text field. If another class checks Selection.getCaratIndex() it will ALWAYS return -1 (not where the cursor is). In fact running a Selection.setSelection(#,#) doesn't produce a blinking cursor at all.
Here's the stripped down example:
http://www.filehorde.com/o/ExampleKeyboard.zip (10kb)
After running you must press the red button to focus the text field. Apparently in the IDE I can not do this via code for you. Flash itself must be selected before it can assign a focus. So that's the red button. The other two (amazingly artistic) gray buttons just send 'a' and 'b' to the text field.
I am tracing some code as it goes, just take note of 'carat'. It will always be -1 when it should not be.
If you run this under FP9 or FP10 it works perfectly fine. Of course I'm stuck using FP8...
Anyone come across this Selection class misbehaving in FP8? I see it's been around since AS1.0 and FP5.
A last note.. If I take it out of class context and just make a big frame script instead, this works fine with FP8. It has something to do with classes that makes the Selection class ride the fail boat.