1
votes

I have tried a bunch of JSFL scripts to change textfields' fonts of a fla library. I used those scripts to change textfields' fonts for an embedded font which do exist in the library. All scripts run fine through Flash CS3 but always fail through Flash CS4

Let's give an example: replacing the "Arial" font used by all textfields in the fla scene by the "myEmbeddedArial*" embedded font (symbol). The jsfl font replacement instruction is the following one:

textElement.setTextAttr("face", "myEmbeddedArial*");

I can give a lots of all details about this issue but does someone already observed it and may know about its root cause ?

Thanks

P.S: Note the Find/Replace "Font" feature of Flash CS4 IDE works properly only if the textfields contain not emtpy strings and only if the symbol including this textfield is in a scene and only if you search in "Current Document" (and not in "Current Scene").

2
I'd like to know if you find a solution to this. Also, I'd like to see your script, if possible, as I may soon have the need for a similar hack.Mikko Tapionlinna
See the script sent by Rob: blog.samueltoth.com/?p=142 It parses all movie clips of the library and add the wished embedded glyph range to all textfields in those clips. Unfortunatly textElement.setTextAttr("face", "myEmbeddedArial*") can badly fail in CS4 if you try to set an embedded font symbol (depends on various CS3 to CS4 file conversion issues). And more unfortunatly setTextAttr will not return any value to let you know if it succeeded or failed and why. Please answer the mail I sent you from gmail if you need more details about that.khelkun

2 Answers

0
votes

I am not sure if it works for you but maybe: http://blog.samueltoth.com/?p=142

Good luck, Rob

0
votes

I think I found a successful workaround. So the only way to properly do that in CS4 IDE is to use the find/replace function, but the textfields' content must not be empty.

  1. Use your jsfl script to fulfill all empty textfields of your symbol library with a marker string like '####'.

  2. Ensure all the embedded font symbols used on your textfields are in your fla library. Because find/replace tool will not parse the textfields which use some embedded font symbols which don't exist in the library. Indeed some embedded font symbols may have been deleted and/or mapped on a default font (manually or during a file conversion from CS3 to CS4). Especially take care to case sensitivity on the embedded font symbol names.

  3. Create the missing embedded font symbols used on your textfields (with the right case sensitive names) before using find/replace feature.

  4. Create the new embedded font symbols you want to use to replace the old embedded font symbols.

  5. Now you should be able to use find/replace feature of CS4 properly even with embedded font symbols. Open find/replace window. Select "Search in: Current Document" (not in "Current Scene"). Create a new layer on your main scene. Create an instance of all the movie clips you have in your library in this layer (e.g: select all the symbol library then drag & drop the selection in the scene).

  6. Don't forget to remove your '####' string marker from all the textfields by using your jsfl script or the find/replace Text feature of the IDE. Finally delete the layer you created for the font replacement operation and all the symbol instances in it.