AS3 browser crashes arg...

1 view
Skip to first unread message

Curt

unread,
Nov 4, 2008, 4:20:38 PM11/4/08
to Baltimore SWF
Hi All,

I have come across a few code practices recently that cause the
browser plug-in, but not the CS3 development environment to crash
unexpectedly. They where kind of a bitch to troubleshoot so I thought
I would share. If you have come across any undocumented browser
crashing bugs I don't have listed share them with the group!

HTML enabled TextFields and multiline:
Recently I found that if you are using "htmlText" to populate your
dynamic TextField its an extremely good idea to set "multiline" to
"true" even if you are dealing with a single line of text. I was
getting frequent but seemingly random fatal browser crashes when
trying to remove the offending TextFields from the stage. When I set
multiline to true on html textfields the crashes stop.


Masked Content and removeChild:
When cleaning up your dynamically created DisplayObjects it's always a
good idea to clear your masks before removing the child from the
stage. As far as I can tell removing masked shapes, or images won't
crash the browser, but removing children with multiple children of
their own, or removing children that contain textfields can cause the
flash plug-in to crash your browser. I have gotten into the habit of
running the following code on clean up.

if(item.mask != null) item.mask = null;
if(item != null && item.parent != null) item.parent.removeChild(item);
item = null;

If i come across any more I'll post them. Thanks for starting this
group.

_curt
fastspot
Reply all
Reply to author
Forward
0 new messages