V8 of the player (i don´t know 9) seems to have a BIG problem with
textfields. Anytime you modify the contents of an html text field from
WITHING the text field (ie: you are modifying the textfield using a link
on the textfield) the player start doing weird things with the content.
I have the same problem in an html editor i made, where you can "click" on
the images. The player starts duplicating the image and you will end with
two, three or more images stacked. In your case, the player is duplicating
the link all over the textfield.
Try doing the same but using a button... No problem and all works as
expected.
My solution (because i can´t use a button to edit the image) was to
rebuild the area. Yes... each time you edit an image, i rebuild the entire
textarea...
Regards,
On Tue, 28 Nov 2006 10:05:34 -0300, GregoryN <[EMAIL PROTECTED]> wrote:
Hello all,
I'm upgrading a project from v7 to v8 player. Main reason is better
text readability.
In this project, split().join() combination is used to hide/show some
text (similar to css tricks in "normal" html).
It works great in player v7, but, when published for v8, all text
becomes underlined...
Here is a test movie (click "replace" link):
http://gousable.com/flash/temp/flashcoders/split_join_bug/textSplitJoin_1.html
Source:
http://gousable.com/flash/temp/flashcoders/split_join_bug/textSplitJoin1_source.zip
In my (original) movie, all the text also becomes a link...
Code:
// ======= START OF CODE ===========
var lorem_ipsum:String = "Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Donec vehicula. Nullam orci. Nulla viverra. Curabitur
venenatis. Quisque nisi. Aliquam in turpis a tellus semper cursus. ";
Nulla viverra. Curabitur venenatis. Quisque nisi. Aliquam in turpis a
tellus semper cursus. ";
var string2replace:String = "<br><br>*<tag_to_replace />*<br><br>";
var links_area:String = "<u><a
href=\"asfunction:doReplace,var1\">replace: case #1</a></u><br><br>";
// NOTE:
// createTextField() does NOT return a tf object in player v7
// show system info
this.createTextField("sys_info", this.getNextHighestDepth(), 10, 10,
400, 30);
sys_info.text = "Flash Player: "+System.capabilities.version;
sys_info.border = true;
sys_info.borderColor = 0x0000ff;
var is_v8_or_later:Boolean =
(Number(System.capabilities.version.substr(4,1)) >=8) ;
//trace("is_v8player = "+is_v8_or_later);
sys_info.text += ", is_v8_or_later = "+is_v8_or_later;
var my_format:TextFormat = new TextFormat();
my_format.font = "Verdana";
this.createTextField("my_text1", this.getNextHighestDepth(), 10, 50,
400, 300);
my_text1.multiline = true;
my_text1.wordWrap = true;
my_text1.antiAliasType = "advanced";
my_text1.html= true;
my_text1.border = true;
my_text1.borderColor = 0x00ff00;
my_text1.embedFonts = true;
var startText:String = lorem_ipsum + string2replace + links_area
+ lorem_ipsum;
my_text1.htmlText = startText;
my_text1.setTextFormat(my_format);
// doReplace
function doReplace(p:String):Void{
trace("doReplace called");
var tag2replace:String = "<tag_to_replace />";
var my_replace:String = "=== Lorem ipsum ===";
my_text1.htmlText= startText.split( tag2replace
).join( my_replace );
my_text1.setTextFormat(my_format);
}
// ======= END OF CODE ===========
What is it - known bug or I'm missing something?
Any help is appreciated.
--
_____________
Marcelo Volmaro
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com